![]() |
VR-Forces 5.0.1 Developer's Guide
|
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 DtSimulationServices * | mySimulationServices |
| PredicateCallbackList | myPredicateCallbackList |
| tbb::spin_rw_mutex | myPredicateCallbackManagerMutex |
Private Member Functions | |
| DtPredicateCallbackManager () | |
| DtPredicateCallbackManager (const DtPredicateCallbackManager &orig) | |
| DtPredicateCallbackManager & | operator= (const DtPredicateCallbackManager &orig) |
|
protected |
|
protected |
|
private |
Not implemented.
|
private |
Not implemented.
| DtPredicateCallbackManager::DtPredicateCallbackManager | ( | const DtSimulationServices * | simManager | ) |
|
virtual |
|
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 |
Clear out object predicate callback list. Should only be called by the owner of this class, upon queuing object for removal and deletion.
|
virtual |
|
protected |
|
protected |
|
protected |