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 | Private Member Functions
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 processDiGuyData=false, int numBucketsPrimeNumber=503)
 Constructor. More...
 
virtual ~DtReflectedEntityList ()
 Destructor. More...
 
virtual DtReflectedEntity * lookup (const DtObjectId &id) const
 Lookup an entity from its object ID. More...
 
virtual DtReflectedEntity * lookup (const DtVrlUuid &uniqueId)
 Lookup an entity from its NETN UUID. More...
 
virtual DtReflectedEntity * first () const
 Get the first and last elements of the entity list. More...
 
virtual DtReflectedEntity * last () const
 
virtual void removeAndDelete (DtReflectedObject *obj, const char *msg=NULL) override
 Remove the entity from the list and delete it. More...
 
virtual void addToObjectList (DtReflectedObject *refObj)
 Adds an object the the list. More...
 
virtual void addEntityAdditionCallback (DtEntityCallbackFunction cb, void *userData)
 Entity added callback registration/deregistration. More...
 
virtual void removeEntityAdditionCallback (DtEntityCallbackFunction cb, void *userData)
 
virtual void addEntityRemovalCallback (DtEntityCallbackFunction cb, void *userData)
 Entity removed callback registration/deregistration. More...
 
virtual void removeEntityRemovalCallback (DtEntityCallbackFunction cb, void *userData)
 
virtual void print ()
 Print the SRs of all objects. More...
 
virtual DtReflectedEntity * processEntityState (const DtEntityStatePdu &pdu)
 Process an incoming entity state pdu. More...
 
virtual void processRelativeLocationPdu (const DtRelativeLocationPdu &pdu)
 Process an incoming relativeLocation pdu. More...
 
virtual void processEntityStateUpdatePdu (const DtEntityStateUpdatePdu &pdu)
 Process an incoming relativeLocation pdu. More...
 
virtual void processDiGuyPdu (const DtDIGuyCustomPdu &pdu)
 Process an incoming DI Guy Custom PDU. More...
 
virtual void processSeesPdu (const DtSuppEmisEntStatePdu &pdu)
 Process an incoming SEES PDU. More...
 
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. More...
 
