Event callback class.
More...
Detailed Description
Event callback class.
Some ICELib structures contain events. These allow the programmer to register callback functions in order to be notified when a particular event has occurred. Multiple callbacks can be registered. and a single callback can be registered multiple times. When an event is triggered all the registered callbacks will be called in the order they were registered.
Typedef Documentation
An EventHandler is a c-style function with following signature: void callback(const iceEvent* pEvent, const void* eventArgs, void* userContext)
- Parameters:
-
[in] | pEvent | The iceEvent* that it is registered with. Dont release this pointer in the callback unless you addreffed it yourself and really are releasing it. |
[in] | eventArgs | A pointer to an arg struct which is dependent on the event. Can be NULL |
[in] | pointer | to the userContext that the callback was registered with |
Function Documentation
Add reference.
- Parameters:
-
[in] | pEvent | pointer to iceEvent to increase the refcount on |
Get the application defined Event Category flags.
- Parameters:
-
[in] | pEvent | pointer to event |
Get the application defined Event Id.
- Parameters:
-
[in] | pEvent | pointer to event |
get (possibly) helpful string saying what the Event is called May return NULL
- Parameters:
-
[in] | pEvent | pointer to event |
Register a callback with the event object.
- Parameters:
-
[in] | pEvent | pointer to event |
[in] | eventHandler | pointer to callback function to register |
[in] | userContext | user defined pointer that will be passed to callback when event is triggered. Can be NULL |
- Returns:
- iceDWord an integer cookie value that can be used to unregister a particular callback from the event
Unregister a registered callback function This function will unregister only the callback that matches the given cookie. If the callback was register multiple times then only the matching instance is unregistered.
- Parameters:
-
[in] | pEvent | pointer to event |
[in] | cookie | value returned when callback was registered |
- Returns:
- result value indicating success of call. negative if successful
Unregister a registered callback function This function will unregister all instances of the given callback regardless of cookie value or context.
- Parameters:
-
[in] | pEvent | pointer to event |
[in] | cookie | value returned when callback was registered |
- Returns:
- result value indicating success of call. negative if successful
Dec reference.
- Parameters:
-
[in] | pEvent | pointer to iceEvent to be released |