BenchGen
BenchGen is a tool for generating benchmarks to stress-test a computing system.
|
Class representing an array variable. More...
#include <generatorVariable.h>
Public Member Functions | |
GeneratorArray () | |
Default constructor for the Array class. | |
GeneratorArray (int totalSize, int id) | |
Constructs an Array with a specified size, values, and identifier. | |
~GeneratorArray () | |
Destructor for the Array class. | |
std::vector< std::string > | new_ (bool inFunction=false) override |
Creates a new variable. | |
std::vector< std::string > | insert () override |
Generates code to perform an insertion operation on the variable. | |
std::vector< std::string > | remove () override |
Generates code to perform a removal operation on the variable. | |
std::vector< std::string > | contains (bool shouldReturn=false) override |
Generates code to perform a contains operation on the variable. | |
std::vector< std::string > | free () override |
Generates code to free or release resources associated with the variable. | |
std::vector< std::string > | genIncludes () override |
Generates necessary include statements for the variable. | |
std::vector< std::string > | genGlobalVars () override |
Generates global variable declarations for the variable type. | |
std::vector< std::string > | genParams (std::string paramName, std::vector< GeneratorVariable * > varsParams) override |
Generates parameter handling code for functions using this variable type. | |
![]() | |
virtual | ~GeneratorVariable () |
Public Attributes | |
int | totalSize |
![]() | |
int | id |
std::string | name |
std::string | typeString |
Class representing an array variable.
This class provides methods for operations specific to array variables.
|
inline |
Default constructor for the Array class.
GeneratorArray::GeneratorArray | ( | int | totalSize, |
int | id ) |
Constructs an Array with a specified size, values, and identifier.
totalSize | The size of the array. |
values | Pointer to the array of integer values. |
id | The unique identifier for the array. |
GeneratorArray::~GeneratorArray | ( | ) |
Destructor for the Array class.
|
overridevirtual |
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. |
Implements GeneratorVariable.
|
overridevirtual |
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.
Implements GeneratorVariable.
|
overridevirtual |
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.
Implements GeneratorVariable.
|
overridevirtual |
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.
Implements GeneratorVariable.
|
overridevirtual |
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. |
Implements GeneratorVariable.
|
overridevirtual |
Generates code to perform an insertion operation on the variable.
The exact behavior of this method depends on the type of the variable.
Implements GeneratorVariable.
|
overridevirtual |
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. |
Implements GeneratorVariable.
|
overridevirtual |
Generates code to perform a removal operation on the variable.
The behavior of this method varies depending on the type of the variable.
Implements GeneratorVariable.
int GeneratorArray::totalSize |