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

Instances of this class provide a protocol independent interface to a list of reflected entities in a DIS environment. More...

+ Inheritance diagram for DtReflectedEntityList:
+ Collaboration diagram for DtReflectedEntityList:

Public Member Functions

 DtReflectedEntityList (DtExerciseConn *exConn, bool smoothCapable=false, bool processDiGuyPdus=false)
 Constructor.
virtual ~DtReflectedEntityList ()
 Destructor.
virtual DtReflectedEntitylookup (const DtObjectId &id) const
 Lookup an entity from its object ID.
virtual DtReflectedEntityfirst () const
 Get the first and last elements of the entity list.
virtual DtReflectedEntitylast () const
virtual void addEntityAdditionCallback (DtEntityCallbackFunction cb, void *userData)
 Entity added callback registration/deregistration.
virtual void removeEntityAdditionCallback (DtEntityCallbackFunction cb, void *userData)
virtual void addEntityRemovalCallback (DtEntityCallbackFunction cb, void *userData)
 Entity removed callback registration/deregistration.
virtual void removeEntityRemovalCallback (DtEntityCallbackFunction cb, void *userData)
virtual void print ()
 Print the SRs of all objects.
virtual DtReflectedEntityprocessEntityState (const DtEntityStatePdu &pdu)
 Process an incoming entity state pdu.
virtual void processRelativeLocationPdu (const DtRelativeLocationPdu &pdu)
 Process an incoming relativeLocation pdu.
virtual void processEntityStateUpdatePdu (const DtEntityStateUpdatePdu &pdu)
 Process an incoming relativeLocation pdu.
virtual void processDiGuyPdu (const DtDIGuyCustomPdu &pdu)
 Process an incoming DI Guy Custom PDU.
virtual void processSeesPdu (const DtSuppEmisEntStatePdu &pdu)
 Process an incoming SEES PDU.
virtual void setProcessDiGuyPdus (bool trueFalse)
 Tells the reflected list whether to process DI-Guy PDU's or not.
virtual void discoverOnlyWhenEntityTypeKnown (bool yesNo)
 Allows one to specify whether the REL should wait until the entity type is known before adding the entity to the list.
- Public Member Functions inherited from DtReflectedObjectList
 DtReflectedObjectList (DtExerciseConn *exConn)
 Constructor.
virtual ~DtReflectedObjectList ()
 destructor Warning: makes non-virtual call to removeAndDelete
virtual void initializeAttributePduKindsOfInterest (const std::set< DtPduKind > &pduKinds)
 This initializes which PDU kinds will be processed when receiving an Attribute PDU.
virtual DtReflectedObjectfirstObj () const
 Get the first/last object in the list.
virtual DtReflectedObjectlastObj () const
virtual int count () const
 Get number of objects.
virtual DtReflectedObjectlookupObj (const DtBaseHashKey &key) const
 Search for an object.
virtual DtExerciseConnexerciseConn () const
 Get my exerciseConn.
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 () const
 Print the SRs of all objects.
virtual void setTimeoutProcessing (bool onOff)
 Set whether or not timeout processing occurs.
virtual void setTimeoutInterval (DtTime time)
 Set/Get the remote object timeout period.
virtual DtTime timeoutInterval ()
virtual void setDiscoveryCondition (DtDiscoveryCondition fn, void *usr)
 Set the checker function which will determine when an object gets discovered and put into the ref.
virtual void clearDiscoveryCondition ()
 Unregisters the checker function set in setDiscoverCondition.

Protected Member Functions

DtReflectedEntityListoperator= (const DtReflectedEntityList &orig)
 Assignment operator – not implemented.
 DtReflectedEntityList (const DtReflectedEntityList &orig)
 Copy constructor – not implemented.
virtual DtReflectedObjectnewReflectedObj (const DtStateMsg &msg)
 Create a new object from a state message.
virtual DtReflectedObjectprocessStateMessage (const DtStateMsg &msg)
 Process an incoming state message. Calls processEntityState().
virtual void objectAdded (DtReflectedObject *obj)
 Called after an entity is added and before additional callbacks are processed.
virtual void finalPduIsSetAction (DtReflectedEntity *entity)
 Called when an entity sends its final PDU.
virtual const DtBaseHashKeyhashKeyFromStateMessage (const DtStateMsg *msg)
 Get a hash key from a state message.
virtual DtReflectedEntitynewReflectedEntity (const DtEntityIdentifier &id, const DtEntityType &type) const
 Create a new reflected entity.
virtual void entityAdded (DtReflectedEntity *ent)
 Called after an entity is added and before additional callbacks are processed.
- Protected Member Functions inherited from DtReflectedObjectList
 DtReflectedObjectList (const DtReflectedObjectList &orig)
 copy constructor – not implemented
