41#include "environment.h"
80 operands{(std::pair<uint64_t, uint64_t>*)calloc(
81 env.getMaxNbOperands(),
82 sizeof(std::pair<uint64_t, uint64_t>))} {};
96 operands{(std::pair<uint64_t, uint64_t>*)calloc(
98 sizeof(std::pair<uint64_t, uint64_t>))}
101 if (this->operands != NULL) {
105 this->operands[idx] = other.
operands[idx];
125 free((
void*)this->operands);
190 const std::pair<uint64_t, uint64_t>&
getOperand(
191 const uint64_t idx)
const;
217 bool setOperand(
const uint64_t idx,
const uint64_t dataIndex,
218 const uint64_t location,
const bool check =
true);
The Environment class contains all information needed to execute a Program.
Definition environment.h:86
size_t getMaxNbOperands() const
Get the size of the maximum number of operands of Instructions::Set.
Definition environment.cpp:183
uint64_t destinationIndex
Definition line.h:60
const Environment & getEnvironment() const
Get the environment within which the Line was created.
Definition line.cpp:43
Line()=delete
Delete the default constructor.
std::pair< uint64_t, uint64_t > *const operands
Definition line.h:64
const Environment & environment
Environment within which the Program will be executed.
Definition line.h:53
bool setOperand(const uint64_t idx, const uint64_t dataIndex, const uint64_t location, const bool check=true)
Setter for the operands of this Line.
Definition line.cpp:86
Line(const Line &other)
Copy constructor of a Line performing a deep copy.
Definition line.h:92
~Line()
Definition line.h:123
bool operator!=(const Line &other) const
Opposite of the operator==.
Definition line.cpp:129
bool operator==(const Line &other) const
Comparison operator between Line.
Definition line.cpp:110
uint64_t instructionIndex
index of the Instruction of the Set of the Environment.
Definition line.h:56
uint64_t getInstructionIndex() const
Getter for the instructionIndex of this Line.
Definition line.cpp:62
bool setInstructionIndex(const uint64_t instr, const bool check=true)
Setter for the instructionIndex of this Line.
Definition line.cpp:67
Line(const Environment &env)
Constructor for a Line of a program.
Definition line.h:78
bool setDestinationIndex(const uint64_t dest, const bool check=true)
Setter for the destinationIndex of this Line.
Definition line.cpp:53
uint64_t getDestinationIndex() const
Getter for the destinationIndex of this Line.
Definition line.cpp:48
Line & operator=(const Line &other)=delete
const std::pair< uint64_t, uint64_t > & getOperand(const uint64_t idx) const
Getter for the operands of this Line.
Definition line.cpp:76