![]() |
VR-Link API Documentation for HLA 1516
|
class DtReflectedObjectList More...
Inheritance diagram for DtReflectedObjectList:
Collaboration diagram for DtReflectedObjectList:Public Member Functions | |
| DtReflectedObjectList (DtExerciseConn *exConn, const DtDDMRegionSet *regionSetToUse=0, const DtString &updateRateTag=DtString("")) | |
| Constructor. | |
| virtual | ~DtReflectedObjectList () |
| destructor | |
| virtual DtReflectedObject * | lookupObj (RTI::ObjectInstanceHandle id) |
| Look up object by identifier. | |
| virtual DtReflectedObject * | lookupObj (const DtGlobalObjectDesignator &objName) |
| Look up object by global ID (which is the object name in RTI1.3.3). | |
| virtual DtReflectedObject * | firstObj () const |
| Get the first/last object in the list. | |
| virtual DtReflectedObject * | lastObj () const |
| virtual int | count () const |
| Get number of objects. | |
| virtual DtExerciseConn * | exerciseConn () const |
| Get my exerciseConn. | |
| virtual void | manageObjectClass (RTI::ObjectClassHandle handle) |
| Register callbacks with exercise connection so that we get notified when an object of this class is discovered. | |
| virtual bool | removeObject (const DtObjectId &id) |
| Have the application act as though we had never discovered the object. | |
| virtual void | addObjectAdditionCallback (DtReflectedObjectCallbackFunction cb, void *userData) |
| Object added callback registration/deregistration. | |
| virtual void | removeObjectAdditionCallback (DtReflectedObjectCallbackFunction cb, void *userData) |
| virtual void | addObjectRemovalCallback (DtReflectedObjectCallbackFunction cb, void *userData) |
| Object removed callback registration/deregistration. | |
| virtual void | removeObjectRemovalCallback (DtReflectedObjectCallbackFunction cb, void *userData) |
| virtual void | print () |
| Print the SRs of all objects. | |
| virtual void | setTimeoutProcessing (bool onOff) |
| Set whether or not timeout processing occurs. | |
| virtual void | setWaitListRefreshEnabled (bool on) |
| Set whether or not we will request updates for objects which have not met discovery and are therefor wait listed. | |
| virtual void | setTimeoutInterval (DtTime time) |
| Set/Get the remote object timeout period. | |
| virtual DtTime | timeoutInterval () |
| virtual void | setWaitlistRefreshPeriod (DtTime time) |
| Set/Get the wait list refresh period. | |
| virtual DtTime | waitlistRefreshPeriod () |
| virtual void | setDiscoveryCondition (DtDiscoveryCondition fn, void *usr) |
| Set the checker function which will determine when an object gets discovered and put into the reflected list. | |
| virtual void | clearDiscoveryCondition () |
| Unregisters the checker function set in setDiscoverCondition. | |
| virtual const DtDDMRegionSet & | subscribedRegions () |
| Returns list of regions subscribed to. | |
Static Public Member Functions | |
| static void | setAutoSubscribeFlag (bool flag) |
| Set/Get flag which determines whether to subscribe to object classes that this list manages. | |
| static bool | autoSubscribeFlag () |
| static void | setRequestClassUpdateFlag (bool onOff) |
| Set/Get flag that determines whether we request updates from all objects of the object classes we subscribe to. | |
| static bool | requestClassUpdateFlag () |
| static void | setRequestObjectUpdateFlag (bool onOff) |
| Set/Get flag that determines whether we request updates from an object as we discover it. | |
| static bool | requestObjectUpdateFlag () |
| static void | findDiscoveredObjectsCb (void *usr) |
| Post-drain callback that calls findAlreadyDiscovedObjects(). | |
Protected Member Functions | |
| virtual void | processDiscoverObject (DtHlaObject *obj) |
| Process the discovery of a remote object on the network. | |
| virtual void | processRemoveObject (DtHlaObject *obj) |
| Process the removal of a remote object from the network. | |
| virtual void | processTimedOutObjectReflect (const DtStateMsg &msg, DtHlaObject *obj) |
| Handle the receipt of attributes for a remote object which was timed out. | |
| virtual void | doTimeouts () |
| Remove any remote objects which have not been updated during the timeout period. | |
| virtual void | doRequestWaitListUpdates () |
| Request an update for any objects which have not met their discovery criteria yet. | |
| virtual DtReflectedObject * | newReflectedObject (DtHlaObject *obj) const =0 |
| Create a remote object object for the HLA object. | |
| virtual void | removeAndDelete (DtReflectedObject *obj, char *msg=NULL) |
| Remove the remote object from the list if found and delete it. | |
| virtual void | objectAdded (DtReflectedObject *object) |
| Called from processDiscoverObject() after a remote object has been added to the list. | |
| virtual bool | shouldBeTimedOut (DtReflectedObject *object) |
| Returns whether or not the object should be timed out. | |
| virtual void | timeOutObject (DtReflectedObject *object) |
| Times out object by removing it from the remote object list and deleting it. | |
| virtual void | unTimeOutObject (DtHlaObject *obj) |
| Manages callbacks and data used for reinstating a remote object which was timed out. | |
| virtual void | addObjectClass (RTI::ObjectClassHandle handle) |
| Register interest in this FOM object class. | |
| virtual void | addObjectClassByName (const char *className) |
| Register interest in this FOM object class by className. | |
| virtual void | init (const DtList *handleList) |
| Register interest in a whole list of RTI::ObjectClassHandles all at once. | |
| void | emptyLists () |
| Empty the object list and the timeout list. | |
| void | emptyCallbackLists () |
| Empty the callback lists. | |
| virtual void | processObjectAdditionCallbacks (DtReflectedObject *object) |
| Process object addition/removal callbacks. | |
| virtual void | processObjectRemovalCallbacks (DtReflectedObject *object) |
| virtual void | findAlreadyDiscoveredObjects () |
| When list is created, we call this function to go through the list of all discovered HLA objects to see if any should be managed by this list. | |
| virtual void | checkDiscoveryCondition (DtReflectedObject *refObj) |
| virtual bool | readyToAdd (DtReflectedObject *obj) |
| Returns true if the obj is ready to be added to myObjectList; calls myWaitListChecker from within. | |
| virtual void | addToObjectList (DtReflectedObject *refObj) |
| Add refObj to myObjectList and initiates discovery callbacks. | |
| virtual DtReflectedObject * | lookupObjInWaitList (const DtGlobalObjectDesignator &name) |
| Find object in waitList by name. | |
| void | unsubscribeRegions () |
Static Protected Member Functions | |
| static void | discoverObjectCb (DtHlaObject *hlaObj, void *rel) |
| Cast the void* to a DtReflectedObjectList* and calls processDiscoverObject(). | |
| static void | removeObjectCb (DtHlaObject *hlaObj, void *rel) |
| Cast the void* to a DtReflectedObjectList* and calls processRemoveObject(). | |
| static void | timedOutObjectReflectCb (const DtStateMsg &msg, DtHlaObject *obj, void *usr) |
| Cast the void* to a DtReflectedObjectList* and calls processTimedOutObjectReflect(). | |
| static void | doTimeoutsPostDrainCb (void *usr) |
| Calls doTimeouts. | |
| static void | doRequestWaitListUpdatesPostDrainCb (void *usr) |
| Calls doRequestWaitListUpdates. | |
| static void | postUpdateCb (DtReflectedObject *obj, void *usr) |
| Calls checkDiscoveryCondition. | |
Protected Attributes | |
| DtExerciseConn * | myExConn |
| DtObjectIdHashList | myObjectList |
| DtHashList | myObjectListByName |
| DtObjectIdHashList | myWaitList |
| DtList | myTimedOutObjectList |
| std::vector < RTI::ObjectClassHandle > | myHandleList |
| DtIntrusiveList | myObjectAddedCallbacks |
| DtIntrusiveList | myObjectRemovedCallbacks |
| DtTime | myTimeoutInterval |
| bool | myTimeoutProcessingFlag |
| bool | myWaitListRequestUpdateFlag |
| DtDiscoveryCondition | myDiscoveryCondition |
| void * | myDiscoveryConditionParameter |
| DtTime | myWaitlistTime |
| DtTime | myWaitlistRefreshPeriod |
| DtDDMRegionSet | mySubscribedRegions |
| DtString | myUpdateRateTag |
Static Protected Attributes | |
| static bool | theAutoSubscribeFlag |
| static bool | theRequestClassUpdateFlag |
| static bool | theRequestObjectUpdateFlag |
Private Member Functions | |
| DtReflectedObjectList (const DtReflectedObjectList &orig) | |
| copy constructor -- not implemented | |
| DtReflectedObjectList & | operator= (const DtReflectedObjectList &orig) |
| assignment operator -- not implemented | |
class DtReflectedObjectList
Instances of DtReflectedObjectList are list of instances of classes derived from DtReflectedObject. A DtReflectedObjectList manages the comings and goings of its reflected objects based on discoveries and removes received from the RTI.
| DtReflectedObjectList::DtReflectedObjectList | ( | DtExerciseConn * | exConn, |
| const DtDDMRegionSet * | regionSetToUse = 0, |
||
| const DtString & | updateRateTag = DtString("") |
||
| ) |
Constructor.
| virtual DtReflectedObjectList::~DtReflectedObjectList | ( | ) | [virtual] |
destructor
| DtReflectedObjectList::DtReflectedObjectList | ( | const DtReflectedObjectList & | orig | ) | [private] |
copy constructor -- not implemented
| virtual void DtReflectedObjectList::addObjectAdditionCallback | ( | DtReflectedObjectCallbackFunction | cb, |
| void * | userData | ||
| ) | [virtual] |
Object added callback registration/deregistration.
| virtual void DtReflectedObjectList::addObjectClass | ( | RTI::ObjectClassHandle | handle | ) | [protected, virtual] |
Register interest in this FOM object class.
Typically called by derived class constructor.
| virtual void DtReflectedObjectList::addObjectClassByName | ( | const char * | className | ) | [protected, virtual] |
Register interest in this FOM object class by className.
Typically called by derived class constructor.
| virtual void DtReflectedObjectList::addObjectRemovalCallback | ( | DtReflectedObjectCallbackFunction | cb, |
| void * | userData | ||
| ) | [virtual] |
Object removed callback registration/deregistration.
| virtual void DtReflectedObjectList::addToObjectList | ( | DtReflectedObject * | refObj | ) | [protected, virtual] |
Add refObj to myObjectList and initiates discovery callbacks.
Reimplemented in DtReflectedEntityList.
| static bool DtReflectedObjectList::autoSubscribeFlag | ( | ) | [static] |
| virtual void DtReflectedObjectList::checkDiscoveryCondition | ( | DtReflectedObject * | refObj | ) | [protected, virtual] |
| virtual void DtReflectedObjectList::clearDiscoveryCondition | ( | ) | [virtual] |
Unregisters the checker function set in setDiscoverCondition.
If there is none set, this has no effect.
Reimplemented in DtReflectedEmitterSystemList.
| virtual int DtReflectedObjectList::count | ( | ) | const [virtual] |
Get number of objects.
| static void DtReflectedObjectList::discoverObjectCb | ( | DtHlaObject * | hlaObj, |
| void * | rel | ||
| ) | [static, protected] |
Cast the void* to a DtReflectedObjectList* and calls processDiscoverObject().
| virtual void DtReflectedObjectList::doRequestWaitListUpdates | ( | ) | [protected, virtual] |
Request an update for any objects which have not met their discovery criteria yet.
| static void DtReflectedObjectList::doRequestWaitListUpdatesPostDrainCb | ( | void * | usr | ) | [static, protected] |
Calls doRequestWaitListUpdates.
| virtual void DtReflectedObjectList::doTimeouts | ( | ) | [protected, virtual] |
Remove any remote objects which have not been updated during the timeout period.
Gets called automatically by a postDrainCallback registered by the constructor. Users should not need to call this.
| static void DtReflectedObjectList::doTimeoutsPostDrainCb | ( | void * | usr | ) | [static, protected] |
Calls doTimeouts.
| void DtReflectedObjectList::emptyCallbackLists | ( | ) | [protected] |
Empty the callback lists.
Non-virtual since it's meant to be called from the destructor
| void DtReflectedObjectList::emptyLists | ( | ) | [protected] |
Empty the object list and the timeout list.
Non-virtual since meant to be called from destructor.
| DtExerciseConn * DtReflectedObjectList::exerciseConn | ( | ) | const [inline, virtual] |
Get my exerciseConn.
References myExConn.
| virtual void DtReflectedObjectList::findAlreadyDiscoveredObjects | ( | ) | [protected, virtual] |
When list is created, we call this function to go through the list of all discovered HLA objects to see if any should be managed by this list.
Otherwise, this list only hears about objects that are discovered by the app after the creation of this list.
| static void DtReflectedObjectList::findDiscoveredObjectsCb | ( | void * | usr | ) | [static] |
Post-drain callback that calls findAlreadyDiscovedObjects().
| DtReflectedObject * DtReflectedObjectList::firstObj | ( | ) | const [inline, virtual] |
Get the first/last object in the list.
References DtListItem::data(), DtList::first(), DtObjectIdHashlist::list(), and myObjectList.
| virtual void DtReflectedObjectList::init | ( | const DtList * | handleList | ) | [protected, virtual] |
Register interest in a whole list of RTI::ObjectClassHandles all at once.
Uses addObjectClass above.
| DtReflectedObject * DtReflectedObjectList::lastObj | ( | ) | const [inline, virtual] |
References DtListItem::data(), DtList::last(), DtObjectIdHashlist::list(), and myObjectList.
| virtual DtReflectedObject* DtReflectedObjectList::lookupObj | ( | RTI::ObjectInstanceHandle | id | ) | [virtual] |
Look up object by identifier.
| virtual DtReflectedObject* DtReflectedObjectList::lookupObj | ( | const DtGlobalObjectDesignator & | objName | ) | [virtual] |
Look up object by global ID (which is the object name in RTI1.3.3).
| virtual DtReflectedObject* DtReflectedObjectList::lookupObjInWaitList | ( | const DtGlobalObjectDesignator & | name | ) | [protected, virtual] |
Find object in waitList by name.
| virtual void DtReflectedObjectList::manageObjectClass | ( | RTI::ObjectClassHandle | handle | ) | [virtual] |
Register callbacks with exercise connection so that we get notified when an object of this class is discovered.
Automatically called for all object classes passed to the constructor, or for the default set of objects classes if the ctor without a handleList is used. But if you want to handle your own subscription and update requests, pass an empty handleSet to the constructor, use DtObjectClassDesc's registerInterest and requestUpdates, then use this function to tell the ROL to manage the objects that get discovered.
| virtual DtReflectedObject* DtReflectedObjectList::newReflectedObject | ( | DtHlaObject * | obj | ) | const [protected, pure virtual] |
Create a remote object object for the HLA object.
Caller is responsible for deletion.
Implemented in DtReflectedEntityList, DtReflectedEmitterSystemList, DtReflectedIffList, DtReflectedActiveSonarBeamList, DtReflectedGenericObjectList, DtReflectedEnvironmentProcessList, DtReflectedGriddedDataList, DtReflectedAggregateList, DtReflectedRadioReceiverList, DtReflectedRadioTransmitterList, DtReflectedLinearObjectList, DtReflectedActiveSonarList, DtReflectedPointObjectList, DtReflectedAdditionalPassiveActivitiesList, DtReflectedDesignatorList, DtReflectedArealObjectList, DtReflectedEmitterBeamList, DtReflectedPropulsionNoiseList, DtReflectedFederateList, and ReflectedTestList.
| virtual void DtReflectedObjectList::objectAdded | ( | DtReflectedObject * | object | ) | [protected, virtual] |
Called from processDiscoverObject() after a remote object has been added to the list.
Defaults to do nothing. Subclasses can override this function to add functionality on addition.
Reimplemented in DtReflectedEntityList, DtReflectedEmitterSystemList, DtReflectedAggregateList, DtReflectedActiveSonarBeamList, DtReflectedEnvironmentProcessList, DtReflectedGriddedDataList, DtReflectedRadioReceiverList, DtReflectedRadioTransmitterList, DtReflectedLinearObjectList, DtReflectedActiveSonarList, DtReflectedIffList, DtReflectedPointObjectList, DtReflectedAdditionalPassiveActivitiesList, DtReflectedEmitterBeamList, DtReflectedDesignatorList, DtReflectedArealObjectList, DtReflectedPropulsionNoiseList, and DtReflectedFederateList.
| DtReflectedObjectList& DtReflectedObjectList::operator= | ( | const DtReflectedObjectList & | orig | ) | [private] |
assignment operator -- not implemented
| static void DtReflectedObjectList::postUpdateCb | ( | DtReflectedObject * | obj, |
| void * | usr | ||
| ) | [static, protected] |
Calls checkDiscoveryCondition.
| virtual void DtReflectedObjectList::print | ( | ) | [virtual] |
Print the SRs of all objects.
| virtual void DtReflectedObjectList::processDiscoverObject | ( | DtHlaObject * | obj | ) | [protected, virtual] |
Process the discovery of a remote object on the network.
Adds the remote object to this list.
Reimplemented in DtReflectedEmitterSystemList.
| virtual void DtReflectedObjectList::processObjectAdditionCallbacks | ( | DtReflectedObject * | object | ) | [protected, virtual] |
Process object addition/removal callbacks.
| virtual void DtReflectedObjectList::processObjectRemovalCallbacks | ( | DtReflectedObject * | object | ) | [protected, virtual] |
| virtual void DtReflectedObjectList::processRemoveObject | ( | DtHlaObject * | obj | ) | [protected, virtual] |
Process the removal of a remote object from the network.
Removes the remote object from this list.
Reimplemented in DtReflectedEmitterSystemList.
| virtual void DtReflectedObjectList::processTimedOutObjectReflect | ( | const DtStateMsg & | msg, |
| DtHlaObject * | obj | ||
| ) | [protected, virtual] |
Handle the receipt of attributes for a remote object which was timed out.
Reinstates the remote object in this list.
| virtual bool DtReflectedObjectList::readyToAdd | ( | DtReflectedObject * | obj | ) | [protected, virtual] |
Returns true if the obj is ready to be added to myObjectList; calls myWaitListChecker from within.
| virtual void DtReflectedObjectList::removeAndDelete | ( | DtReflectedObject * | obj, |
| char * | msg = NULL |
||
| ) | [protected, virtual] |
Remove the remote object from the list if found and delete it.
Prints a message on deletion if specified.
Reimplemented in DtReflectedEntityList, DtReflectedIffList, and DtReflectedAggregateList.
| virtual bool DtReflectedObjectList::removeObject | ( | const DtObjectId & | id | ) | [virtual] |
Have the application act as though we had never discovered the object.
We call the RTI's localDelete service, and delete the DtHlaObject, which causes any DtReflectedObjects associated with id (in this list and in any others) to be removed. The object will be re-discovered (perhaps immediately), unless your subscriptions have changed so that the object is no longer relevant. Returns true if successful, false otherwise. Will be unsuccessful if you own attributes of the object in question.
| virtual void DtReflectedObjectList::removeObjectAdditionCallback | ( | DtReflectedObjectCallbackFunction | cb, |
| void * | userData | ||
| ) | [virtual] |
| static void DtReflectedObjectList::removeObjectCb | ( | DtHlaObject * | hlaObj, |
| void * | rel | ||
| ) | [static, protected] |
Cast the void* to a DtReflectedObjectList* and calls processRemoveObject().
| virtual void DtReflectedObjectList::removeObjectRemovalCallback | ( | DtReflectedObjectCallbackFunction | cb, |
| void * | userData | ||
| ) | [virtual] |
| static bool DtReflectedObjectList::requestClassUpdateFlag | ( | ) | [static] |
| static bool DtReflectedObjectList::requestObjectUpdateFlag | ( | ) | [static] |
| static void DtReflectedObjectList::setAutoSubscribeFlag | ( | bool | flag | ) | [static] |
Set/Get flag which determines whether to subscribe to object classes that this list manages.
Defaults to true, but should be set to false if you will be managing subscriptions manually, e.g. if using DDM.
| virtual void DtReflectedObjectList::setDiscoveryCondition | ( | DtDiscoveryCondition | fn, |
| void * | usr | ||
| ) | [virtual] |
Set the checker function which will determine when an object gets discovered and put into the reflected list.
Reimplemented in DtReflectedEmitterSystemList.
| static void DtReflectedObjectList::setRequestClassUpdateFlag | ( | bool | onOff | ) | [static] |
Set/Get flag that determines whether we request updates from all objects of the object classes we subscribe to.
Default is true.
| static void DtReflectedObjectList::setRequestObjectUpdateFlag | ( | bool | onOff | ) | [static] |
Set/Get flag that determines whether we request updates from an object as we discover it.
Default is true.
| void DtReflectedObjectList::setTimeoutInterval | ( | DtTime | time | ) | [inline, virtual] |
Set/Get the remote object timeout period.
References myTimeoutInterval.
| virtual void DtReflectedObjectList::setTimeoutProcessing | ( | bool | onOff | ) | [virtual] |
Set whether or not timeout processing occurs.
Defaults to off.
| virtual void DtReflectedObjectList::setWaitListRefreshEnabled | ( | bool | on | ) | [virtual] |
Set whether or not we will request updates for objects which have not met discovery and are therefor wait listed.
| void DtReflectedObjectList::setWaitlistRefreshPeriod | ( | DtTime | time | ) | [inline, virtual] |
Set/Get the wait list refresh period.
References myWaitlistRefreshPeriod.
| virtual bool DtReflectedObjectList::shouldBeTimedOut | ( | DtReflectedObject * | object | ) | [protected, virtual] |
Returns whether or not the object should be timed out.
Assumes that timeout processing is enabled.
Reimplemented in DtReflectedEmitterSystemList.
| virtual const DtDDMRegionSet& DtReflectedObjectList::subscribedRegions | ( | ) | [virtual] |
Returns list of regions subscribed to.
| static void DtReflectedObjectList::timedOutObjectReflectCb | ( | const DtStateMsg & | msg, |
| DtHlaObject * | obj, | ||
| void * | usr | ||
| ) | [static, protected] |
Cast the void* to a DtReflectedObjectList* and calls processTimedOutObjectReflect().
| DtTime DtReflectedObjectList::timeoutInterval | ( | ) | [inline, virtual] |
References myTimeoutInterval.
| virtual void DtReflectedObjectList::timeOutObject | ( | DtReflectedObject * | object | ) | [protected, virtual] |
Times out object by removing it from the remote object list and deleting it.
Manages callbacks to reinstate remote object upon receiving attribute updates for the timed out object.
| void DtReflectedObjectList::unsubscribeRegions | ( | ) | [protected] |
| virtual void DtReflectedObjectList::unTimeOutObject | ( | DtHlaObject * | obj | ) | [protected, virtual] |
Manages callbacks and data used for reinstating a remote object which was timed out.
| DtTime DtReflectedObjectList::waitlistRefreshPeriod | ( | ) | [inline, virtual] |
References myWaitlistRefreshPeriod.
void* DtReflectedObjectList::myDiscoveryConditionParameter [protected] |
DtExerciseConn* DtReflectedObjectList::myExConn [protected] |
Referenced by exerciseConn().
std::vector<RTI::ObjectClassHandle> DtReflectedObjectList::myHandleList [protected] |
Referenced by firstObj(), and lastObj().
DtHashList DtReflectedObjectList::myObjectListByName [protected] |
DtList DtReflectedObjectList::myTimedOutObjectList [protected] |
DtTime DtReflectedObjectList::myTimeoutInterval [protected] |
Referenced by setTimeoutInterval(), and timeoutInterval().
bool DtReflectedObjectList::myTimeoutProcessingFlag [protected] |
DtString DtReflectedObjectList::myUpdateRateTag [protected] |
DtObjectIdHashList DtReflectedObjectList::myWaitList [protected] |
DtTime DtReflectedObjectList::myWaitlistRefreshPeriod [protected] |
Referenced by setWaitlistRefreshPeriod(), and waitlistRefreshPeriod().
bool DtReflectedObjectList::myWaitListRequestUpdateFlag [protected] |
DtTime DtReflectedObjectList::myWaitlistTime [protected] |
bool DtReflectedObjectList::theAutoSubscribeFlag [static, protected] |
bool DtReflectedObjectList::theRequestClassUpdateFlag [static, protected] |
bool DtReflectedObjectList::theRequestObjectUpdateFlag [static, protected] |