Factory class for creating generator variables.
More...
#include <generatorVariable.h>
|
static GeneratorVariable * | createVariable (std::string type, int identifier) |
| Creates a GeneratorVariable of the specified type.
|
|
static std::string | genTypeString (std::string type) |
| Generates a string representation of the variable type.
|
|
static std::vector< std::string > | genIncludes (std::string type) |
| Generates include statements required for the specified variable type.
|
|
static std::vector< std::string > | genGlobalVars (std::string type) |
| Generates global variable declarations for the specified variable type.
|
|
static std::vector< std::string > | genParams (std::string type, std::string paramName, std::vector< GeneratorVariable * > varsParams) |
| Generates parameter handling code for functions using the specified variable type.
|
|
Factory class for creating generator variables.
This class provides static methods to create instances of GeneratorVariable based on a specified type, as well as methods to generate code components related to the variable type.
◆ createVariable()
GeneratorVariable * VariableFactory::createVariable |
( |
std::string | type, |
|
|
int | identifier ) |
|
static |
Creates a GeneratorVariable of the specified type.
This method constructs a variable of a given type, initializing it with a unique identifier. The created variable can then be used in code generation scenarios.
- Parameters
-
type | The type of variable to create (e.g., "array"). |
identifier | A unique identifier for the variable. |
- Returns
- A pointer to the created GeneratorVariable object.
◆ genGlobalVars()
std::vector< std::string > VariableFactory::genGlobalVars |
( |
std::string | type | ) |
|
|
static |
Generates global variable declarations for the specified variable type.
This method creates a temporary variable of the specified type to retrieve its global variable declarations.
- Parameters
-
type | The type of variable to create (e.g., "array"). |
- Returns
- A vector of strings representing global variable declarations.
◆ genIncludes()
std::vector< std::string > VariableFactory::genIncludes |
( |
std::string | type | ) |
|
|
static |
Generates include statements required for the specified variable type.
This method creates a temporary variable of the specified type to determine the necessary include statements for that type.
- Parameters
-
type | The type of variable to create (e.g., "array"). |
- Returns
- A vector of strings representing the include directives.
◆ genParams()
std::vector< std::string > VariableFactory::genParams |
( |
std::string | type, |
|
|
std::string | paramName, |
|
|
std::vector< GeneratorVariable * > | varsParams ) |
|
static |
Generates parameter handling code for functions using the specified variable type.
This method creates a temporary variable of the specified type to generate code for handling parameters in functions. It initializes and assigns values to the parameters.
- Parameters
-
type | The type of variable to create (e.g., "array"). |
paramName | The name of the parameter. |
varsParams | List of variables to be used as parameters. |
- Returns
- A vector of strings representing the code for parameter handling.
◆ genTypeString()
std::string VariableFactory::genTypeString |
( |
std::string | type | ) |
|
|
static |
Generates a string representation of the variable type.
This method creates a temporary variable of the specified type to retrieve its type string.
- Parameters
-
type | The type of variable to create (e.g., "array"). |
- Returns
- A string representing the type of the variable.
◆ var_counter
unsigned int VariableFactory::var_counter = 0 |
|
static |
The documentation for this class was generated from the following files: