Base class for managing template generation.
More...
#include <TemplateManager.h>
|
| virtual void | generateTemplateImpl (const std::string &templateName, const std::string &outputPath)=0 |
| | Actual implementation for generating a specific template.
|
| |
| bool | already_generated (const std::string &path) |
| | Checks whether a file was already generated by this system.
|
| |
Base class for managing template generation.
Provides common facilities for:
- holding model / Wilson identifiers,
- storing a ModelModifier and GeneralNumModelModifier,
- checking if a file has already been generated (using the
//42 marker),
- exposing the set of interpreted dependencies (parameters).
Definition at line 31 of file TemplateManager.h.
◆ TemplateManagerBase()
| TemplateManagerBase::TemplateManagerBase |
( |
const std::string & |
templatesDir | ) |
|
|
inline |
Constructs a manager with a given templates directory.
- Parameters
-
| templatesDir | Path to the directory containing template sources. |
Definition at line 37 of file TemplateManager.h.
◆ ~TemplateManagerBase()
| virtual TemplateManagerBase::~TemplateManagerBase |
( |
| ) |
|
|
virtualdefault |
◆ already_generated()
| bool TemplateManagerBase::already_generated |
( |
const std::string & |
path | ) |
|
|
protected |
Checks whether a file was already generated by this system.
The method scans the small generated-file header for the marker string "//42". If found, the file is considered already generated. This covers both numeric files (marker on line one) and analytical files (marker immediately after the preserved first template line).
- Parameters
-
| path | Path to the file to test. |
- Returns
true if file exists and contains the marker, false otherwise.
Definition at line 122 of file TemplateManager.cpp.
◆ generateTemplate()
| void TemplateManagerBase::generateTemplate |
( |
const std::string & |
templateName, |
|
|
const std::string & |
outputPath |
|
) |
| |
|
inline |
Public entry point for template generation.
Delegates to the virtual generateTemplateImpl method implemented by derived classes.
- Parameters
-
| templateName | Name of the template (without extension). |
| outputPath | File path where the generated C++ file should be written. |
Definition at line 50 of file TemplateManager.h.
◆ generateTemplateImpl()
| virtual void TemplateManagerBase::generateTemplateImpl |
( |
const std::string & |
templateName, |
|
|
const std::string & |
outputPath |
|
) |
| |
|
protectedpure virtual |
Actual implementation for generating a specific template.
Derived classes implement the logic that:
- locates the template file,
- creates directories,
- copies or transforms the contents,
- optionally writes parameter files.
- Parameters
-
| templateName | Template identifier (without extension). |
| outputPath | Destination C++ file path. |
◆ get_dependencies()
| std::unordered_set< InterpretedParam > TemplateManagerBase::get_dependencies |
( |
| ) |
|
◆ setModelAndWilson()
| void TemplateManagerBase::setModelAndWilson |
( |
std::string |
model, |
|
|
std::string |
wilson |
|
) |
| |
|
inline |
Sets both model and Wilson names used during generation.
- Parameters
-
| model | Model name. |
| wilson | Wilson basis name. |
Definition at line 71 of file TemplateManager.h.
◆ setModelModifier()
| void TemplateManagerBase::setModelModifier |
( |
std::unique_ptr< ModelModifier > |
modifier | ) |
|
|
inline |
◆ setNumModelModifier()
◆ model
| std::string TemplateManagerBase::model |
|
protected |
◆ modelModifier
| std::unique_ptr<ModelModifier> TemplateManagerBase::modelModifier |
|
protected |
◆ numModifier
◆ templatesDir
| std::string TemplateManagerBase::templatesDir |
|
protected |
◆ wilson
| std::string TemplateManagerBase::wilson |
|
protected |
The documentation for this class was generated from the following files:
- /home/runner/work/Hyperiso/Hyperiso/Hyperiso/Hyperiso/core/src/ExternalIntegration/MartyInterface/TemplateManager.h
- /home/runner/work/Hyperiso/Hyperiso/Hyperiso/Hyperiso/core/src/ExternalIntegration/MartyInterface/TemplateManager.cpp