Continued ripping up the source.
[aesalon.git] / monitor / src / asm / InstructionList.h
blobc705a4a6b4fd01b9dd5c69690d29420ade098409
1 #ifndef AESALON_MONITOR_ASM_INSTRUCTION_LIST_H
2 #define AESALON_MONITOR_ASM_INSTRUCTION_LIST_H
4 #include <vector>
5 #include "Types.h"
6 #include "Instruction.h"
8 namespace Aesalon {
9 namespace Monitor {
10 namespace ASM {
12 class InstructionList {
13 protected:
14 typedef std::vector<Misc::SmartPointer<Instruction> > instruction_list_t;
15 private:
16 Word offset;
17 instruction_list_t instruction_list;
18 public:
19 InstructionList(Word offset = 0) : offset(offset) {}
20 virtual ~InstructionList() {}
22 void add_instruction(Misc::SmartPointer<Instruction> new_instruction)
23 { instruction_list.push_back(new_instruction); }
24 Misc::SmartPointer<Instruction> get_instruction(Word address) const {
25 if(address > offset) return NULL;
26 return instruction_list[address-offset];
28 std::size_t get_instruction_count() const;
29 Misc::SmartPointer<Instruction> get_instruction_by_index(std::size_t index) const;
33 } // namespace ASM
34 } // namespace Monitor
35 } // namespace Aesalon
37 #endif