![]() |
VR-Link API Documentation for HLA 1.3
|
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 void | computeEligible () |
| Recomputes the set of attrs that are eligible for sending. | |
| virtual DtStateRepository * | stateRepForUpdating () const |
| Returns current state repository used for updating. | |
| virtual DtStateRepository * | stateRepForReflecting () const |
| Returns current state repository used for reflecting. | |
| virtual DtStateRepository * | asSeenByRemote () 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 DtExerciseConn * | exerciseConn () const |
| Get the exercise connection for this object. | |
| virtual DtObjClassDesc & | classDesc () 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 DtOwnershipHandler * | setOwnershipHandler (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 | divestAttributes (const RTI::AttributeHandleSet &attrs, bool ifAvailable=false) |
| Try to divest ownership of attrs. | |
| virtual void | divestObject (bool ifAvailable=false) |
| Try to divest ownership of all 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 | acquireObject (bool ifAvailable=false) |
| Attempt to acquire ownership of all attributes for an object. | |
| 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 | setLastSimTimeUpdateReceived (DtTime tm) |
| Set the time an update was last received or sent. | |
| virtual void | setLastReceivedTimeStamp (DtTime tm) |
| 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 DtHlaObject * | create (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. | |
| DtHlaObjectWithStateRep & | operator= (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. | |
| DtHlaObject & | operator= (const DtHlaObject &src) |
| Assignment operator: not implemented; do not call. | |
| virtual bool | handlesMatch (const RTI::AttributeHandleValuePairSet &handleValueSet, const RTI::AttributeHandleSet &handleSet) const |
| Check if the handles in the given handle-value set are in the given handle set. | |
| 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, bool notifyOwnershipManagement=true) |
| 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. | |
| virtual void | dumpRtiException (const char *functionName, const RTI::Exception *exc) const |
| Print message to explain the RTI Exception. | |
| 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 Depracated - use DtFom::setInsert. | |
Protected Attributes | |
| DtHlaStateDecoder * | myDecoder |
| These are all used for encoding only. | |
| DtHlaStateEncoder * | myEncoder |
| DtStateRepository * | myStateRepForUpdating |
| DtStateRepository * | myAsSeenByRemote |
| DtList | myDecList |
| List of decoder/stateRep pairs. | |
Protected Attributes inherited from DtHlaObject | |
| char * | myName |
| DtExerciseConn * | myExConn |
| bool | myReflecting |
| bool | myUpdating |
| DtList | myRemoveCbList |
| DtList | myReflectCbList |
| DtListItem * | myRemoveCbListNextPtr |
| DtListItem * | myReflectCbListNextPtr |
| DtTime | myLastSimTimeUpdateReceived |
| DtTime | myLastReceivedTimeStamp |
| DtObjClassDesc & | myClassDesc |
| SplitUpdateDiscriminant | mySplitUpdate |
| Flag to indicate when to split values between update and self reflect. | |
| 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. | |
| bool | myUpdateRequiredAttributes |
| RTI::AttributeHandleSet * | mySelfReflectSplitAttrs |
| When self reflecting, these attributes are the differences between eligible needed and eligible subscribed. | |
| RTI::AttributeHandleSet * | myEligibleNeeded |
| Eligible attributes that are needed remotely. | |
| RTI::AttributeHandleSet * | myEligibleSubscribed |
| Eligible attributes that are subscribed locally. | |
| RTI::AttributeHandleSet * | myScratchAttributes |
| Scratch set to use temporarily saves temporary allocation. | |
| DtOwnershipHandler * | myOwnershipHandler |
Additional Inherited Members | |
Protected Types inherited from DtHlaObject | |
| enum | SplitUpdateDiscriminant { UpdateBothLocalAndRemote, UpdateRemoteOnly, UpdateLocalOnly, UpdateSplit } |
| When remotely needed and locally subscribed are the same, split is not necessary. More... | |
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. | |
class DtHlaObjectWithStateRep:
Instances of DtHlaObjectWithStateRep are used to represent an HLA object via a state representation.
| 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 |
destructor
|
protected |
copy constructor - not implemented.
|
inlinevirtual |
Returns asSeenByRemote.
References myAsSeenByRemote.
|
virtual |
Recomputes the set of attrs that are eligible for sending.
Called any time we lose or gain ownership of attributes, when we get update on/off advisories, and when local subscription changes.
Reimplemented from DtHlaObject.
|
inlinestatic |
Creator function for this class.
References DtHlaObjectWithStateRep().
|
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.
|
protected |
assignment operator - not implemented.
|
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 |
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 |
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 |
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.
|
inlinevirtual |
Returns current state repository used for updating.
References myStateRepForUpdating.
|
virtual |
Remove a decoder/stateRep pair to use for decoding.
|
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 |
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.
|
protected |
Referenced by asSeenByRemote().
|
protected |
List of decoder/stateRep pairs.
It is a list of pointers to DtHlaObjectView. They are used for decoding.
|
protected |
These are all used for encoding only.
|
protected |
|
protected |
Referenced by stateRepForUpdating().