BenchGen
BenchGen is a tool for generating benchmarks to stress-test a computing system.
Loading...
Searching...
No Matches
generatorScope.h
Go to the documentation of this file.
1#ifndef GENERATORSCOPE_H
2#define GENERATORSCOPE_H
3#include <map>
4
5#include "../shared/enums.h"
7#include "generatorVariable.h"
8
16 private:
17 int indentation; // The current level of indentation for the scope
18
19 public:
20 int numberOfAddedVars; // Number of variables added to this scope
21 std::vector<int> avaiableVarsID; // List of available variable IDs in this scope
22 std::vector<int> avaiableParamsID; // List of available parameter IDs in this scope
23
31 GeneratorScope(int identation = 1) {
32 avaiableVarsID = {};
35 this->indentation = identation;
36 }
37
47 GeneratorScope(std::vector<int> parentVars, std::vector<int> parentParams, int parentIndentation) {
48 this->avaiableVarsID = parentVars;
49 this->avaiableParamsID = parentParams;
50 this->numberOfAddedVars = 0;
51 this->indentation = parentIndentation + 1;
52 }
53
60
66 int getVarCounter();
67
73 int getIndentation();
74
84 std::string getIndentationTabs(int = 0);
85
94 void addVar(int id);
95
104 int addParam();
105};
106
107#endif
The GeneratorScope class manages scopes in the generator.
Definition generatorScope.h:15
std::vector< int > avaiableParamsID
Definition generatorScope.h:22
std::vector< int > avaiableVarsID
Definition generatorScope.h:21
std::string getIndentationTabs(int=0)
Generates a string of tabs for code indentation.
Definition generatorScope.cpp:11
GeneratorScope(int identation=1)
Constructs a GeneratorScope with an optional initial indentation level.
Definition generatorScope.h:31
GeneratorScope(std::vector< int > parentVars, std::vector< int > parentParams, int parentIndentation)
Constructs a GeneratorScope based on a parent scope.
Definition generatorScope.h:47
void addVar(int id)
Adds a variable ID to the current scope.
Definition generatorScope.cpp:19
~GeneratorScope()
Destructor for the GeneratorScope class.
Definition generatorScope.h:59
int addParam()
Adds a new parameter ID to the current scope.
Definition generatorScope.cpp:24
int numberOfAddedVars
Definition generatorScope.h:20
int getVarCounter()
Gets the number of available variables in the current scope.
Definition generatorScope.cpp:3
int getIndentation()
Retrieves the current indentation level.
Definition generatorScope.cpp:7