OpenASIP
2.0
|
#include <OSEdInformer.hh>
Public Types | |
enum | EventId { EVENT_REGISTER, EVENT_RESET, EVENT_MEMORY } |
Public Member Functions | |
OSEdInformer () | |
virtual | ~OSEdInformer () |
void | handleEvent (EventId event) |
void | registerListener (EventId event, OSEdListener *listener) |
void | unregisterListener (EventId event, OSEdListener *listener) |
Private Types | |
typedef std::map< EventId, std::vector< OSEdListener * > > | ListenerContainer |
Container for mapping event ids to Listener objects. More... | |
Private Member Functions | |
OSEdInformer (const OSEdInformer &) | |
Copying not allowed. More... | |
OSEdInformer & | operator= (const OSEdInformer &) |
Assignment not allowed. More... | |
Private Attributes | |
ListenerContainer | listeners_ |
All listeners. More... | |
Notifies listeners that a certain event has occurred.
Listeners are OSEdListener objects that are interested on events.
Definition at line 47 of file OSEdInformer.hh.
|
private |
Container for mapping event ids to Listener objects.
Definition at line 67 of file OSEdInformer.hh.
All possible events.
Enumerator | |
---|---|
EVENT_REGISTER | Event when register value might change. |
EVENT_RESET | Event when operation is reseted. |
EVENT_MEMORY | Event when memory may be changed. |
Definition at line 52 of file OSEdInformer.hh.
OSEdInformer::OSEdInformer | ( | ) |
|
virtual |
|
private |
Copying not allowed.
void OSEdInformer::handleEvent | ( | EventId | event | ) |
Handles event of given id.
If no such id exists, nothing is done.
event | Event to be handled. |
Definition at line 58 of file OSEdInformer.cc.
References listeners_.
Referenced by SimulateDialog::onAdvanceClock(), SimulateDialog::onFormatChanged(), SimulateDialog::onReset(), and SimulateDialog::onTrigger().
|
private |
Assignment not allowed.
void OSEdInformer::registerListener | ( | EventId | event, |
OSEdListener * | listener | ||
) |
Registers listener to informers data base.
event | Event of which given listener is interested in. |
listener | Listener to be registered. |
Definition at line 74 of file OSEdInformer.cc.
References listeners_.
Referenced by MemoryDialog::MemoryDialog(), and SimulateDialog::SimulateDialog().
void OSEdInformer::unregisterListener | ( | EventId | event, |
OSEdListener * | listener | ||
) |
Unregisters listener from the informer.
event | Event for which given listener is registered to listen. |
listener | Listener to be unregistered. |
Definition at line 92 of file OSEdInformer.cc.
References listeners_.
Referenced by MemoryDialog::onClose(), SimulateDialog::onClose(), and SimulateDialog::onOK().
|
private |
All listeners.
Definition at line 75 of file OSEdInformer.hh.
Referenced by handleEvent(), registerListener(), and unregisterListener().