#include <mlEventSource.h>
EventSourceBase class adds event listener handling to Base. Events are derived from BaseEvent.
Definition at line 30 of file mlEventSource.h.
◆ EventSource() [1/2]
| ml::EventSource::EventSource |
( |
| ) |
|
◆ EventSource() [2/2]
| ml::EventSource::EventSource |
( |
const EventSource & | evSource | ) |
|
◆ ~EventSource()
| ml::EventSource::~EventSource |
( |
| ) |
|
|
override |
◆ addEventListener()
Adds event listener callback to this Base object. The userData will be the first argument when the callback is called.
◆ hasEventListeners()
| bool ml::EventSource::hasEventListeners |
( |
| ) |
const |
Checks whether any event listeners have been added to this Base object; this can be used to skip the sendEvent call and the potentially expensive building of the event object altogether.
References EventSource().
◆ removeEventListener()
| void ml::EventSource::removeEventListener |
( |
BaseEventCallback * | cb, |
|
|
void * | userData ) |
Removes event listener callback from this Base object. Arguments must be the same as for the addEventListener call.
◆ sendEvent()
| void ml::EventSource::sendEvent |
( |
BaseEvent * | event, |
|
|
void * | skipListener = nullptr ) |
|
protected |
Macro for the declaration of the runtime type system methods, defined in mlRuntimeSubClass.h.
Passes event object to all registered listeners, ownership stays with the sender. This way, you can create the event object on the stack. If skipListener is set to a non-NULL value, the event will not be sent to any listeners that have the same userData set. This way, you can avoid to be notified of your own changes.
The documentation for this class was generated from the following file: