Informers provide a consistent way for registering callbacks and issuing synchronous events.
A single informer manages callbacks for a single event.
| Ref<Subscription> |
Subscribes an Object to the event,
so that the object will receive additional
reference count when the callback is called. | |||
| Ref<Subscription> |
Creates a subscription to the event. | |||
| void |
Triggers the event. | |||
The constructor. |
Subscribes an Object to the event, so that the object will receive additional reference count when the callback is called.
Ref<Subscription> subscribeObject (void *callback, void *callbackData, Object *object)
| callback : | A callback to be called when the event occurs. |
| callbackData : | Data to be passed to the callback. |
| object : | The object to be referenced during event processing. |
Creates a subscription to the event.
Ref<Subscription> subscribe (void *callback, void *callbackData, RefCallback refCallback, RefCallback unrefCallback, void *refData)
| callback : | A callback to be called when the event occurs. |
| callbackData : | Data to be pssed to the callback. |
| refCallback : | A callback to be called when reference count of dependent objects should be incremented. |
| unrefCallback : | A callback to be called when reference count of dependent objects should be decremented. |
Triggers the event.
When this method gets called all subscriptions' callbacks get called.
void informAll (void *data)
| data : | Data to be passed to informCallback. |
The constructor.
Informer (InformCallback informCallback)
| informCallback : | A callback to be called to inform a subscriber about the event. |