OpFlex Framework  1.3.0
Object Listener

An object that monitors for updates to objects in the data store. More...

Typedefs

typedef ofobj_p ofobjectlistener_p
 A pointer to an object listener object.
 
typedef void(* ofnotify_p )(void *user_data, class_id_t class_id, ofuri_p uri)
 A function pointer to a function to receive notificiations. More...
 

Functions

ofstatus ofobjectlistener_create (void *user_data, ofnotify_p callback, ofobjectlistener_p *listener)
 Create a new object listener. More...
 
ofstatus ofobjectlistener_destroy (ofobjectlistener_p *listener)
 Destroy an object listener, and zero the pointer. More...
 

Detailed Description

An object that monitors for updates to objects in the data store.

Object listeners are registered for a particular class will be triggered for any modifications for objects of that class or any transitive children of objects of that class.

Typedef Documentation

typedef void(* ofnotify_p)(void *user_data, class_id_t class_id, ofuri_p uri)

A function pointer to a function to receive notificiations.

Parameters
user_dataa pointer to an opaque user data structure
class_idthe class ID of the affected class
urithe affected URI

Function Documentation

ofstatus ofobjectlistener_create ( void *  user_data,
ofnotify_p  callback,
ofobjectlistener_p listener 
)

Create a new object listener.

You must eventually call ofobjectlistener_destroy() on the returned object.

Parameters
user_dataan opaque data blob that will be passed to your handler
callbacka function pointer to your handler function to be invoked when the listener is notified.
listenera pointer to memory that will receive the pointer to the newly-allocated object.
Returns
a status code
ofstatus ofobjectlistener_destroy ( ofobjectlistener_p listener)

Destroy an object listener, and zero the pointer.

You must ensure that the listener has been unregistered from all listeners before destroying it.

Parameters
listenera pointer to memory containing the object pointer.
Returns
a status code