VR-Link API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
DtReflectedObjectList Class Reference

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 DtReflectedObjectlookupObj (RTI::ObjectHandle id)
 Look up object by identifier.
virtual DtReflectedObjectlookupObj (const DtGlobalObjectDesignator &objName)
 Look up object by global ID (which is the object name in RTI1.3.3).
virtual DtReflectedObjectfirstObj () const
 Get the first/last object in the list.
virtual DtReflectedObjectlastObj () const
virtual int count () const
 Get number of objects.
virtual DtExerciseConnexerciseConn () 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 bool isTimeoutProcessing () const
 Get 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 DtDDMRegionSetsubscribedRegions ()
 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 DtReflectedObjectnewReflectedObject (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 DtReflectedObjectlookupObjInWaitList (RTI::ObjectHandle id)
 Find object in waitList by identifier.
virtual DtReflectedObjectlookupObjInWaitList (const DtGlobalObjectDesignator &name)
 Find object in waitList by name.
void unsubscribeRegions ()
const DtStringupdateRateSubscriptionName () const
 Return the name of the update rate associated with our subscription, if any.

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

DtExerciseConnmyExConn
DtRefHlaObjectMap myObjectList
DtHashList myObjectListByName
DtRefHlaObjectMap 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
DtReflectedObjectListoperator= (const DtReflectedObjectList &orig)
 assignment operator – not implemented

Detailed Description

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.

Constructor & Destructor Documentation

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

Member Function Documentation

virtual void DtReflectedObjectList::addObjectAdditionCallback ( DtReflectedObjectCallbackFunction  cb,
void *  userData 
)
virtual

Object added callback registration/deregistration.

virtual void DtReflectedObjectList::addObjectClass ( RTI::ObjectClassHandle  handle)
protectedvirtual

Register interest in this FOM object class.

Typically called by derived class constructor.

virtual void DtReflectedObjectList::addObjectClassByName ( const char *  className)
protectedvirtual

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)
protectedvirtual

Add refObj to myObjectList and initiates discovery callbacks.

Reimplemented in DtReflectedEntityList.

static bool DtReflectedObjectList::autoSubscribeFlag ( )
static
virtual void DtReflectedObjectList::checkDiscoveryCondition ( DtReflectedObject refObj)
protectedvirtual
virtual void DtReflectedObjectList::clearDiscoveryCondition ( )
virtual

Unregisters the checker function set in setDiscoverCondition.

If there is none set, this has no effect.

Reimplemented in DtReflectedUnderwaterAcousticsList, DtReflectedEmitterSystemList, and DtReflectedActiveSonarList.

virtual int DtReflectedObjectList::count ( ) const
virtual

Get number of objects.

static void DtReflectedObjectList::discoverObjectCb ( DtHlaObject hlaObj,
void *  rel 
)
staticprotected

Cast the void* to a DtReflectedObjectList* and calls processDiscoverObject().

virtual void DtReflectedObjectList::doRequestWaitListUpdates ( )
protectedvirtual

Request an update for any objects which have not met their discovery criteria yet.

static void DtReflectedObjectList::doRequestWaitListUpdatesPostDrainCb ( void *  usr)
staticprotected

Calls doRequestWaitListUpdates.

virtual void DtReflectedObjectList::doTimeouts ( )
protectedvirtual

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)
staticprotected

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
inlinevirtual

Get my exerciseConn.

References myExConn.

virtual void DtReflectedObjectList::findAlreadyDiscoveredObjects ( )
protectedvirtual

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
inlinevirtual

Get the first/last object in the list.

References myObjectList.

virtual void DtReflectedObjectList::init ( const DtList handleList)
protectedvirtual

Register interest in a whole list of RTI::ObjectClassHandles all at once.

Uses addObjectClass above.

virtual bool DtReflectedObjectList::isTimeoutProcessing ( ) const
virtual

Get whether or not timeout processing occurs.

DtReflectedObject * DtReflectedObjectList::lastObj ( ) const
inlinevirtual

References myObjectList.

