1 #ifndef AESALON_PLATFORM_MEMORY_H
2 #define AESALON_PLATFORM_MEMORY_H
7 #include "MemoryBlock.h"
8 #include "misc/Event.h"
9 #include "misc/SmartPointer.h"
15 /** Stores the memory associated with a program. */
18 typedef std::set
<Misc::SmartPointer
<MemoryBlock
> > block_set_t
;
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
);
27 /** Generic constructor. */
29 /** Virtual destructor. */
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