Began removal of platform/. The Monitor:: namespace is completely converted.
[aesalon.git] / src / monitor / Memory.h
blob46ea774b10befb5899fe8b75f903c38ed156e607
1 #ifndef AESALON_PLATFORM_MEMORY_H
2 #define AESALON_PLATFORM_MEMORY_H
4 #include <string>
5 #include <set>
7 #include "MemoryBlock.h"
8 #include "misc/Event.h"
9 #include "misc/SmartPointer.h"
10 #include "Types.h"
12 namespace Aesalon {
13 namespace Monitor {
15 /** Stores the memory associated with a program. */
16 class Memory {
17 protected:
18 typedef std::set<Misc::SmartPointer<MemoryBlock> > block_set_t;
19 private:
20 block_set_t block_set;
22 void add_block(Misc::SmartPointer<MemoryBlock> new_block) {
23 block_set.insert(new_block);
25 void remove_block(Misc::SmartPointer<MemoryBlock> block);
26 public:
27 /** Generic constructor. */
28 Memory() {}
29 /** Virtual destructor. */
30 virtual ~Memory() {}
32 /** Returns the block at the specified MemoryAddress.
33 @param address The address to look for.
34 @return The @a MemoryBlock at @a address, or NULL if not found.
36 Misc::SmartPointer<MemoryBlock> get_block(Word address) const;
38 /** Handle an event as a "diff", and apply it to the current memory representation.
39 @param event The event to handle.
41 void handle_event(Misc::SmartPointer<Misc::Event> event);
44 } // namespace Monitor
45 } // namespace Aesalon
47 #endif