virtual void setProcessDiGuyPdus (bool enableProcessing)
 Set/Get whether to process DI-Guy data (PDU's or attributes). More...
 
virtual bool processingDiGuyPdus () const
 
virtual void setProcessDiGuyData (bool enableProcessing)
 Set/Get whether to process DI-Guy data (PDU's or attributes). More...
 
virtual bool processingDiGuyData () const
 Set/Get whether to process DI-Guy data (PDU's or attributes). More...
 
- Public Member Functions inherited from DtReflectedObjectList
 DtReflectedObjectList (DtExerciseConn *exConn, int numBucketsPrimeNumber=503)
 Constructor. More...
 
virtual ~DtReflectedObjectList ()
 destructor Warning: makes non-virtual call to removeAndDelete More...
 
virtual void initializeAttributePduKindsOfInterest (const std::set< DtPduKind > &pduKinds)
 This initializes which PDU kinds will be processed when receiving an Attribute PDU. More...
 
virtual DtReflectedObject * firstObj () const
 Get the first/last object in the list. More...
 
virtual DtReflectedObject * lastObj () const
 
virtual int count () const
 Get number of objects. More...
 
virtual DtReflectedObject * lookupObj (const DtBaseHashKey &key) const
 Search for an object. More...
 
virtual DtExerciseConn * exerciseConn () const
 Get my exerciseConn. More...
 
virtual void addObjectAdditionCallback (DtReflectedObjectCallbackFunction cb, void *userData)
 Object added callback registration/deregistration. More...
 
virtual void removeObjectAdditionCallback (DtReflectedObjectCallbackFunction cb, void *userData)
 
virtual void addObjectRemovalCallback (DtReflectedObjectCallbackFunction cb, void *userData)
 Object removed callback registration/deregistration. More...
 
virtual void removeObjectRemovalCallback (DtReflectedObjectCallbackFunction cb, void *userData)
 
virtual void print () const
 Print the SRs of all objects. More...
 
virtual void setTimeoutProcessing (bool onOff)
 Set whether or not timeout processing occurs. More...
 
virtual void setTimeoutInterval (DtTime time)
 Set/Get the remote object timeout period. More...
 
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. More...
 
virtual void clearDiscoveryCondition ()
 Unregisters the checker function set in setDiscoverCondition. More...
 
virtual void removeObject (DtReflectedObject *obj)
 This is the same as removeAndDelete, it exists to maintain equality with HLA objects. More...
 
virtual DtTime timeoutCheckInterval () const
 
virtual void setTimeoutCheckInterval (DtTime interval)
 
virtual void addWaitlistAdditionCallback (DtReflectedObjectCallbackFunction cb, void *userData)
 Callback registration for when objects are added or removed from the waitlist. More...
 
virtual void removeWaitlistAdditionCallback (DtReflectedObjectCallbackFunction cb, void *userData)
 
virtual void addWaitlistRemovalCallback (DtReflectedObjectCallbackFunction cb, void *userData)
 Waitlist removed callback registration/deregistration. More...
 
virtual void removeWaitlistRemovalCallback (DtReflectedObjectCallbackFunction cb, void *userData)
 

Protected Member Functions

virtual DtReflectedObject * newReflectedObj (const DtStateMsg &msg)
 Create a new object from a state message. More...
 
virtual DtReflectedObject * processStateMessage (const DtStateMsg &msg)
 Process an incoming state message. Calls processEntityState(). More...
 
virtual void objectAdded (DtReflectedObject *obj)
 Called after an entity is added and before additional callbacks are processed. More...
 
virtual void finalPduIsSetAction (DtReflectedEntity *entity)
 Called when an entity sends its final PDU. More...
 
virtual const DtBaseHashKey & hashKeyFromStateMessage (const DtStateMsg *msg)
 Get a hash key from a state message. More...
 
virtual DtReflectedEntity * newReflectedEntity (const DtEntityIdentifier &id, const DtEntityType &type) const
 Create a new reflected entity. More...
 
virtual void entityAdded (DtReflectedEntity *ent)
 Called after an entity is added and before additional callbacks are processed. More...
 
virtual void addToUuidEntityMap (DtReflectedEntity *ent)
 Add/remove from NETN UUID map. More...
 
virtual void removeFromUuidEntityMap (DtReflectedEntity *ent)
 
- Protected Member Functions inherited from DtReflectedObjectList
virtual void doTimeouts ()
 Remove any remote objects which have not been updated during the timeout period. More...
 
virtual bool shouldBeTimedOut (DtReflectedObject *object)
 Returns whether or not the object should be timed out. More...
 
void emptyLists ()
 Empty the object list and the timeout list. More...
 
void emptyCallbackLists ()
 
virtual void processObjectAdditionCallbacks (DtReflectedObject *object)
 Process object addition/removal callbacks. More...
 
virtual void processObjectRemovalCallbacks (DtReflectedObject *object)
 
virtual void processWaitlistAdditionCallbacks (DtReflectedObject *object)
 Process waitlist addition/removal callbacks. More...
 
virtual void processWaitlistRemovalCallbacks (DtReflectedObject *object)
 
virtual DtBaseHashKey * hashKeyFromAttributeRecordSet (const DtAttributeRecordSet &recordSet)
 Get a hash key from an attribute record set. More...
 
virtual int acceptPdu (const DtStateMsg &) const
 Determines if a PDU should be processed or not. More...
 
virtual bool readyToAdd (DtReflectedObject *obj)
 Returns true if the obj is ready to be added to myObjectList; calls myDiscoveryCondition from within. More...
 
virtual void processAttributePduCb (DtAttributeInteraction *inter)
 
virtual void processAttributePduRecordSet (const DtAttributeRecordSet &recordSet, const DtSimulationAddress &simAddr, DtReflectedObject *obj=0)
 
virtual void processAttributePduWaitListCb (DtReflectedObject *obj)
 
virtual void deleteRecordSetBySimulationAddressMap (DtRecordSetBySimulationAddressMap &recordSetMap, const DtSimulationAddress &simAddr=DtSimulationAddress()) const
 

Static Protected Member Functions

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

Protected Attributes

bool mySmoothCapable
 
DtEntityIdentifierHashKey myHashKey
 
bool myProcessingDiGuyData
 
std::map< DtVrlUuid,
DtReflectedEntity * > 
myUuidToEntityMap
 Map used for lookup of NETN UUIDs. More...
 
- Protected Attributes inherited from DtReflectedObjectList
DtExerciseConn * myExConn
 
DtIntrusiveList myObjectAddedCallbacks
 
DtIntrusiveList myObjectRemovedCallbacks
 
DtIntrusiveList myWaitlistAddedCallbacks
 
DtIntrusiveList myWaitlistRemovedCallbacks
 
DtIntrusiveList myObjectList
 
DtIntrusiveList myWaitList
 
DtHashlist myObjectHashlist
 
DtHashlist myWaitHashlist
 
DtAttributesByObjectIdMap myAttributeWaitHashlist
 
DtTime myTimeoutInterval
 
DtTime myNextTimeoutCheck
 
DtTime myTimeoutCheckInterval
 
bool myTimeoutProcessingFlag
 
DtDiscoveryCondition myDiscoveryCondition
 
void * myDiscoveryConditionParameter
 
std::set< DtPduKind > myPduKindSet
 

Private Member Functions

DtReflectedEntityList & operator= (const DtReflectedEntityList &orig)
 Assignment operator – not implemented. More...
 
 DtReflectedEntityList (const DtReflectedEntityList &orig)
 Copy constructor – not implemented. More...
 

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  processDiGuyData = false,
int  numBucketsPrimeNumber = 503 
)

Constructor.

virtual DtReflectedEntityList::~DtReflectedEntityList ( )
virtual

Destructor.

DtReflectedEntityList::DtReflectedEntityList ( const DtReflectedEntityList &  orig)
private

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.

virtual void DtReflectedEntityList::addToObjectList ( DtReflectedObject *  refObj)
virtual

Adds an object the the list.

virtual void DtReflectedEntityList::addToUuidEntityMap ( DtReflectedEntity *  ent)
protectedvirtual

Add/remove from NETN UUID map.

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::lookup ( const DtVrlUuid &  uniqueId)
virtual

Lookup an entity from its NETN UUID.

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

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 bool DtReflectedEntityList::processingDiGuyData ( ) const
virtual

Set/Get whether to process DI-Guy data (PDU's or attributes).

When true, enables processing of DI-Guy attributes and PDU (adds callback). When false, disables processing of DI-Guy attributes and PDU (removes callback).

Deprecated:
Use setProcessDiGuyData instead
virtual bool DtReflectedEntityList::processingDiGuyPdus ( ) const
virtual
Deprecated:
Use processingDiGuyData instead
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::removeAndDelete ( DtReflectedObject *  obj,
const char *  msg = NULL 
)
overridevirtual

Remove the entity from the list and delete it.

Overrides DtReflectedObjectList::removeAndDelete() to also remove the entity from the NETN UUID lookup map. This guarantees the UUID map is cleaned up on every removal path (timeout, explicit removal, final PDU), preventing a dangling pointer from being returned by lookup(uniqueId).

Reimplemented from DtReflectedObjectList.

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

SEES PDU callback.

virtual void DtReflectedEntityList::setProcessDiGuyData ( bool  enableProcessing)
virtual

Set/Get whether to process DI-Guy data (PDU's or attributes).

When true, enables processing of DI-Guy attributes and PDU (adds callback). When false, disables processing of DI-Guy attributes and PDU (removes callback).

Deprecated:
Use setProcessDiGuyData instead
virtual void DtReflectedEntityList::setProcessDiGuyPdus ( bool  enableProcessing)
virtual

Set/Get whether to process DI-Guy data (PDU's or attributes).

When true, enables processing of DI-Guy attributes and PDU (adds callback). When false, disables processing of DI-Guy attributes and PDU (removes callback).

Deprecated:
Use setProcessDiGuyData instead

Member Data Documentation

DtEntityIdentifierHashKey DtReflectedEntityList::myHashKey
protected
bool DtReflectedEntityList::myProcessingDiGuyData
protected
bool DtReflectedEntityList::mySmoothCapable
protected
std::map<DtVrlUuid, DtReflectedEntity*> DtReflectedEntityList::myUuidToEntityMap
protected

Map used for lookup of NETN UUIDs.


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

Document ID: Generated on Mon Sep 28 00:09:32 EDT 2026 from SVN revision 295353
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)