VR-Forces 4.0.4 Class Documentation
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
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. More...

List of all members.

Public Types

typedef void(* DtCallbackFunctionType )(void *)
 The function signature of the callback function.

Public Member Functions

 DtNoArgumentCallbackList ()
 DtNoArgumentCallbackList (const DtNoArgumentCallbackList &orig)
 ~DtNoArgumentCallbackList ()
DtNoArgumentCallbackListoperator= (const DtNoArgumentCallbackList &orig)
void addCallback (DtCallbackFunctionType fcn, void *usrData)
 Adds a new callback to the list.
void removeCallback (DtCallbackFunctionType fcn, void *usrData)
 Removes the specified callback from the list.
void invokeCallbacks ()
 Invokes all the callbacks currently on the callback list.
void removeAll ()
 Removes all callbacks that have been registered.

Protected Types

typedef std::pair
< DtCallbackFunctionType, void * > 
DtCallbackInfoType
typedef std::list
< DtCallbackInfoType
DtCallbackListType

Protected Member Functions

bool contains (const DtCallbackListType &callbackList, DtCallbackFunctionType fcn, void *usrData) const

Protected Attributes

DtCallbackListType myCallbackList
bool myInvokingCallbacks
 Flag used to indicate that the invokeCallbacks method is currently running.
DtCallbackListType myCallbacksToRemove
 List used to queue callbacks for removal if removeCallback() is called during callback invokation.

Detailed Description

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 invokation, so callbacks functions may safely remove themselves.

Member Typedef Documentation

The function signature of the callback function.


Constructor & Destructor Documentation


Member Function Documentation

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

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.

Removes the specified callback from the list.

Note:
It is safe to call this from inside a callback function.

Invokes all the callbacks currently on the callback list.

Note:
This method must not be called by any of the callbacks it invokes.

Removes all callbacks that have been registered.

bool DtNoArgumentCallbackList::contains ( const DtCallbackListType callbackList,
DtCallbackFunctionType  fcn,
void *  usrData 
) const [protected]
Returns:
True if the provided callback list currently contains an entry for the specified callback function and user data.

Member Data Documentation

Flag used to indicate that the invokeCallbacks method is currently running.

Value not copied with the copy constructor/assignment operator.

List used to queue callbacks for removal if removeCallback() is called during callback invokation.

Value not copied with the copy constructor/assignment operator.


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)