#include <listener.h>
Inheritance diagram for listener::Listener:
Public Types | |
typedef unsigned int | ID |
Public Member Functions | |
Listener (unsigned int priority=0) | |
Listener (Publisher *, unsigned int priority=0) | |
void | set_publisher (Publisher *) |
ID | get_id () const |
unsigned int | get_priority () const |
Get the priority of this Listener. Default value is set to 0, which is the higuest one. | |
void | set_priority (unsigned int) |
Set the priority of this Listener. The higuest priority is 0. | |
void | add_event_filter (EventFilter *) |
Install a new event-filter (non-permanent => that can be removed). | |
void | add_permanent_event_filter (EventFilter *) |
Install a permanent EventFilter. When calling remove_all_event_filters, permanent EventFilter are not removed. | |
void | remove_all_event_filters () |
Remove all non-permanent EventFilter. | |
void | block_events () |
Block the Event emition. | |
void | unblock_events () |
Unblock the Event emition. | |
bool | are_events_blocked () const |
Return true if this Listener is blocked from emitting events. | |
template<typename LISTENER> | |
bool | inherits_from () |
Tells if this class inherits from the LISTENER class. | |
virtual void | dump_listener (std::ostream &, int spaces=0) |
bool | operator< (const Listener &l) const |
bool | operator> (const Listener &l) const |
Protected Member Functions | |
Subscriber * | subscriber () |
Get the Subscriber of this Listener. | |
Publisher * | publisher () |
Get the Publisher of this Listener. | |
virtual bool | process_event (Event *)=0 |
This method is called when receiving an event and that the filters return true after processing. | |
void | dump_infos (std::ostream &, int spaces=0) |
Friends | |
class | SubscriberDeletePtr |
class | Subscriber |
class | Publisher |
You don't need to care about deleting listeners. Subscribers will do that for you.
|
Install a new event-filter (non-permanent => that can be removed).
|
|
Install a permanent EventFilter. When calling remove_all_event_filters, permanent EventFilter are not removed.
|
|
This method is called when receiving an event and that the filters return true after processing.
If any of the installed filters failed or if this Listener is blocked, this method is not called. Implemented in listener::ListenerForEvent< EVENT >, listener::MultiplexerListener, and listener::ListenerForEvent< E >. |
|
Set the priority of this Listener. The higuest priority is 0. If two Listeners have different priority, the Listener with the smaller priority value will be call first. |