VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Types | Protected Attributes
DtCallbackList< T_CallbackArg > Class Template Reference
Inheritance diagram for DtCallbackList< T_CallbackArg >:
Inheritance graph
[legend]

Classes

struct  DtCallbackInfoType
 

Public Types

typedef void(* DtCallbackFunctionType )(T_CallbackArg, void *)
 

Public Member Functions

 DtCallbackList ()
 
 DtCallbackList (const DtCallbackList &orig)
 
bool addCallback (DtCallbackFunctionType fcn, void *usrData)
 
bool removeCallback (DtCallbackFunctionType fcn, void *usrData)
 
void invokeCallbacks (T_CallbackArg arg)
 
void removeAll ()
 
DtCallbackListoperator= (const DtCallbackList &orig)
 

Protected Types

typedef std::set
< DtCallbackInfoType
DtCallbackListType
 

Protected Attributes

tbb::spin_mutex myMutex
 
DtCallbackListType myCallbackList
 
unsigned myCallbackCount
 

Member Typedef Documentation

template<typename T_CallbackArg>
typedef void(* DtCallbackList< T_CallbackArg >::DtCallbackFunctionType)(T_CallbackArg, void *)

The function signature of the callback function.

template<typename T_CallbackArg>
typedef std::set<DtCallbackInfoType> DtCallbackList< T_CallbackArg >::DtCallbackListType
protected

Constructor & Destructor Documentation

template<typename T_CallbackArg>
DtCallbackList< T_CallbackArg >::DtCallbackList ( )

Default constructor.

template<typename T_CallbackArg>
DtCallbackList< T_CallbackArg >::DtCallbackList ( const DtCallbackList< T_CallbackArg > &  orig)
explicit

Copy constructor. Exists mostly so that std::map will work on linux without C++11.

Member Function Documentation

template<typename T_CallbackArg>
bool DtCallbackList< T_CallbackArg >::addCallback ( DtCallbackFunctionType  fcn,
void *  usrData 
)

Adds a new callback to the list. A duplicate entry is checked for first, and if found, this new function is not added.

Note
It is safe to call this from inside a callback function.
Returns
True if this was the first callback added.
template<typename T_CallbackArg>
bool DtCallbackList< T_CallbackArg >::removeCallback ( DtCallbackFunctionType  fcn,
void *  usrData 
)

Removes the specified callback from the list.

Note
It is safe to call this from inside a callback function.
Returns
True if this was the last callback removed.
template<typename T_CallbackArg>
void DtCallbackList< T_CallbackArg >::invokeCallbacks ( T_CallbackArg  arg)

Invokes all the callbacks currently on the callback list.

Note
This method must not be called by any of the callbacks it invokes.
template<typename T_CallbackArg>
void DtCallbackList< T_CallbackArg >::removeAll ( )

Removes all callbacks that have been registered.

template<typename T_CallbackArg>
DtCallbackList& DtCallbackList< T_CallbackArg >::operator= ( const DtCallbackList< T_CallbackArg > &  orig)
inline

Member Data Documentation

template<typename T_CallbackArg>
tbb::spin_mutex DtCallbackList< T_CallbackArg >::myMutex
mutableprotected
template<typename T_CallbackArg>
DtCallbackListType DtCallbackList< T_CallbackArg >::myCallbackList
protected
template<typename T_CallbackArg>
unsigned DtCallbackList< T_CallbackArg >::myCallbackCount
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)