eVaf
|
iEventQueue interface implementation More...
#include <Common/eventqueue.h>
Public Member Functions | |
virtual void | broadcastEvent (Event *event) |
Sends the event to all the subscribers. More... | |
virtual bool | event (QEvent *e) |
Qt event handler. More... | |
EventQueue () | |
virtual uint | queryEvent (QString const &name) const |
Queries for an existing event. More... | |
virtual uint | registerEvent (QString const &name) |
Registers an event. More... | |
virtual uint | subscribeEvent (uint id, QObject *obj) |
Subscribes to an event. More... | |
virtual void | unregisterEvent (uint id) |
Unregisters an event. More... | |
virtual void | unsubscribeEvent (uint id, QObject *obj) |
Unsubscribes from an event. More... | |
virtual | ~EventQueue () |
Public Member Functions inherited from eVaf::Common::iEventQueue | |
iEventQueue () | |
Interface constructor. More... | |
virtual | ~iEventQueue () |
Empty virtual destructor. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from eVaf::Common::iEventQueue | |
static iEventQueue * | instance () |
Returns the instance of the iEventQueue interface. More... | |
iEventQueue interface implementation
Definition at line 38 of file eventqueue.h.
eVaf::Common::Internal::EventQueue::EventQueue | ( | ) |
|
virtual |
|
virtual |
Sends the event to all the subscribers.
event | The event object |
This function sends the event to all the subscribers. The event object is destroyed when the event loop is finished for this event.
The event object shall be allocated in the heap.
Implements eVaf::Common::iEventQueue.
|
virtual |
Qt event handler.
|
virtual |
Queries for an existing event.
name | Name of the event |
This function returns the ID of the event or zero if no such event is found.
Implements eVaf::Common::iEventQueue.
|
virtual |
Registers an event.
name | Name of the event |
This function registers an event and returns a unique ID for the event. The event ID value is always greater than zero.
If an event with the given name already exists, then returns the event ID for the existing event.
Implements eVaf::Common::iEventQueue.
|
virtual |
Subscribes to an event.
id | The ID of the event (can be zero) |
obj | The subscriber object |
This function subscribes to an event identified by the ID value. Every object that wants to receive specific events, needs to subscribe to them.
The id parameter can be zero and the following example code is correct even when the event called "my-event" does not exist. The value of myEventId will be set to zero if the event does not exist.
Implements eVaf::Common::iEventQueue.
|
virtual |
Unregisters an event.
id | The ID of the event |
This function removes an event. It also unsubscribes all the subscribers from this event.
Implements eVaf::Common::iEventQueue.
|
virtual |
Unsubscribes from an event.
id | The ID of the event (can be zero) |
obj | The subscriber object |
This function removes the subscriber object from the list of subscribers for the given event identified by the event ID value. After this function call the subscriber does no more receive these events.
Implements eVaf::Common::iEventQueue.