VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Attributes
DtPredicateCallbackManager Class Reference

The predicate callback manager allows for registration of callbacks by sim object for predicates. Call the invoke method to see if it is time to invoke any of the callbacks. This class is not thread safe so make sure to call in a thread safe way.

Classes

struct  PredicateInfo
 

Public Member Functions

 DtPredicateCallbackManager (const DtSimulationServices *simManager)
 
virtual ~DtPredicateCallbackManager ()
 
virtual void removeAllPredicatesFor (const DtSimObject *)
 
void addSimObjectPredicateCallback (DtSimObjectReference, DtVrfObjectPredicateCallbackFunction function, const DtVrfObjectPredicate &predicate, DtTime evaluationPeriod=0, void *userData=0)
 
void removeSimObjectPredicateCallback (const DtSimObject *, DtVrfObjectPredicateCallbackFunction function, const DtVrfObjectPredicate &predicate, DtTime evaluationPeriod=0, void *userData=0)
 
void invokeSimObjectPredicateCallbacks ()
 
virtual void clearPredicateCallbacks ()
 

Protected Types

typedef std::list< std::pair
< DtSimObjectReference,
boost::shared_ptr
< DtVrfObjectPredicateCallbackInfo > > > 
PredicateList
 
typedef std::map< DtUUID,
PredicateInfo
PredicateCallbackList
 

Protected Attributes

const DtSimulationServicesmySimulationServices
 
PredicateCallbackList myPredicateCallbackList
 
tbb::spin_rw_mutex myPredicateCallbackManagerMutex
 

Private Member Functions

 DtPredicateCallbackManager ()
 
 DtPredicateCallbackManager (const DtPredicateCallbackManager &orig)
 
DtPredicateCallbackManageroperator= (const DtPredicateCallbackManager &orig)
 

Member Typedef Documentation

typedef std::list< std::pair<DtSimObjectReference, boost::shared_ptr<DtVrfObjectPredicateCallbackInfo> > > DtPredicateCallbackManager::PredicateList
protected

Constructor & Destructor Documentation

DtPredicateCallbackManager::DtPredicateCallbackManager ( )
private

Not implemented.

DtPredicateCallbackManager::DtPredicateCallbackManager ( const DtPredicateCallbackManager orig)
private

Not implemented.

DtPredicateCallbackManager::DtPredicateCallbackManager ( const DtSimulationServices simManager)
virtual DtPredicateCallbackManager::~DtPredicateCallbackManager ( )
virtual

Member Function Documentation

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

Not implemented.

void DtPredicateCallbackManager::addSimObjectPredicateCallback ( DtSimObjectReference  ,
DtVrfObjectPredicateCallbackFunction  function,
const DtVrfObjectPredicate predicate,
DtTime  evaluationPeriod = 0,
void *  userData = 0 
)

Predicate callbacks are added and invoked every simulation tick to see if the predicate evailuates to true. If does the callback added is invoked. These callbacks will be invoked at the beginning of each tick.

Add/remove a callback function to be invoked when the DtSimObject predicate object associated with it returns true(). These predicates will be applied to the given sim object

void DtPredicateCallbackManager::removeSimObjectPredicateCallback ( const DtSimObject ,
DtVrfObjectPredicateCallbackFunction  function,
const DtVrfObjectPredicate predicate,
DtTime  evaluationPeriod = 0,
void *  userData = 0 
)

Predicate callbacks are added and invoked every simulation tick to see if the predicate evailuates to true. If does the callback added is invoked. These callbacks will be invoked at the beginning of each tick.

Add/remove a callback function to be invoked when the DtSimObject predicate object associated with it returns true(). These predicates will be applied to the given sim object

void DtPredicateCallbackManager::invokeSimObjectPredicateCallbacks ( )

Called each tick. Iterates through myPredicateCallbackList, calling the predicate object's isTrue() function. If it time to test the predicate (isTimeToTest()) and the predicate's isTrue() function returns true, it invokes the associated callback function.

virtual void DtPredicateCallbackManager::clearPredicateCallbacks ( )
virtual

Clear out object predicate callback list. Should only be called by the owner of this class, upon queuing object for removal and deletion.

virtual void DtPredicateCallbackManager::removeAllPredicatesFor ( const DtSimObject )
virtual

Member Data Documentation

const DtSimulationServices* DtPredicateCallbackManager::mySimulationServices
protected
PredicateCallbackList DtPredicateCallbackManager::myPredicateCallbackList
protected
tbb::spin_rw_mutex DtPredicateCallbackManager::myPredicateCallbackManagerMutex
protected

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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)