VR-Forces 5.0.3 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 | Private Member Functions
DtNoArgumentCallbackList Class Reference

This class works just as DtCalllbackTable, but manages callbacks that have no arguments, and therefore don't fit in the template defined by DtCallbackList.

Note
It is safe to add and remove callbacks from this table during callback invocation, so callbacks functions may safely remove themselves.
It is safe to add and remove callbacks simultaneously from multiple threads.

Classes

struct  DtCallbackInfoType
 

Public Types

typedef void(* DtCallbackFunctionType )(void *)
 

Public Member Functions

 DtNoArgumentCallbackList ()
 
 DtNoArgumentCallbackList (const DtNoArgumentCallbackList &orig)
 
bool addCallback (DtCallbackFunctionType fcn, void *usrData)
 
bool removeCallback (DtCallbackFunctionType fcn, void *usrData)
 
void invokeCallbacks ()
 
void removeAll ()
 

Protected Types

typedef std::set
< DtCallbackInfoType
DtCallbackListType
 

Protected Attributes

tbb::spin_mutex myMutex
 
DtCallbackListType myCallbackList
 
unsigned myCallbackCount
 

Private Member Functions

DtNoArgumentCallbackListoperator= (const DtNoArgumentCallbackList &orig)
 

Member Typedef Documentation

typedef void(* DtNoArgumentCallbackList::DtCallbackFunctionType)(void *)

The function signature of the callback function.

Constructor & Destructor Documentation

DtNoArgumentCallbackList::DtNoArgumentCallbackList ( )

Default constructor.

DtNoArgumentCallbackList::DtNoArgumentCallbackList ( const DtNoArgumentCallbackList orig)
explicit

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

Member Function Documentation

bool DtNoArgumentCallbackList::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.
bool DtNoArgumentCallbackList::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.
void DtNoArgumentCallbackList::invokeCallbacks ( )

Invokes all the callbacks currently on the callback list.

Note
This method must not be called by any of the callbacks it invokes.
void DtNoArgumentCallbackList::removeAll ( )

Removes all callbacks that have been registered.

DtNoArgumentCallbackList& DtNoArgumentCallbackList::operator= ( const DtNoArgumentCallbackList orig)
private

Member Data Documentation

tbb::spin_mutex DtNoArgumentCallbackList::myMutex
mutableprotected
DtCallbackListType DtNoArgumentCallbackList::myCallbackList
protected
unsigned DtNoArgumentCallbackList::myCallbackCount
protected

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

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)