GEGELATI
set.h
1
38#ifndef SET_H
39#define SET_H
40
41#include <functional>
42
43#include "instructions/instruction.h"
44
45namespace Instructions {
52 class Set
53 {
54 protected:
58 std::vector<std::reference_wrapper<const Instruction>> instructions;
59
60 public:
66 Set() : instructions{} {};
67
77 bool add(const Instruction& instruction);
78
85 unsigned int getNbInstructions() const;
86
95 const Instruction& getInstruction(const uint64_t i) const;
96
104 unsigned int getMaxNbOperands() const;
105 };
106} // namespace Instructions
107
108#endif
This abstract class is the base class for any instruction to be used in a Program.
Definition: instruction.h:59
Class for storing a set of Instruction.
Definition: set.h:53
Set()
Default constructor.
Definition: set.h:66
bool add(const Instruction &instruction)
Add an instruction to the set.
Definition: set.cpp:41
const Instruction & getInstruction(const uint64_t i) const
Get the Instruction at the given index i in the Set.
Definition: set.cpp:53
std::vector< std::reference_wrapper< const Instruction > > instructions
Ordered container of the Instruction of the set.
Definition: set.h:58
unsigned int getMaxNbOperands() const
Get the maximum number of operands for Instruction currently contained in the Set.
Definition: set.cpp:59
unsigned int getNbInstructions() const
Get the number of Instruction contained in the Set.
Definition: set.cpp:48
Definition: addPrimitiveType.h:48