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

The GeneratorFunction class represents a function in the generated code. More...

#include <generatorFunction.h>

Public Member Functions

 GeneratorFunction ()
 Default constructor for GeneratorFunction.
 
 GeneratorFunction (int id)
 Constructs a GeneratorFunction with a specific ID.
 
 ~GeneratorFunction ()=default
 Destructor for the GeneratorFunction class.
 
int getId ()
 Gets the ID of the generator function.
 
std::vector< std::string > getLines ()
 Retrieves the lines of code in the generator function.
 
void addLine (std::string)
 Adds a single line of code to the generator function.
 
void addLine (std::vector< std::string >)
 Adds multiple lines of code to the generator function.
 

Public Attributes

bool insertBack = false
 

Detailed Description

The GeneratorFunction class represents a function in the generated code.

This class is responsible for managing the lines of code within a function, including adding lines and retrieving them. It also handles function identifiers and determines where to insert new lines based on specific logic.

Constructor & Destructor Documentation

◆ GeneratorFunction() [1/2]

GeneratorFunction::GeneratorFunction ( )
inline

Default constructor for GeneratorFunction.

Initializes a new instance of the GeneratorFunction class without setting an ID.

◆ GeneratorFunction() [2/2]

GeneratorFunction::GeneratorFunction ( int id)
inline

Constructs a GeneratorFunction with a specific ID.

Parameters
idThe unique identifier for the function.

◆ ~GeneratorFunction()

GeneratorFunction::~GeneratorFunction ( )
default

Destructor for the GeneratorFunction class.

Currently, this destructor does not perform any special operations.

Member Function Documentation

◆ addLine() [1/2]

void GeneratorFunction::addLine ( std::string line)

Adds a single line of code to the generator function.

Parameters
lineThe line of code to add.

◆ addLine() [2/2]

void GeneratorFunction::addLine ( std::vector< std::string > lines)

Adds multiple lines of code to the generator function.

This method takes a vector of strings, each representing a line of code, and adds them to the function.

Parameters
linesA vector of lines of code to add.

◆ getId()

int GeneratorFunction::getId ( )

Gets the ID of the generator function.

Returns
The ID of the generator function.

◆ getLines()

std::vector< std::string > GeneratorFunction::getLines ( )

Retrieves the lines of code in the generator function.

Returns
A vector of strings, each representing a line of code.

Member Data Documentation

◆ insertBack

bool GeneratorFunction::insertBack = false

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