VR-Link API Documentation for HLA Evolved
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
DtReflectedEntityList Class Reference

Instances of DtReflectedEntityList are used to manage remote entities from the network. More...

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

List of all members.

Public Member Functions

 DtReflectedEntityList (DtExerciseConn *exConn, bool smoothCapable=false, const DtDDMRegionSet *regionSetToUse=0)
 Constructor that uses subscription criteria from the exConn's fomMapper.
 DtReflectedEntityList (DtExerciseConn *exConn, const DtString &updateRateTag, bool smoothCapable=false, const DtDDMRegionSet *regionSetToUse=0)
 DtReflectedEntityList (DtExerciseConn *exConn, const DtList *handleList, bool smoothCapable=false, const DtDDMRegionSet *regionSetToUse=0)
 Constructor that uses a handle list as subscription criteria.
 DtReflectedEntityList (DtExerciseConn *exConn, const DtList *handleList, const DtString &updateRateTag, bool smoothCapable=false, const DtDDMRegionSet *regionSetToUse=0)
virtual ~DtReflectedEntityList ()
 Destructor.
virtual DtReflectedEntitylookup (RTI::ObjectHandle id)
 Look up entity by object handle.
virtual DtReflectedEntitylookup (const DtGlobalObjectDesignator &objName)
 Look up entity by name.
virtual DtReflectedEntitylookup (const DtEntityIdentifier &entityId)
 Look up entity by entityId.
virtual DtReflectedEntityfirst () const
 Get the first entity in the list.
virtual DtReflectedEntitylast () const
 Get the last entity in the list.
virtual void addToObjectList (DtReflectedObject *refObj)
 Adds an object the the list.
virtual void addToEntityIdentifierHashList (DtReflectedEntity *ent)
 Adds the entity id of ent to myEntityIdentifierHashlist.
virtual void addEntityAdditionCallback (DtEntityCallbackFunction cb, void *userData)
 Entity added callback registration.
virtual void removeEntityAdditionCallback (DtEntityCallbackFunction cb, void *userData)
 Entity added callback deregistration.
virtual void addEntityRemovalCallback (DtEntityCallbackFunction cb, void *userData)
 Entity removed callback registration.
virtual void removeEntityRemovalCallback (DtEntityCallbackFunction cb, void *userData)
 Entity removed callback deregistration.
virtual void discoverOnlyWhenEntityTypeKnown (bool yesNo)
 Allows one to specify whether discover should delayed until the entity type is known before adding the entity to the list.

Protected Member Functions

virtual const DtListdfltHandleList ()
 Returns the list of handles that the FOM Mapper associates with a DtReflectedEntityList.
virtual DtReflectedObjectnewReflectedObject (DtHlaObject *obj) const
 Override of the virtual function in DtReflectedObjectList.
virtual DtReflectedEntitynewReflectedEntity (DtHlaObject *obj) const
 Create a remote entity object for the HLA object.
virtual void removeAndDelete (DtReflectedObject *object, char *msg)
 Override of the virtual function in DtReflectedObjectList.
virtual void removeAndDelete (DtReflectedEntity *entity, char *msg=NULL)
 Default calls down to base class version, but can be overridden.
virtual void objectAdded (DtReflectedObject *obj)
 Called from processDiscoverObject() after a remote entity has been added to the list.
virtual void entityAdded (DtReflectedEntity *ent)
 Called by objectAdded (which is called from processDiscoverObject()) after a remote entity has been added to the list.

Static Protected Member Functions

static bool checkEntityType (DtReflectedObject *obj, void *usr)
 Callback which checks whether the entity type has arrived yet.
static void checkEntityId (DtReflectedEntity *ent, void *usr)
 Callback which checks whether the entity id of the entity has arrived yet.

Protected Attributes

bool mySmoothCapable
 Determines whether to use smoothing for reflected entities.
DtHashlist myEntityIdentifierHashlist
 Hash list used for lookup of entity identifiers.

Private Member Functions

 DtReflectedEntityList (const DtReflectedEntityList &orig)
 Copy constructor -- not implemented.
DtReflectedEntityListoperator= (const DtReflectedEntityList &orig)
 Assignment operator -- not implemented.

Detailed Description

Instances of DtReflectedEntityList are used to manage remote entities from the network.

DtReflectedEntityList, when instantiated, subscribes to all of the classes either specified by the FOM Mapper used by the DtExerciseConn or provided in the form of Object Class Handles. When an object of type handled by DtReflectedEntityList is discovered, a DtReflectedEntity is created and added to the list. DtReflectedEntityList provides a mechanism to maintain the list of remote entities and their data. In addition, DtReflectedEntityList provides callback mechanisms that the user may register for, so that the user may be notified and do certain processing when an entity is added/removed from the reflected entity list.

Examples

Constructor & Destructor Documentation

DtReflectedEntityList::DtReflectedEntityList ( DtExerciseConn exConn,
bool  smoothCapable = false,
const DtDDMRegionSet regionSetToUse = 0 
)

Constructor that uses subscription criteria from the exConn's fomMapper.

This constructor determines what entity classes to subscribe to by obtaining them from the exConn's fomMapper.

Parameters:
smoothCapableIf smoothCapable is set to true, any reflected entity maintained by this list will use a smoother.
DtReflectedEntityList::DtReflectedEntityList ( DtExerciseConn exConn,
const DtString updateRateTag,
bool  smoothCapable = false,
const DtDDMRegionSet regionSetToUse = 0 
)
DtReflectedEntityList::DtReflectedEntityList ( DtExerciseConn exConn,
const DtList handleList,
bool  smoothCapable = false,
const DtDDMRegionSet regionSetToUse = 0 
)