DtReflectedObjectListoperator= (const DtReflectedObjectList &orig)
 assignment operator – not implemented
virtual void doTimeouts ()
 Remove any remote objects which have not been updated during the timeout period.
virtual void removeAndDelete (DtReflectedObject *obj, char *msg=NULL)
 Remove the remote object from the list if found and delete it.
virtual bool shouldBeTimedOut (DtReflectedObject *object)
 Returns whether or not the object should be timed out.
void emptyLists ()
 Empty the object list and the timeout list.
void emptyCallbackLists ()
virtual void processObjectAdditionCallbacks (DtReflectedObject *object)
 Process object addition/removal callbacks.
virtual void processObjectRemovalCallbacks (DtReflectedObject *object)
virtual DtBaseHashKeyhashKeyFromAttributeRecordSet (const DtAttributeRecordSet &recordSet)
 Get a hash key from an attribute record set.
virtual int acceptPdu (const DtStateMsg &) const
 Determines if a PDU should be processed or not.
virtual bool readyToAdd (DtReflectedObject *obj)
 Returns true if the obj is ready to be added to myObjectList; calls myDiscoveryCondition from within.
virtual void processAttributePduCb (DtAttributeInteraction *inter)

Static Protected Member Functions

static void entityStateCb (DtEntityStatePdu *pdu, void *usr)
 Callback for the exercise connection.
static void relativeLocationCb (DtRelativeLocationPdu *pdu, void *usr)
 Callback which calls processRelativeLocationPdu.
static void entityStateUpdateCb (DtEntityStateUpdatePdu *pdu, void *usr)
 Callback which calls processEntityStateUpdatePdu.
static void diGuyPduCb (DtDIGuyCustomPdu *pdu, void *usr)
 Callback which calls processDiGuyPdu.
static void seesPduCb (DtSuppEmisEntStatePdu *pdu, void *usr)
 SEES PDU callback.
static bool checkEntityType (DtReflectedObject *obj, void *usr)
 Callback which checks whether the entity type has arrived yet; registered/deregistered using the fn, discoverOnlyWhenEntityTypeKnown.
- Static Protected Member Functions inherited from DtReflectedObjectList
static void doTimeoutsPostDrainCb (void *usr)
 Calls doTimeouts.
static void processAttributePduCb (DtAttributeInteraction *inter, void *usr)

Protected Attributes

bool mySmoothCapable
DtEntityIdentifierHashKeymyHashKey
bool myProcessingDiGuyPdus
- Protected Attributes inherited from DtReflectedObjectList
DtExerciseConnmyExConn
DtIntrusiveList myObjectAddedCallbacks
DtIntrusiveList myObjectRemovedCallbacks
DtIntrusiveList myObjectList
DtIntrusiveList myWaitList
DtHashlist myObjectHashlist
DtHashlist myWaitHashlist
DtTime myTimeoutInterval
bool myTimeoutProcessingFlag
DtDiscoveryCondition myDiscoveryCondition
void * myDiscoveryConditionParameter
std::set< DtPduKindmyPduKindSet

Detailed Description

Instances of this class provide a protocol independent interface to a list of reflected entities in a DIS environment.

Examples

Constructor & Destructor Documentation

DtReflectedEntityList::DtReflectedEntityList ( DtExerciseConn exConn,
bool  smoothCapable = false,
bool  processDiGuyPdus = false 
)

Constructor.

virtual DtReflectedEntityList::~DtReflectedEntityList ( )
virtual

Destructor.

DtReflectedEntityList::DtReflectedEntityList ( const DtReflectedEntityList orig)
protected

Copy constructor – not implemented.

Member Function Documentation

virtual void DtReflectedEntityList::addEntityAdditionCallback ( DtEntityCallbackFunction  cb,
void *  userData 
)
virtual

Entity added callback registration/deregistration.

virtual void DtReflectedEntityList::addEntityRemovalCallback ( DtEntityCallbackFunction  cb,
void *  userData 
)
virtual

Entity removed callback registration/deregistration.

static bool DtReflectedEntityList::checkEntityType ( DtReflectedObject obj,
void *  usr 
)
staticprotected

Callback which checks whether the entity type has arrived yet; registered/deregistered using the fn, discoverOnlyWhenEntityTypeKnown.

static void DtReflectedEntityList::diGuyPduCb ( DtDIGuyCustomPdu pdu,
void *  usr 
)
staticprotected

Callback which calls processDiGuyPdu.

virtual void DtReflectedEntityList::discoverOnlyWhenEntityTypeKnown ( bool  yesNo)
virtual

Allows one to specify whether the REL should wait until the entity type is known before adding the entity to the list.

The default value is no, meaning entities will get added to the list immediately – regardless of whether it has received any attr values or not.

