| 1 |
NAME SoCallbackList SoCBList "" { |
| 2 |
manages a list of callback functions and associated data |
| 3 |
} |
| 4 |
|
| 5 |
INCLUDE misc/SoCallbackList.h |
| 6 |
|
| 7 |
TYPEDEF void SoCallbackListCB "(void *userData, void *callbackData)" |
| 8 |
|
| 9 |
DESC { |
| 10 |
This class manages a list of callback functions and user data. The |
| 11 |
user can add a callback function to the list, along with user data. |
| 12 |
When the callback is invoked, it is passed this user data, along with |
| 13 |
callback data specified by the invoking routine. The type of this |
| 14 |
callback data is determined by the invoking routine. |
| 15 |
} |
| 16 |
|
| 17 |
METHOD "" SoCallbackList() {} |
| 18 |
METHOD "" ~SoCallbackList() { Constructor and destructor. } |
| 19 |
|
| 20 |
METHOD addCB void addCallback(SoCallbackListCB *f, void *userData = NULL) {} |
| 21 |
METHOD removeCB void removeCallback(SoCallbackListCB *f, |
| 22 |
void *userData = NULL) { |
| 23 |
Adds a function to or removes a function from the list of callback |
| 24 |
functions. |
| 25 |
} |
| 26 |
|
| 27 |
METHOD clearCB void clearCallbacks() { |
| 28 |
Clears all callback functions from the list. |
| 29 |
} |
| 30 |
|
| 31 |
METHOD getNumCB int getNumCallbacks() const { |
| 32 |
Returns the number of callback functions in the list. |
| 33 |
} |
| 34 |
|
| 35 |
METHOD invokeCB void invokeCallbacks(void *callbackData) { |
| 36 |
Invokes each callback function in the list, passing each function the |
| 37 |
user data supplied when they were registered here, and |
| 38 |
\acallbackData\., the callback-specific data supplied by the caller. |
| 39 |
} |