VR-Link API Documentation for HLA 1.3
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtHlaObjectWithStateRep Class Reference

class DtHlaObjectWithStateRep: More...

+ Inheritance diagram for DtHlaObjectWithStateRep:
+ Collaboration diagram for DtHlaObjectWithStateRep:

Public Member Functions

 DtHlaObjectWithStateRep (DtExerciseConn *conn, RTI::ObjectHandle id, const char *name, DtObjClassDesc &classDesc, bool reflecting)
 constructor
 DtHlaObjectWithStateRep (DtExerciseConn *conn, const char *name, DtObjClassDesc &classDesc, bool reflecting)
 constructor
virtual ~DtHlaObjectWithStateRep ()
 destructor
virtual void useTheseForUpdating (DtStateRepository *stateRep, DtStateRepository *asSeenByRemote, DtHlaStateEncoder *encoder, DtHlaStateDecoder *decoder)
 Local Entity specific functions.
virtual void generateUpdate (const RTI::AttributeHandleSet &eligibleAttrs, const RTI::AttributeHandleSet &requiredAttrs, DtStateMsg *stateMsg)
 Called by update() to actually generate an outgoing message.
virtual DtStateRepositorystateRepForUpdating () const
 Returns current state repository used for updating.
virtual DtStateRepositorystateRepForReflecting () const
 Returns current state repository used for reflecting.
virtual DtStateRepositoryasSeenByRemote () const
 Returns asSeenByRemote.
virtual void useTheseForReflecting (DtStateRepository *stateRep, DtHlaStateDecoder *decoder)
 Remote Entity specific functions.
virtual void stopUsingTheseForReflecting (DtStateRepository *stateRep, DtHlaStateDecoder *decoder)
 Remove a decoder/stateRep pair to use for decoding.
virtual void reflect (const DtStateMsg &stateMsg)
 Receive representation (remote reflection) from the RTI, and update any state repositories that have been registered with us, to reflect this incoming data.
virtual void reflectLocal (const DtStateMsg &stateMsg)
 When the DtExerciseConn's reflecting flag is on, this function is called when we send an update, so that the update can get reflected back into our "reflected" views of the object.
virtual void printMsg (const DtStateMsg &msg, bool fullReport) const
 Prints contents of a state msg.
- Public Member Functions inherited from DtHlaObject
 DtHlaObject (DtExerciseConn *conn, RTI::ObjectHandle id, const char *name, DtObjClassDesc &classDesc, bool reflecting=false)
 Constructor - used to construct a DtHlaObject to represent an object that we discover through an RTI callback.
 DtHlaObject (DtExerciseConn *conn, const char *name, DtObjClassDesc &classDesc, bool reflecting=false)
 Constructor - used to construct a DtHlaObject to represent an object that will be registered locally.
virtual ~DtHlaObject ()
 Destructor.
virtual const RTI::ObjectHandle & objectId () const
 Get the object's handle.
virtual const
RTI::AttributeHandleSet & 
attrHandleSet ()
 Get the set of attributes associated with this object's FOM class.
virtual const
RTI::AttributeHandleSet & 
requestedAttributes ()
 Returns the union of all sets of attributes requested since the last call to clearRequestedAttributes.
virtual RTI::ObjectClassHandle objectClassHandle () const
 Get the object's class handle.
virtual const char * name () const
 Get the object's name.
int numAttributes () const
 Get the number of attributes associated with this object's FOM class.
virtual DtExerciseConnexerciseConn () const
 Get the exercise connection for this object.
virtual DtObjClassDescclassDesc () const
 Get the class descriptor for the object's class.
virtual void setupUpdating ()
 Local Object specific functions.
virtual void update ()
 Generate and send any necessary attribute updates through the RTI.
virtual void cleanupFromUpdating ()
 Do the deinitialization required to stop updating attributes of this object.
virtual void processProvideUpdate (const RTI::AttributeHandleSet &set)
 Set yourself up so that on the next tick, you send an update for the appropriate attributes.
virtual void clearRequestedAttributes ()
 Clears the set of requested attributes.
virtual const
RTI::AttributeHandleSet & 
ownedAttributes ()
 Returns the set of attributes of this object that are owned by the local federate.
virtual void forceUpdate ()
 Specify a set of attributes that should be included in the ahvps the next time update is called, even if they would not otherwise need to be sent.
virtual void forceUpdate (const RTI::AttributeHandleSet &set)
virtual void clearForcedAttributes ()
 Clear (empty) the set of forced attributes.
virtual const
RTI::AttributeHandleSet & 
attributesNeededByFederation ()
 Returns the set of attributes that are currently needed by the federation, i.e.
virtual const
RTI::AttributeHandleSet & 
eligibleAttributes ()
 Returns the set of attributes that eligible for sending.
virtual const
RTI::AttributeHandleSet & 
requiredAttributes ()
 Returns the set of attributes that should be included in the next update regardless of whether their update conditions have been met.
bool classNeededByFederation ()
 Returns true if the class is needed by the federation, i.e.
void setupClassForUpdating ()
 If the class has never been published, publish it with all attributes using DtObjClassDesc::publish.
virtual void setupReflecting ()
 Remote Object specific functions.
virtual void callReflect (const DtStateMsg &msg)
 Calls reflect, and any postReflect callbacks.
virtual void callReflectLocal (const DtStateMsg &msg)
 Calls reflectLocal, and any postReflect callbacks.
virtual void cleanupFromReflecting ()
 Do the deinitialization required to stop handling reflection of object.
virtual void requestUpdate (RTI::AttributeHandleSet *attrs=0)
 Request an update for the object for the set of attributes indicated by attrs (or all subscribed attributes if attrs is NULL).
virtual void addRemoveObjectCb (DtRemoveObjectCb cb, void *usr)
 Add (register) function to be called when object is about to be removed.
virtual void removeRemoveObjectCb (DtRemoveObjectCb cb, void *usr)
 Remove (deregister) function to be called when object is about to be removed.
virtual void addPostReflectCb (DtObjectReflectAttributeValuesCb cb, void *usr)
 Add (register) function to be called after each reflectAttrValues.
virtual void removePostReflectCb (DtObjectReflectAttributeValuesCb cb, void *usr)
 Remove (deregister) function to be called after each reflectAttrValues.
virtual void processRemoveObject ()
 Process notification of removal of the object from the network.
virtual DtOwnershipHandlersetOwnershipHandler (DtOwnershipHandler *handler)
 Ownership-Management-related functions.
virtual void unconditionalDivest (const RTI::AttributeHandleSet &attrs)
 Unconditionally divest ownership of attrs.
virtual void negotiatedDivest (const RTI::AttributeHandleSet &attrs)
 Try to divest ownership of attrs.
virtual void cancelNegotiatedDivest (const RTI::AttributeHandleSet &attrs)
 Cancel a negotiated divestiture of attributes.
virtual void acquireAttributes (const RTI::AttributeHandleSet &attrs, bool ifAvailable=false)
 Attempt to acquire ownership of attributes.
virtual void cancelAcquireAttributes (const RTI::AttributeHandleSet &attrs)
 Cancel the request to acquire ownership of attrs.
virtual DtTime lastSimTimeUpdateReceived () const
 Returns the value of VR-Link simulation time at the time the last attribute update was received for this object.
virtual DtTime lastReceivedTimeStamp () const
virtual void localSubscriptionChanged ()
 Called when local object class subscriptions change.
virtual void publicationChanged ()
 Called when there is a change in the publication status of this object's object class.
virtual void processRequestAssumption (const RTI::AttributeHandleSet &attrs, const char *tag)
 Process RTI's requestAttributeOwnershipAssumption service.
virtual void processRequestRelease (const RTI::AttributeHandleSet &attrs, const char *tag)
 Process RTI's requestAttributeOwnershipRelease service.
virtual void processAttributeAcquisition (const RTI::AttributeHandleSet &attrs)
 Handle an invocation of the attributeOwnershipAcquisitionNotification service.
virtual void processAttributeDivestiture (const RTI::AttributeHandleSet &attrs)
 Handle an invocation of the attributeOwnershipDivestitureNotification service.
virtual void processConfirmAcquisitionCancellation (const RTI::AttributeHandleSet &attrs)
 Process RTI's conformAttributeOwnershipAcquisitionCancellation service.

Static Public Member Functions

static DtHlaObjectcreate (DtExerciseConn *conn, RTI::ObjectHandle id, const char *name, DtObjClassDesc &classDesc, bool reflecting)
 Creator function for this class.
- Static Public Member Functions inherited from DtHlaObject
static void ownerAcquisitionIfAvailableCb (void *usr)
 The following four static fns are for use within ownership msg callbacks.
static void ownerAcquisitionCb (void *usr)
static void negotiatedDivestitureCb (void *usr)
static void unconditionalDivestitureCb (void *usr)

Protected Member Functions

 DtHlaObjectWithStateRep (const DtHlaObjectWithStateRep &orig)
 copy constructor - not implemented.
DtHlaObjectWithStateRepoperator= (const DtHlaObjectWithStateRep &orig)
 assignment operator - not implemented.
- Protected Member Functions inherited from DtHlaObject
 DtHlaObject ()
 Default constructor: not implemented; do not call.
 DtHlaObject (const DtHlaObject &src)
 Copy constructor: not implemented; do not call.
DtHlaObjectoperator= (const DtHlaObject &src)
 Assignment operator: not implemented; do not call.
virtual void setLastSimTimeUpdateReceived (DtTime tm)
 Set the time an update was last received or sent.
virtual void setLastReceivedTimeStamp (DtTime tm)
virtual void copyToLocalAndRemote (const RTI::AttributeHandleValuePairSet &sourceList, const RTI::AttributeHandleSet &neededByRemote, const RTI::AttributeHandleSet &neededByLocal, RTI::AttributeHandleValuePairSet &toRemoteList, RTI::AttributeHandleValuePairSet &toLocalList)
 Copy attribute values from source into remote and local lists.
virtual void clearUpdatedAttributes (const RTI::AttributeHandleValuePairSet &sourceList)
 Remove the attributes present in the given value set from the requested and forced handle sets.
void wipeRemoveList ()
 Remove all callbacks from the remove callback list.
virtual void clearRemoveList ()
 Virtual version of above.
void wipeReflectList ()
 Remove all callbacks from the reflect callback list.
virtual void applyPostReflectCallbacks (const DtStateMsg &msg)
 Apply callbacks after a state msg is reflected.
virtual void loseOwnership (const RTI::AttributeHandleSet &attrs)
 Gets called whenever we lose ownership of a set of attributes.
virtual void gainOwnership (const RTI::AttributeHandleSet &attrs)
 Gets called whenever we gain ownership of a set of attributes.
virtual void processUpdatesOff (const RTI::AttributeHandleSet &set)
 Callback for handling turnUpdatesOffForObjectInstance RTI call.
void processUpdatesOn (const RTI::AttributeHandleSet &set)
 Callback for handling turnUpdatesOnForObjectInstance RTI call.
virtual bool known () const
 Returns true if the object has been registered with, or discovered via the RTI.
void dumpRtiException (const char *functionName, const RTI::Exception *exc) const
 Print message to explain the RTI Exception.
virtual void computeEligible ()
 Recomputes the set of attrs that are eligible for sending.
virtual void justRegistered ()
 Called by DtHlaObjectManager right after a DtHlaObject is created, if it was created to represent a newly registered object.
virtual void addHandlesToSet (RTI::AttributeHandleSet &destinationSet, const RTI::AttributeHandleSet &sourceSet)
 Add source attribute set to destination checking each handle for membership first.

Protected Attributes

DtHlaStateDecodermyDecoder
 These are all used for encoding only.
DtHlaStateEncodermyEncoder
DtStateRepositorymyStateRepForUpdating
DtStateRepositorymyAsSeenByRemote
DtList myDecList
 List of decoder/stateRep pairs.
- Protected Attributes inherited from DtHlaObject
char * myName
DtExerciseConnmyExConn
bool myReflecting
bool myUpdating
DtList myRemoveCbList
DtList myReflectCbList
DtListItemmyRemoveCbListNextPtr
DtListItemmyReflectCbListNextPtr
DtTime myLastSimTimeUpdateReceived
DtTime myLastReceivedTimeStamp
DtObjClassDescmyClassDesc
RTI::ObjectHandle myObjectId
RTI::AttributeHandleSet * myEligibleAttrs
 Attributes that are eligible to be sent from within update() - passed to generateUpdate.
RTI::AttributeHandleSet * myNeededAttrs
 Set of owned attributes for which we have received a turnUpdatesOn more recently than a turnUpdatesOff.
RTI::AttributeHandleSet * myOwnedAttributes
 Set of attributes owned by the local federate.
RTI::AttributeHandleSet * myRequestedAttributes
 Requested by other federates.
RTI::AttributeHandleSet * myForcedAttributes
 Requested by a call to setForcedUpdate.
RTI::AttributeHandleSet * myRequiredAttributes
 Union of forced and requested - not computed until needed.
DtOwnershipHandlermyOwnershipHandler

Additional Inherited Members

- Static Protected Member Functions inherited from DtHlaObject
static void reflectAttributeValuesCb (const DtStateMsg &stateMsg, void *hlaObj)
 Callback for handling state messages for the HLA object.
static void updatesOnCb (RTI::ObjectHandle handle, const RTI::AttributeHandleSet &attributeSet, void *usr)
 Callback for handling turnUpdatesOnForObjectInstance RTI call.
static void updatesOffCb (RTI::ObjectHandle handle, const RTI::AttributeHandleSet &attributeSet, void *usr)
 Callback for handling turnUpdatesOffForObjectInstance RTI call.

Detailed Description

class DtHlaObjectWithStateRep:

Instances of DtHlaObjectWithStateRep are used to represent an HLA object via a state representation.

Constructor & Destructor Documentation

DtHlaObjectWithStateRep::DtHlaObjectWithStateRep ( DtExerciseConn conn,
RTI::ObjectHandle  id,
const char *  name,
DtObjClassDesc classDesc,
bool  reflecting 
)

constructor

Referenced by create().

DtHlaObjectWithStateRep::DtHlaObjectWithStateRep ( DtExerciseConn conn,
const char *  name,
DtObjClassDesc classDesc,
bool  reflecting 
)

constructor

virtual DtHlaObjectWithStateRep::~DtHlaObjectWithStateRep ( )
virtual

destructor

DtHlaObjectWithStateRep::DtHlaObjectWithStateRep ( const DtHlaObjectWithStateRep orig)
protected

copy constructor - not implemented.

Member Function Documentation

DtStateRepository * DtHlaObjectWithStateRep::asSeenByRemote ( ) const
inlinevirtual

Returns asSeenByRemote.

References myAsSeenByRemote.

DtHlaObject * DtHlaObjectWithStateRep::create ( DtExerciseConn conn,
RTI::ObjectHandle  id,
const char *  name,
DtObjClassDesc classDesc,
bool  reflecting 
)
inlinestatic

Creator function for this class.

References DtHlaObjectWithStateRep().

virtual void DtHlaObjectWithStateRep::generateUpdate ( const RTI::AttributeHandleSet &  eligibleAttrs,
const RTI::AttributeHandleSet &  requiredAttrs,
DtStateMsg stateMsg 
)
virtual

Called by update() to actually generate an outgoing message.

This class's implementation uses an encoder, and stateRepositories to perform this function. eligibleAttrs is the set of owned attributes to which remote federates have subscribed. requiredAttrs is the set of attributes that have been requested or forced by application code since the attribute was last sent. stateMsg is the message to fill out.

Reimplemented from DtHlaObject.

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

assignment operator - not implemented.

virtual void DtHlaObjectWithStateRep::printMsg ( const DtStateMsg msg,
bool  fullReport 
) const
virtual

Prints contents of a state msg.

Base class prints only header info. If fullReport set to true, printMsg requests a full status print out for objects with a state repository.

Reimplemented from DtHlaObject.

virtual void DtHlaObjectWithStateRep::reflect ( const DtStateMsg stateMsg)
virtual

Receive representation (remote reflection) from the RTI, and update any state repositories that have been registered with us, to reflect this incoming data.

If the exercise connection's reflecting flag is set, and its reflectRemoteUpdatesIntoPub flag is set, then we decode the message into myStateRepForUpdating in addition to any state repositories that have been registered with us for reflection.

Implements DtHlaObject.

virtual void DtHlaObjectWithStateRep::reflectLocal ( const DtStateMsg stateMsg)
virtual

When the DtExerciseConn's reflecting flag is on, this function is called when we send an update, so that the update can get reflected back into our "reflected" views of the object.

Implements DtHlaObject.

virtual DtStateRepository* DtHlaObjectWithStateRep::stateRepForReflecting ( ) const
virtual

Returns current state repository used for reflecting.

Returns the state repository containing the current reflected state of the entity. If there is more than one such state repository (e.g. you have multiple RELs in your application), the first one is returned.

DtStateRepository * DtHlaObjectWithStateRep::stateRepForUpdating ( ) const
inlinevirtual

Returns current state repository used for updating.

References myStateRepForUpdating.

virtual void DtHlaObjectWithStateRep::stopUsingTheseForReflecting ( DtStateRepository stateRep,
DtHlaStateDecoder decoder 
)
virtual

Remove a decoder/stateRep pair to use for decoding.

virtual void DtHlaObjectWithStateRep::useTheseForReflecting ( DtStateRepository stateRep,
DtHlaStateDecoder decoder 
)
virtual

Remote Entity specific functions.

Add a decoder/stateRep pair to use for decoding. Incoming HLA messages will be decoded into stateRep using decoder.

virtual void DtHlaObjectWithStateRep::useTheseForUpdating ( DtStateRepository stateRep,
DtStateRepository asSeenByRemote,
DtHlaStateEncoder encoder,
DtHlaStateDecoder decoder 
)
virtual

Local Entity specific functions.

Set the state repositories (local representation and remote reflection), and the encoder and decoder which are used to send and receive HLA state messages from/into the repository.

Member Data Documentation

DtStateRepository* DtHlaObjectWithStateRep::myAsSeenByRemote
protected

Referenced by asSeenByRemote().

DtList DtHlaObjectWithStateRep::myDecList
protected

List of decoder/stateRep pairs.

It is a list of pointers to DtHlaObjectView. They are used for decoding.

DtHlaStateDecoder* DtHlaObjectWithStateRep::myDecoder
protected

These are all used for encoding only.

DtHlaStateEncoder* DtHlaObjectWithStateRep::myEncoder
protected
DtStateRepository* DtHlaObjectWithStateRep::myStateRepForUpdating
protected

Referenced by stateRepForUpdating().


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

Document ID: Generated on Wed Oct 23 22:25:48 EDT 2013 from SVN revision 132765
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)