virtual void DtReflectedEntityList::entityAdded ( DtReflectedEntity ent)
protectedvirtual

Called after an entity is added and before additional callbacks are processed.

Right now, this function only calls DtInfo.

static void DtReflectedEntityList::entityStateCb ( DtEntityStatePdu pdu,
void *  usr 
)
staticprotected

Callback for the exercise connection.

static void DtReflectedEntityList::entityStateUpdateCb ( DtEntityStateUpdatePdu pdu,
void *  usr 
)
staticprotected

Callback which calls processEntityStateUpdatePdu.

virtual void DtReflectedEntityList::finalPduIsSetAction ( DtReflectedEntity entity)
protectedvirtual

Called when an entity sends its final PDU.

Currently, this removes and deletes the entity.

virtual DtReflectedEntity* DtReflectedEntityList::first ( ) const
virtual

Get the first and last elements of the entity list.

virtual const DtBaseHashKey& DtReflectedEntityList::hashKeyFromStateMessage ( const DtStateMsg msg)
protectedvirtual

Get a hash key from a state message.

Implements DtReflectedObjectList.

virtual DtReflectedEntity* DtReflectedEntityList::last ( ) const
virtual
virtual DtReflectedEntity* DtReflectedEntityList::lookup ( const DtObjectId id) const
virtual

Lookup an entity from its object ID.

virtual DtReflectedEntity* DtReflectedEntityList::newReflectedEntity ( const DtEntityIdentifier id,
const DtEntityType type 
) const
protectedvirtual

Create a new reflected entity.

virtual DtReflectedObject* DtReflectedEntityList::newReflectedObj ( const DtStateMsg msg)
protectedvirtual

Create a new object from a state message.

Calls newReflectedEntity() to create a new entity, and then tells the esr to use a smoother if smoothing is enabled.

Implements DtReflectedObjectList.

virtual void DtReflectedEntityList::objectAdded ( DtReflectedObject obj)
protectedvirtual

Called after an entity is added and before additional callbacks are processed.

Calls entityAdded().

Reimplemented from DtReflectedObjectList.

DtReflectedEntityList& DtReflectedEntityList::operator= ( const DtReflectedEntityList orig)
protected

Assignment operator – not implemented.

virtual void DtReflectedEntityList::print ( )
virtual

Print the SRs of all objects.

virtual void DtReflectedEntityList::processDiGuyPdu ( const DtDIGuyCustomPdu pdu)
virtual

Process an incoming DI Guy Custom PDU.

Only used if capability is turned on in the constructor.

virtual DtReflectedEntity* DtReflectedEntityList::processEntityState ( const DtEntityStatePdu pdu)
virtual

Process an incoming entity state pdu.

Then calls down to base class processStateMessage().

virtual void DtReflectedEntityList::processEntityStateUpdatePdu ( const DtEntityStateUpdatePdu pdu)
virtual

Process an incoming relativeLocation pdu.

virtual void DtReflectedEntityList::processRelativeLocationPdu ( const DtRelativeLocationPdu pdu)
virtual

Process an incoming relativeLocation pdu.

virtual void DtReflectedEntityList::processSeesPdu ( const DtSuppEmisEntStatePdu pdu)
virtual

Process an incoming SEES PDU.

virtual DtReflectedObject* DtReflectedEntityList::processStateMessage ( const DtStateMsg msg)
protectedvirtual

Process an incoming state message. Calls processEntityState().

Reimplemented from DtReflectedObjectList.

static void DtReflectedEntityList::relativeLocationCb ( DtRelativeLocationPdu pdu,
void *  usr 
)
staticprotected

Callback which calls processRelativeLocationPdu.

virtual void DtReflectedEntityList::removeEntityAdditionCallback ( DtEntityCallbackFunction  cb,
void *  userData 
)
virtual
virtual void DtReflectedEntityList::removeEntityRemovalCallback ( DtEntityCallbackFunction  cb,
void *  userData 
)
virtual
static void DtReflectedEntityList::seesPduCb ( DtSuppEmisEntStatePdu pdu,
void *  usr 
)
staticprotected

SEES PDU callback.

virtual void DtReflectedEntityList::setProcessDiGuyPdus ( bool  trueFalse)
virtual

Tells the reflected list whether to process DI-Guy PDU's or not.

If true, and the list is not processing DI-Guy PDU's, will add a callback for DI-Guy PDU's. If false, and the list is processing DI-Guy PDU's, will remove the callback to process the PDU's.

Member Data Documentation

DtEntityIdentifierHashKey* DtReflectedEntityList::myHashKey
protected
bool DtReflectedEntityList::myProcessingDiGuyPdus
protected
bool DtReflectedEntityList::mySmoothCapable
protected

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

Document ID: Generated on Fri May 15 06:36:13 EDT 2015 from SVN revision 153263
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)