class Informer
MyCpp::Referenced
MyCpp::Object
MyCpp::Informer

Informers provide a consistent way for registering callbacks and issuing synchronous events.

A single informer manages callbacks for a single event.

Methods
Ref<Subscription>
subscribeObject (void *callback, void *callbackData, Object *object)
Subscribes an Object to the event, so that the object will receive additional reference count when the callback is called.
Ref<Subscription>
subscribe (void *callback, void *callbackData, RefCallback refCallback, RefCallback unrefCallback, void *refData)
Creates a subscription to the event.
void
informAll (void *data)
Triggers the event.
Informer (InformCallback informCallback)
The constructor.
subscribeObject

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.
subscribe

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.
informAll

Triggers the event.

When this method gets called all subscriptions' callbacks get called.

void informAll (void *data)
data :  Data to be passed to informCallback.
Informer

The constructor.

Informer (InformCallback informCallback)
informCallback :  A callback to be called to inform a subscriber about the event.