Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoCallbackList Class Reference

Manages a list of callbacks and associated data. More...

#include <Inventor/lists/SoCallbackList.h>

Public Types

typedef void SoCallbackListCB(void *userData, void *callbackData)
 Callback functions that are registered with this class should be cast to this type.
 

Public Member Functions

 SoCallbackList ()
 Constructor.
 
 ~SoCallbackList ()
 Destructor.
 
void addCallback (SoCallbackListCB *f, void *userData=NULL)
 Adds a function to the list of callback functions.
 
void removeCallback (SoCallbackListCB *f, void *userData=NULL)
 Removes a function from the list of callback functions.
 
void clearCallbacks ()
 Clears all callback functions from the list.
 
int getNumCallbacks () const
 Returns the number of callback functions in the list.
 
void invokeCallbacks (void *callbackData)
 Invokes each callback function in the list, passing each function the user data supplied when they were registered here, and callbackData , the callback-specific data supplied by the caller.
 
void enable (SbBool enableCallbacks)
 Set the callbacks enabled state.
 

Detailed Description

Manages a list of callbacks and associated data.

This class manages a list of callbacks and user data. The user can add a callback to the list, along with user data. When the callback is invoked, it is passed this user data, along with callback data specified by the invoking routine. The type of this callback data is determined by the invoking routine.

Definition at line 84 of file SoCallbackList.h.

Member Typedef Documentation

◆ SoCallbackListCB

typedef void SoCallbackListCB(void *userData, void *callbackData)

Callback functions that are registered with this class should be cast to this type.

Definition at line 67 of file SoCallbackList.h.

Constructor & Destructor Documentation

◆ SoCallbackList()

SoCallbackList::SoCallbackList ( )

Constructor.

◆ ~SoCallbackList()

SoCallbackList::~SoCallbackList ( )

Destructor.

Member Function Documentation

◆ addCallback()

void SoCallbackList::addCallback ( SoCallbackListCB f,
void *  userData = NULL 
)

Adds a function to the list of callback functions.

At callback time, f will be called with userData as the first parameter, and callback specific data as the second parameter. e.g. (*f)(userData, callbackData);

◆ clearCallbacks()

void SoCallbackList::clearCallbacks ( )
inline

Clears all callback functions from the list.

Definition at line 112 of file SoCallbackList.h.

◆ enable()

void SoCallbackList::enable ( SbBool  enableCallbacks)
inline

Set the callbacks enabled state.

Callbacks are enabled by default. If callbacks are disabled, invokeCallbacks has no effect.

Definition at line 129 of file SoCallbackList.h.

◆ getNumCallbacks()

int SoCallbackList::getNumCallbacks ( ) const
inline

Returns the number of callback functions in the list.

Definition at line 116 of file SoCallbackList.h.

◆ invokeCallbacks()

void SoCallbackList::invokeCallbacks ( void *  callbackData)

Invokes each callback function in the list, passing each function the user data supplied when they were registered here, and callbackData , the callback-specific data supplied by the caller.

◆ removeCallback()

void SoCallbackList::removeCallback ( SoCallbackListCB f,
void *  userData = NULL 
)

Removes a function from the list of callback functions.


The documentation for this class was generated from the following file: