Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6IWConfig::registerForNotify ( P6CONFIG_NOTIFY_CODES  regFor,
CONFIG_NOTIFY_CHANGE  pFn,
P6VOID pContext 
)
pure virtual

This function allows the caller to register to be notified of several different events that take place in the p6IWConfig object and its matching file on disk (e.g., flush to disk, create a new config file, update an existing value).

The notification occurs asynchronusly with respect to the callers execution. The caller must call unregisterForNotify to stop the generation of notifications (i.e., once registered notification continue endlessly until unregistered).

The caller should take notice that the pContext parameter is saved until the event is unregistered via the unregisterForNotify call is made (see below). Thus the memory pointed to by pContext must remain valid until unregisterForNotify is called.

The idea is to provide an efficient method of determining when configuration changes have been made without having to touch the file on disk (e.g., with a call to stat).

Parameters
regFor[ in ] The event in the p6IWConfig object that the caller wants to be notified about.
pFn[ in ] Pointer to call back function that is called when "regFor" event occurs.
pContext[ in ] In the callback, the caller has no state information (e.g., pointer to context data structures). The caller can pass in a pointer to some data structure that will be used in the callback (i.e., pFn). This pointer can be NULL. This function does nothing to the memory this pointer points to except to pass it to the pFn.
Returns
SuccessP6R::eOk 
FailureP6R::eNotInitializedA successful call to initialize was not made before this call.
P6R::eNoMemoryInsufficient memory to initialize notification.
P6R::eInvalidArgParameter pFn == NULL.