40#include "environment.h"
79 operands{(std::pair<uint64_t, uint64_t>*)calloc(
80 env.getMaxNbOperands(),
81 sizeof(std::pair<uint64_t, uint64_t>))} {};
95 operands{(std::pair<uint64_t, uint64_t>*)calloc(
97 sizeof(std::pair<uint64_t, uint64_t>))}
100 if (this->operands != NULL) {
104 this->operands[idx] = other.
operands[idx];
124 free((
void*)this->operands);
189 const std::pair<uint64_t, uint64_t>&
getOperand(
190 const uint64_t idx)
const;
216 bool setOperand(
const uint64_t idx,
const uint64_t dataIndex,
217 const uint64_t location,
const bool check =
true);
The Environment class contains all information needed to execute a Program.
Definition: environment.h:84
size_t getMaxNbOperands() const
Get the size of the maximum number of operands of Instructions::Set.
Definition: environment.cpp:182
uint64_t destinationIndex
Definition: line.h:59
const Environment & getEnvironment() const
Get the environment within which the Line was created.
Definition: line.cpp:42
Line()=delete
Delete the default constructor.
std::pair< uint64_t, uint64_t > *const operands
Definition: line.h:63
const Environment & environment
Environment within which the Program will be executed.
Definition: line.h:52
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:85
Line(const Line &other)
Copy constructor of a Line performing a deep copy.
Definition: line.h:91
~Line()
Definition: line.h:122
bool operator!=(const Line &other) const
Opposite of the operator==.
Definition: line.cpp:128
bool operator==(const Line &other) const
Comparison operator between Line.
Definition: line.cpp:109
uint64_t instructionIndex
index of the Instruction of the Set of the Environment.
Definition: line.h:55
uint64_t getInstructionIndex() const
Getter for the instructionIndex of this Line.
Definition: line.cpp:61
bool setInstructionIndex(const uint64_t instr, const bool check=true)
Setter for the instructionIndex of this Line.
Definition: line.cpp:66
Line(const Environment &env)
Constructor for a Line of a program.
Definition: line.h:77
bool setDestinationIndex(const uint64_t dest, const bool check=true)
Setter for the destinationIndex of this Line.
Definition: line.cpp:52
uint64_t getDestinationIndex() const
Getter for the destinationIndex of this Line.
Definition: line.cpp:47
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:75