Constructor that uses a handle list as subscription criteria.

This constructor determines what entity classes to subscribe to by obtaining them from the handle list.

Parameters:
handleListis a list of RTI::ObjectClassHandle's that specifies what classes to subscribe to.
smoothCapableIf smoothCapable is set to true, any reflected entity maintained by this list will use a smoother.
DtReflectedEntityList::DtReflectedEntityList ( DtExerciseConn exConn,
const DtList handleList,
const DtString updateRateTag,
bool  smoothCapable = false,
const DtDDMRegionSet regionSetToUse = 0 
)

Destructor.

Copy constructor -- not implemented.


Member Function Documentation

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

Entity added callback registration.

Allows the user to specify a function to be called when an entity is discovered and added to the list.

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

Entity removed callback registration.

Allows the user to specify a function to be called when and entity is removed from the list.

Adds the entity id of ent to myEntityIdentifierHashlist.

This is called by checkEntityId, and needs to be public so that it can be called by the callback.

virtual void DtReflectedEntityList::addToObjectList ( DtReflectedObject refObj) [virtual]

Adds an object the the list.

Override DtReflectedObjectList::addToObjectList() (which it calls down to) to add entities to the entity identifier hash list

Reimplemented from DtReflectedObjectList.

static void DtReflectedEntityList::checkEntityId ( DtReflectedEntity ent,
void *  usr 
) [static, protected]

Callback which checks whether the entity id of the entity has arrived yet.

If it has, the entity id is added to myEntityIdentifierHashlist to be used for lookup purposes, and the callback is deregistered. Registered addToObjectList().

static bool DtReflectedEntityList::checkEntityType ( DtReflectedObject obj,
void *  usr 
) [static, protected]

Callback which checks whether the entity type has arrived yet.

This callback is registered/deregistered using the function: discoverOnlyWhenEntityTypeKnown()

virtual const DtList* DtReflectedEntityList::dfltHandleList ( ) [protected, virtual]

Returns the list of handles that the FOM Mapper associates with a DtReflectedEntityList.

Uses the FOM Mapper of the DtExerciseConn that is passed in through the constructor.

virtual void DtReflectedEntityList::discoverOnlyWhenEntityTypeKnown ( bool  yesNo) [virtual]

Allows one to specify whether discover should delayed 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) [protected, virtual]

Called by objectAdded (which is called from processDiscoverObject()) after a remote entity has been added to the list.

Default implementation prints a message. Subclasses can override this function to add functionality on entity addition.

virtual DtReflectedEntity* DtReflectedEntityList::first ( ) const [virtual]

Get the first entity in the list.

Returns:
The first reflected entity in the list if there is one, and NULL otherwise.
virtual DtReflectedEntity* DtReflectedEntityList::last ( ) const [virtual]

Get the last entity in the list.

Returns:
The last reflected entity in the list if there is one, and NULL otherwise.
virtual DtReflectedEntity* DtReflectedEntityList::lookup ( RTI::ObjectHandle  id) [virtual]

Look up entity by object handle.

Returns:
The reflected entity if it is on the list, and NULL otherwise.

Look up entity by name.

Returns:
The reflected entity if found, and NULL if not found.
virtual DtReflectedEntity* DtReflectedEntityList::lookup ( const DtEntityIdentifier entityId) [virtual]

Look up entity by entityId.

Returns:
The reflected entity if found, and NULL if not found.
virtual DtReflectedEntity* DtReflectedEntityList::newReflectedEntity ( DtHlaObject obj) const [protected, virtual]

Create a remote entity object for the HLA object.

Caller is responsible for deletion.

virtual DtReflectedObject* DtReflectedEntityList::newReflectedObject ( DtHlaObject obj) const [protected, virtual]

Override of the virtual function in DtReflectedObjectList.

newReflectedObject calls newReflectedEntity.

Implements DtReflectedObjectList.

virtual void DtReflectedEntityList::objectAdded ( DtReflectedObject obj) [protected, virtual]

Called from processDiscoverObject() after a remote entity has been added to the list.

Calls entityAdded.

Reimplemented from DtReflectedObjectList.

DtReflectedEntityList& DtReflectedEntityList::operator= ( const DtReflectedEntityList orig) [private]

Assignment operator -- not implemented.

virtual void DtReflectedEntityList::removeAndDelete ( DtReflectedObject object,
char *  msg 
) [protected, virtual]

Override of the virtual function in DtReflectedObjectList.

Calls removeAndDelete(DtReflectedEntity*....)

Reimplemented from DtReflectedObjectList.

virtual void DtReflectedEntityList::removeAndDelete ( DtReflectedEntity entity,
char *  msg = NULL 
) [protected, virtual]

Default calls down to base class version, but can be overridden.

Parameters:
msgIf msg is specified, msg is printed to DtInfo with the object handle of the object deleted
virtual void DtReflectedEntityList::removeEntityAdditionCallback ( DtEntityCallbackFunction  cb,
void *  userData 
) [virtual]

Entity added callback deregistration.

Allows the user to remove the callback function that is called when an entity is discovered and added to the list.

virtual void DtReflectedEntityList::removeEntityRemovalCallback ( DtEntityCallbackFunction  cb,
void *  userData 
) [virtual]

Entity removed callback deregistration.

Allows the user to remove the callback function that is called when an entity is removed from the list.


Member Data Documentation

Hash list used for lookup of entity identifiers.

Determines whether to use smoothing for reflected entities.


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

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)