#include <UniEvent/Dispatcher.h>
Inheritance diagram for strmod::unievent::Dispatcher:

Public Methods | |
| Dispatcher () | |
| Because every class (even abstract ones) should have a constructor. | |
| virtual | ~Dispatcher () |
| Because abstract classes should have a virtual destructor. | |
| virtual int | AreYouA (const lcore::ClassIdent &cid) const |
| Asks if a class is of a particular type, or publicly derived from that type. | |
| virtual void | addEvent (const EventPtr &ev)=0 |
| Add an event to the queue. | |
| virtual void | addBusyPollEvent (const EventPtr &ev)=0 |
| Add an event that will be posted to poll something if the queue is busy. | |
| virtual bool | onQueueEmpty (const EventPtr &ev)=0 |
| This event is only triggered whenever an event dispatch is attempted when there's an empty queue. | |
| virtual bool | onInterrupt (const EventPtr &ev)=0 |
| This event is only triggered when interrupt() is called. | |
| void | dispatchEvent (Dispatcher *enclosing=0) |
| Dispatch a single event. | |
| virtual void | dispatchEvents (unsigned int numevents, Dispatcher *enclosing=0)=0 |
| Dispatch until a certain number of events have been dispatched, or the queue is empty. | |
| virtual void | dispatchUntilEmpty (Dispatcher *enclosing=0)=0 |
| Dispatch until the queue is empty. | |
| virtual void | interrupt ()=0 |
| Interrupts the dispatcher to execute a high priority event. | |
| virtual void | stopDispatching ()=0 |
| Cause the multiple event dispatch methods to halt before they normally would. | |
| virtual bool | isQueueEmpty () const=0 |
| Does the queue have any events in it? | |
Static Public Attributes | |
| const UNEVT_ClassIdent | identifier |
| Globally unique identifier for this class. | |
Protected Methods | |
| virtual const lcore::ClassIdent * | i_GetIdent () const |
| Returns the class identifier for the class the object actually is. | |
This provides an interface for classes that want to implement a queue of Event objects that are removed from the queue in FIFO order and 'fired' by calling their triggerEvent methods.
Definition at line 45 of file Dispatcher.h.
|
|
Add an event that will be posted to poll something if the queue is busy. The Dispatcher maintains the concept of external and internal events. External events are those posted by the addEvent function. Internal events are those posted in response to some internal condition. When external events cause other external events to be added, busy loops can take over the system. In order to prevent this, an event from this queue will be posted if the queue contains only external events. Events in this queue should query some outside event source for events and use addEvent to add any there may be. Under no circumstance should one of these events always cause events to be added through addEvent. Doing this would just propogate the bad busy loop behavior. Implemented in strmod::unievent::SimpleDispatcher. |
|
|
Asks if a class is of a particular type, or publicly derived from that type. Overriden in every derived class (with a static identifier member) to compare against the identifier, then call the AreYouA methods of all the superclasses.
Reimplemented from strmod::lcore::Protocol. Reimplemented in strmod::unievent::SimpleDispatcher. Definition at line 150 of file Dispatcher.h. |
|
|
Returns the class identifier for the class the object actually is. Should always be overridden in any class that has a static identifier member. Reimplemented from strmod::lcore::Protocol. Reimplemented in strmod::unievent::SimpleDispatcher. Definition at line 139 of file Dispatcher.h. |
|
|
Interrupts the dispatcher to execute a high priority event. This sets a flag so that as soon as the Dispatcher's event loop gets control, the event set by onInterrupt() will be put on the front of the queue. It will also call the Event::interrupt() method of any currently executing event.
Implemented in strmod::unievent::SimpleDispatcher. |
|
|
This event is only triggered when interrupt() is called. When interrupt() is called, a flag is set so this event is put onto the front of the queue as soon as the Dispatcher's event loop gets control again.
Implemented in strmod::unievent::SimpleDispatcher. |
|
|
This event is only triggered whenever an event dispatch is attempted when there's an empty queue.
Implemented in strmod::unievent::SimpleDispatcher. |
|
|
Globally unique identifier for this class. Every class that might need to be identified should have a public static const identifier object in it. Reimplemented from strmod::lcore::Protocol. Reimplemented in strmod::unievent::SimpleDispatcher. |
1.3-rc1