44#include "data/constantHandler.h"
45#include "environment.h"
46#include "program/line.h"
83 std::vector<std::pair<Line*, bool>>
lines;
101 static uint64_t incrementeCounter();
109 static void resetProgramIDCounter();
110 friend struct ::CounterReset;
124 : environment{e}, programID{incrementeCounter()},
125 constants{e.getParams().nbProgramConstant},
126 actionProgram{actProgram}
140 : environment{other.environment}, lines{other.lines},
141 programID{other.programID}, constants{other.constants},
142 actionProgram{other.actionProgram}
146 std::transform(lines.begin(), lines.end(), lines.begin(),
147 [](std::pair<Line*, bool>& otherLine)
148 -> std::pair<Line*, bool> {
149 return {new Line(*(otherLine.first)),
165 : environment{other.environment}, programID{incrementeCounter()},
166 lines{other.lines}, constants{other.constants},
167 actionProgram{actProgram}
171 std::transform(lines.begin(), lines.end(), lines.begin(),
172 [](std::pair<Line*, bool>& otherLine)
173 -> std::pair<Line*, bool> {
174 return {new Line(*(otherLine.first)),
214 Line& addNewLine(
const uint64_t idx);
221 void addNewLine(
Line newLine);
244 void removeLine(
const uint64_t idx);
253 void swapLines(
const uint64_t idx0,
const uint64_t idx1);
269 size_t getNbLines()
const;
278 const Line& getLine(uint64_t index)
const;
287 Line& getLine(uint64_t index);
297 bool isIntron(uint64_t index)
const;
304 bool isActionProgram()
const;
314 uint64_t identifyIntrons();
357 bool hasIdenticalBehavior(
const Program& other)
const;
364 uint64_t getProgramID()
const;
371 virtual void setProgramID(uint64_t newID);
381 static uint64_t getProgramIDCounter();
Data::DataHandler used by Program::Program to handle their set of Constant values.
Definition constantHandler.h:56
void resetData() override
Sets all elements of the Array to 0 (or its equivalent for the given template param....
Definition primitiveTypeArray.h:189
The Environment class contains all information needed to execute a Program.
Definition environment.h:86
const Environment & environment
Environment within which the Program will be executed.
Definition program.h:60
Program(const Environment &e, bool actProgram)
Main constructor of the Program.
Definition program.h:123
Program()=delete
Delete the default constructor.
Program & operator=(const Program &other)=delete
Data::ConstantHandler constants
Constants of the Program.
Definition program.h:91
Program(const Program &other)
Copy constructor of the Program.
Definition program.h:139
Program(const Program &other, bool actProgram)
Copy constructor of the Program.
Definition program.h:164
std::vector< std::pair< Line *, bool > > lines
Lines of the program and intron property.
Definition program.h:83
bool actionProgram
Boolean indicating if true that the program is an action program, if false that it is a context progr...
Definition program.h:70
uint64_t programID
Unique identifier of the Program.
Definition program.h:96
Struct to reset static counters in classes.
Definition counterReset.h:14
Data type used in Program::Program to define constant values, accessible to Instructions,...
Definition constant.h:49