Began removal of platform/. The Monitor:: namespace is completely converted.
[aesalon.git] / src / monitor / asm / InstructionList.cpp
blobce65a33daf0f551ce81e9697322724fa778b94fa
1 #include "InstructionList.h"
3 namespace Aesalon {
4 namespace Monitor {
5 namespace ASM {
7 std::size_t InstructionList::get_instruction_count() const {
8 std::size_t count = 0;
9 for(instruction_list_t::const_iterator i = instruction_list.begin(); i != instruction_list.end(); i ++) {
10 if((*i).is_valid()) count ++;
12 return count;
15 Misc::SmartPointer<Instruction> InstructionList::get_instruction_by_index(std::size_t index) const {
16 instruction_list_t::const_iterator i = instruction_list.begin();
17 for(; index > 0 && i != instruction_list.end(); i ++) {
18 if((*i).is_valid()) index --;
20 if(i == instruction_list.end()) return NULL;
21 return *i;
24 } // namespace ASM
25 } // namespace Monitor
26 } // namespace Aesalon