virtual DtReflectedObject* DtReflectedObjectList::lookupObj ( RTI::ObjectHandle  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 ( RTI::ObjectHandle  id)
protectedvirtual

Find object in waitList by identifier.

virtual DtReflectedObject* DtReflectedObjectList::lookupObjInWaitList ( const DtGlobalObjectDesignator name)
protectedvirtual

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
protectedpure virtual
virtual void DtReflectedObjectList::objectAdded ( DtReflectedObject object)
protectedvirtual
DtReflectedObjectList& DtReflectedObjectList::operator= ( const DtReflectedObjectList orig)
private

assignment operator – not implemented

static void DtReflectedObjectList::postUpdateCb ( DtReflectedObject obj,
void *  usr 
)
staticprotected

Calls checkDiscoveryCondition.

virtual void DtReflectedObjectList::print ( )
virtual

Print the SRs of all objects.

virtual void DtReflectedObjectList::processDiscoverObject ( DtHlaObject obj)
protectedvirtual

Process the discovery of a remote object on the network.

Adds the remote object to this list.

Reimplemented in DtReflectedEmitterSystemList, and DtReflectedActiveSonarList.

virtual void DtReflectedObjectList::processObjectAdditionCallbacks ( DtReflectedObject object)
protectedvirtual

Process object addition/removal callbacks.

virtual void DtReflectedObjectList::processObjectRemovalCallbacks ( DtReflectedObject object)
protectedvirtual
virtual void DtReflectedObjectList::processRemoveObject ( DtHlaObject obj)
protectedvirtual

Process the removal of a remote object from the network.

Removes the remote object from this list.

Reimplemented in DtReflectedEmitterSystemList, and DtReflectedActiveSonarList.

virtual void DtReflectedObjectList::processTimedOutObjectReflect ( const DtStateMsg msg,
DtHlaObject obj 
)
protectedvirtual

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)
protectedvirtual

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 
)
protectedvirtual

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 
)
staticprotected

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 DtReflectedUnderwaterAcousticsList, DtReflectedEmitterSystemList, and DtReflectedActiveSonarList.

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)
inlinevirtual

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)
inlinevirtual

Set/Get the wait list refresh period.

References myWaitlistRefreshPeriod.

virtual bool DtReflectedObjectList::shouldBeTimedOut ( DtReflectedObject object)
protectedvirtual

Returns whether or not the object should be timed out.

Assumes that timeout processing is enabled.

Reimplemented in DtReflectedUnderwaterAcousticsList, DtReflectedEmitterSystemList, and DtReflectedActiveSonarList.

virtual const DtDDMRegionSet& DtReflectedObjectList::subscribedRegions ( )
virtual

Returns list of regions subscribed to.

static void DtReflectedObjectList::timedOutObjectReflectCb ( const DtStateMsg msg,
DtHlaObject obj,
void *  usr 
)
staticprotected

Cast the void* to a DtReflectedObjectList* and calls processTimedOutObjectReflect().

DtTime DtReflectedObjectList::timeoutInterval ( )
inlinevirtual

References myTimeoutInterval.

virtual void DtReflectedObjectList::timeOutObject ( DtReflectedObject object)
protectedvirtual

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)
protectedvirtual

Manages callbacks and data used for reinstating a remote object which was timed out.

const DtString& DtReflectedObjectList::updateRateSubscriptionName ( ) const
protected

Return the name of the update rate associated with our subscription, if any.

HLA Evolved only.

DtTime DtReflectedObjectList::waitlistRefreshPeriod ( )
inlinevirtual

Member Data Documentation

DtDiscoveryCondition DtReflectedObjectList::myDiscoveryCondition
protected
void* DtReflectedObjectList::myDiscoveryConditionParameter
protected
DtExerciseConn* DtReflectedObjectList::myExConn
protected

Referenced by exerciseConn().

std::vector<RTI::ObjectClassHandle> DtReflectedObjectList::myHandleList
protected
DtIntrusiveList DtReflectedObjectList::myObjectAddedCallbacks
protected
DtRefHlaObjectMap DtReflectedObjectList::myObjectList
protected

Referenced by firstObj(), and lastObj().

DtHashList DtReflectedObjectList::myObjectListByName
protected
DtIntrusiveList DtReflectedObjectList::myObjectRemovedCallbacks
protected
DtDDMRegionSet DtReflectedObjectList::mySubscribedRegions
protected
DtList DtReflectedObjectList::myTimedOutObjectList
protected
DtTime DtReflectedObjectList::myTimeoutInterval
protected
bool DtReflectedObjectList::myTimeoutProcessingFlag
protected
DtString DtReflectedObjectList::myUpdateRateTag
protected
DtRefHlaObjectMap DtReflectedObjectList::myWaitList
protected
DtTime DtReflectedObjectList::myWaitlistRefreshPeriod
protected
bool DtReflectedObjectList::myWaitListRequestUpdateFlag
protected
DtTime DtReflectedObjectList::myWaitlistTime
protected
bool DtReflectedObjectList::theAutoSubscribeFlag
staticprotected
bool DtReflectedObjectList::theRequestClassUpdateFlag
staticprotected
bool DtReflectedObjectList::theRequestObjectUpdateFlag
staticprotected

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

Document ID: Generated on Thu Feb 22 04:26:36 EST 2018 from SVN revision 186468
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)