GEGELATI
Loading...
Searching...
No Matches
set.h
1
39#ifndef SET_H
40#define SET_H
41
42#include <cstdint>
43#include <functional>
44
45#include "instructions/instruction.h"
46
47namespace Instructions {
54 class Set
55 {
56 protected:
60 std::vector<std::reference_wrapper<const Instruction>> instructions;
61
62 public:
68 Set() : instructions{} {};
69
79 bool add(const Instruction& instruction);
80
87 unsigned int getNbInstructions() const;
88
97 const Instruction& getInstruction(const uint64_t i) const;
98
106 unsigned int getMaxNbOperands() const;
107 };
108} // namespace Instructions
109
110#endif
This abstract class is the base class for any instruction to be used in a Program.
Definition instruction.h:61
Class for storing a set of Instruction.
Definition set.h:55
Set()
Default constructor.
Definition set.h:68
bool add(const Instruction &instruction)
Add an instruction to the set.
Definition set.cpp:42
const Instruction & getInstruction(const uint64_t i) const
Get the Instruction at the given index i in the Set.
Definition set.cpp:54
std::vector< std::reference_wrapper< const Instruction > > instructions
Ordered container of the Instruction of the set.
Definition set.h:60
unsigned int getMaxNbOperands() const
Get the maximum number of operands for Instruction currently contained in the Set.
Definition set.cpp:60
unsigned int getNbInstructions() const
Get the number of Instruction contained in the Set.
Definition set.cpp:49
Definition addPrimitiveType.h:49