BenchGen
BenchGen is a tool for generating benchmarks to stress-test a computing system.
|
Abstract base class for variable generation. More...
#include <generatorVariable.h>
Public Member Functions | |
virtual | ~GeneratorVariable () |
virtual std::vector< std::string > | new_ (bool inFunction=false)=0 |
Creates a new variable. | |
virtual std::vector< std::string > | insert ()=0 |
Generates code to perform an insertion operation on the variable. | |
virtual std::vector< std::string > | remove ()=0 |
Generates code to perform a removal operation on the variable. | |
virtual std::vector< std::string > | contains (bool shouldReturn=false)=0 |
Generates code to perform a contains operation on the variable. | |
virtual std::vector< std::string > | free ()=0 |
Generates code to free or release resources associated with the variable. | |
virtual std::vector< std::string > | genIncludes ()=0 |
Generates necessary include statements for the variable. | |
virtual std::vector< std::string > | genGlobalVars ()=0 |
Generates global variable declarations for the variable type. | |
virtual std::vector< std::string > | genParams (std::string paramName, std::vector< GeneratorVariable * > varsParams)=0 |
Generates parameter handling code for functions using this variable type. | |
Public Attributes | |
int | id |
std::string | name |
std::string | typeString |
Abstract base class for variable generation.
This class defines a common interface for different types of generator variables. It provides methods for common operations, which may vary in behavior depending on the specific type of variable.
|
inlinevirtual |
|
pure virtual |
Generates code to perform a contains operation on the variable.
The behavior of this method varies depending on the type of the variable.
shouldReturn | Indicates whether the method should generate code that returns a value based on the condition. |
Implemented in GeneratorArray, and GeneratorSortedList.
|
pure virtual |
Generates code to free or release resources associated with the variable.
This method generates code to clean up or release resources held by the variable, if necessary. The specific actions taken depend on the type of the variable and how resources are managed.
Implemented in GeneratorArray, and GeneratorSortedList.
|
pure virtual |
Generates global variable declarations for the variable type.
This method returns a vector of strings representing the typedefs and struct definitions necessary for the specific variable type.
Implemented in GeneratorArray, and GeneratorSortedList.
|
pure virtual |
Generates necessary include statements for the variable.
This method returns a vector of strings containing the required include directives for working with the variable type.
Implemented in GeneratorArray, and GeneratorSortedList.
|
pure virtual |
Generates parameter handling code for functions using this variable type.
This method generates code to handle parameters when functions utilize this variable type. It includes initialization and assignment for the parameters.
paramName | The name of the parameter. |
varsParams | List of variables to be used as parameters. |
Implemented in GeneratorArray, and GeneratorSortedList.
|
pure virtual |
Generates code to perform an insertion operation on the variable.
The exact behavior of this method depends on the type of the variable.
Implemented in GeneratorArray, and GeneratorSortedList.
|
pure virtual |
Creates a new variable.
This method generates code to initialize a new variable. The exact implementation depends on the specific type of the variable.
inFunction | Indicates whether the variable is created within a function context. |
Implemented in GeneratorArray, and GeneratorSortedList.
|
pure virtual |
Generates code to perform a removal operation on the variable.
The behavior of this method varies depending on the type of the variable.
Implemented in GeneratorArray, and GeneratorSortedList.
int GeneratorVariable::id |
std::string GeneratorVariable::name |
std::string GeneratorVariable::typeString |