1 #ifndef AESALON_MONITOR_BREAKPOINT_H
2 #define AESALON_MONITOR_BREAKPOINT_H
8 #include "BreakpointObserver.h"
16 typedef std::set
<Misc::SmartPointer
<BreakpointObserver
> > observer_list_t
;
20 const Byte BREAKPOINT_CHARACTER
;
24 observer_list_t observer_list
;
26 Breakpoint(Word address
, Byte original
);
27 virtual ~Breakpoint() {}
29 std::size_t get_id() const { return id
; }
30 Byte
get_original() const { return original
; }
31 Word
get_address() const { return address
; }
32 Byte
get_breakpoint_character() const { return BREAKPOINT_CHARACTER
; }
34 bool is_valid() const { return valid
; }
35 void set_valid(bool new_validity
) { valid
= new_validity
; }
37 void add_observer(Misc::SmartPointer
<BreakpointObserver
> observer
)
38 { observer_list
.insert(observer
); this->set_valid(true); }
39 void remove_observer(Misc::SmartPointer
<BreakpointObserver
> observer
) {
40 observer_list_t::iterator i
= observer_list
.find(observer
);
41 if(i
!= observer_list
.end()) observer_list
.erase(i
);
42 if(observer_list
.size() == 0) this->set_valid(false);
49 } // namespace Monitor
50 } // namespace Aesalon