BenchGen
BenchGen is a tool for generating benchmarks to stress-test a computing system.
Loading...
Searching...
No Matches
VariableFactory Class Reference

Factory class for creating generator variables. More...

#include <generatorVariable.h>

Static Public Member Functions

static GeneratorVariablecreateVariable (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.
 

Static Public Attributes

static unsigned int var_counter = 0
 

Detailed Description

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.

Member Function Documentation

◆ 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
typeThe type of variable to create (e.g., "array").
identifierA 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
typeThe 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
typeThe 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
typeThe type of variable to create (e.g., "array").
paramNameThe name of the parameter.
varsParamsList 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
typeThe type of variable to create (e.g., "array").
Returns
A string representing the type of the variable.

Member Data Documentation

◆ var_counter

unsigned int VariableFactory::var_counter = 0
static

The documentation for this class was generated from the following files: