VR-Forces 4.1 Class Documentation
List of all members | 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...

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

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

The function signature of the callback function.

Constructor & Destructor Documentation

DtNoArgumentCallbackList::DtNoArgumentCallbackList ( )
DtNoArgumentCallbackList::DtNoArgumentCallbackList ( const DtNoArgumentCallbackList orig)
DtNoArgumentCallbackList::~DtNoArgumentCallbackList ( )

Member Function Documentation

DtNoArgumentCallbackList& DtNoArgumentCallbackList::operator= ( const DtNoArgumentCallbackList orig)
void 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.
void 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.
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.

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

DtCallbackListType DtNoArgumentCallbackList::myCallbackList
protected
bool DtNoArgumentCallbackList::myInvokingCallbacks
protected

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

Value not copied with the copy constructor/assignment operator.

DtCallbackListType DtNoArgumentCallbackList::myCallbacksToRemove
protected

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 Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)