Public Types | |
typedef Listener< EvType > | TListener |
Simpler form of Listener<EvType>. | |
Static Public Methods | |
void | remove (TListener &) |
void | add (TListener &) |
void | send (const EvType &) |
bool | isSending () |
bool | hasListeners () |
unsigned int | getNumListeners () |
unsigned int | getMinNumIgnored () |
Friends | |
class | Listener< EvType > |
So Listener<EvType> can call register etc. |
Usage:
Definition at line 34 of file EventSender.hh.
|
Add the listener to the registry. Does nothing if the listener is already registered. Definition at line 196 of file EventSender.hh. |
|
Get how many listeners have ignored the event that is currently being sent and that they have received. This number is reset to 0 before every call to send(const EvType&). This number is a minimum, since a listener is not required to tell EventSender<EvType> that it is ignoring an event. Definition at line 132 of file EventSender.hh. |
|
Get how many listeners are currently registered. Note that if isSending() is true, then this number does not take into account listeners that are queued for registration/removal. Definition at line 143 of file EventSender.hh. |
|
Are there listeners currently registered? If this returns false, creating and send()ing and event just wastes cpu cycles since no one will hear event.
Definition at line 119 of file EventSender.hh. |
|
Is this event sender currently sending the event to its listeners? True if yes, false otherwise. Definition at line 176 of file EventSender.hh. Referenced by Listener< EvType >::ignoreThisEvent(). |
|
Remove the listener from the registry. Does nothing if the listener is not in the registry. Definition at line 186 of file EventSender.hh. |
|
Send the event to its listeners.
Definition at line 166 of file EventSender.hh. Referenced by PolymorphEvent::~PolymorphEvent(). |