VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends
DtHlaObject Class Referenceabstract

Instances of DtHlaObject are used to represent HLA objects which are communicated across the network. More...

+ Inheritance diagram for DtHlaObject:
+ Collaboration diagram for DtHlaObject:

Public Member Functions

 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. More...
 
 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. More...
 
virtual ~DtHlaObject ()
 Destructor. More...
 
virtual const RTI::ObjectHandle & objectId () const
 Get the object's handle. More...
 
virtual const
RTI::AttributeHandleSet & 
attrHandleSet ()
 Get the set of attributes associated with this object's FOM class. More...
 
virtual const
RTI::AttributeHandleSet & 
requestedAttributes ()
 Returns the union of all sets of attributes requested since the last call to clearRequestedAttributes. More...
 
virtual RTI::ObjectClassHandle objectClassHandle () const
 Get the object's class handle. More...
 
virtual const char * name () const
 Get the object's name. More...
 
int numAttributes () const
 Get the number of attributes associated with this object's FOM class. More...
 
virtual DtExerciseConnexerciseConn () const
 Get the exercise connection for this object. More...
 
virtual DtObjClassDescclassDesc () const
 Get the class descriptor for the object's class. More...
 
virtual void setupUpdating ()
 Local Object specific functions. More...
 
virtual void update ()
 Generate and send any necessary attribute updates through the RTI. More...
 
virtual void generateUpdate (const RTI::AttributeHandleSet &eligibileAttrs, const RTI::AttributeHandleSet &requiredAttrs, DtStateMsg *msg)
 Called by update to actually generate an outgoing message. More...
 
virtual void cleanupFromUpdating ()
 Do the deinitialization required to stop updating attributes of this object. More...
 
virtual void processProvideUpdate (const RTI::AttributeHandleSet &set)
 Set yourself up so that on the next tick, you send an update for the appropriate attributes. More...
 
virtual void clearRequestedAttributes ()
 Clears the set of requested attributes. More...
 
virtual const
RTI::AttributeHandleSet & 
ownedAttributes ()
 Returns the set of attributes of this object that are owned by the local federate. More...
 
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. More...
 
virtual void forceUpdate (const RTI::AttributeHandleSet &set)
 
virtual void clearForcedAttributes ()
 Clear (empty) the set of forced attributes. More...
 
virtual const
RTI::AttributeHandleSet & 
attributesNeededByFederation ()
 Returns the set of attributes that are currently needed by the federation, i.e. More...
 
virtual const
RTI::AttributeHandleSet & 
eligibleAttributes ()
 Returns the set of attributes that eligible for sending. More...
 
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. More...
 
bool classNeededByFederation ()
 Returns true if the class is needed by the federation, i.e. More...
 
void setupClassForUpdating ()
 If the class has never been published, publish it with all attributes using DtObjClassDesc::publish. More...
 
virtual void setupReflecting ()
 Remote Object specific functions. More...
 
virtual void callReflect (const DtStateMsg &msg)
 Calls reflect, and any postReflect callbacks. More...
 
virtual void callReflectLocal (const DtStateMsg &msg)
 Calls reflectLocal, and any postReflect callbacks. More...
 
virtual void reflectLocal (const DtStateMsg &msg)=0
 Called by callReflectLocal to handle the reflection of updates that we are sending locally. More...
 
virtual void cleanupFromReflecting ()
 Do the deinitialization required to stop handling reflection of object. More...
 
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). More...
 
virtual void addRemoveObjectCb (DtRemoveObjectCb cb, void *usr)
 Add (register) function to be called when object is about to be removed. More...
 
virtual void removeRemoveObjectCb (DtRemoveObjectCb cb, void *usr)
 Remove (deregister) function to be called when object is about to be removed. More...
 
virtual void addPostReflectCb (DtObjectReflectAttributeValuesCb cb, void *usr)
 Add (register) function to be called after each reflectAttrValues. More...
 
virtual void removePostReflectCb (DtObjectReflectAttributeValuesCb cb, void *usr)
 Remove (deregister) function to be called after each reflectAttrValues. More...
 
virtual void processRemoveObject ()
 Process notification of removal of the object from the network. More...
 
virtual DtOwnershipHandlersetOwnershipHandler (DtOwnershipHandler *handler)
 Ownership-Management-related functions. More...
 
virtual void unconditionalDivest (const RTI::AttributeHandleSet &attrs)
 Unconditionally divest ownership of attrs. More...
 
virtual void negotiatedDivest (const RTI::AttributeHandleSet &attrs)
 Try to divest ownership of attrs. More...
 
virtual void divestAttributes (const RTI::AttributeHandleSet &attrs, bool ifAvailable=false)
 Try to divest ownership of attrs. More...
 
virtual void divestObject (bool ifAvailable=false)
 Try to divest ownership of all attrs. More...
 
virtual void cancelNegotiatedDivest (const RTI::AttributeHandleSet &attrs)
 Cancel a negotiated divestiture of attributes. More...
 
virtual void acquireAttributes (const RTI::AttributeHandleSet &attrs, bool ifAvailable=false)
 Attempt to acquire ownership of attributes. More...
 
virtual void acquireObject (bool ifAvailable=false)
 Attempt to acquire ownership of all attributes for an object. More...
 
virtual void cancelAcquireAttributes (const RTI::AttributeHandleSet &attrs)
 Cancel the request to acquire ownership of attrs. More...
 
virtual DtTime lastSimTimeUpdateReceived () const
 Returns the value of VR-Link simulation time at the time the last attribute update was received for this object. More...
 
virtual DtTime lastReceivedTimeStamp () const
 
virtual void setLastSimTimeUpdateReceived (DtTime tm)
 Set the time an update was last received or sent. More...
 
virtual void setLastReceivedTimeStamp (DtTime tm)
 
virtual void printMsg (const DtStateMsg &msg, bool fullReport=false) const
 Prints contents of a state msg. More...
 
virtual void localSubscriptionChanged ()
 Called when local object class subscriptions change. More...
 
virtual void publicationChanged ()
 Called when there is a change in the publication status of this object's object class. More...
 
virtual void processRequestAssumption (const RTI::AttributeHandleSet &attrs, const char *tag)
 Process RTI's requestAttributeOwnershipAssumption service. More...
 
virtual void processRequestRelease (const RTI::AttributeHandleSet &attrs, const char *tag)
 Process RTI's requestAttributeOwnershipRelease service. More...
 
virtual void processAttributeAcquisition (const RTI::AttributeHandleSet &attrs)
 Handle an invocation of the attributeOwnershipAcquisitionNotification service. More...
 
virtual void processAttributeDivestiture (const RTI::AttributeHandleSet &attrs)
 Handle an invocation of the attributeOwnershipDivestitureNotification service. More...
 
virtual void processConfirmAcquisitionCancellation (const RTI::AttributeHandleSet &attrs)
 Process RTI's conformAttributeOwnershipAcquisitionCancellation service. More...
 

Static Public Member Functions

static void ownerAcquisitionIfAvailableCb (void *usr)
 The following four static fns are for use within ownership msg callbacks. More...
 
static void ownerAcquisitionCb (void *usr)
 
static void negotiatedDivestitureCb (void *usr)
 
static void unconditionalDivestitureCb (void *usr)
 

Protected Types

enum  SplitUpdateDiscriminant { UpdateBothLocalAndRemote, UpdateRemoteOnly, UpdateLocalOnly, UpdateSplit }
 When remotely needed and locally subscribed are the same, split is not necessary. More...
 

Protected Member Functions

 DtHlaObject ()
 Default constructor: not implemented; do not call. More...
 
 DtHlaObject (const DtHlaObject &src)
 Copy constructor: not implemented; do not call. More...
 
DtHlaObjectoperator= (const DtHlaObject &src)
 Assignment operator: not implemented; do not call. More...
 
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. More...
 
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. More...
 
virtual void clearUpdatedAttributes (const RTI::AttributeHandleValuePairSet &sourceList)
 Remove the attributes present in the given value set from the requested and forced handle sets. More...
 
virtual void reflect (const DtStateMsg &msg)=0
 Handle reflection of object (receipt of state message) from the network. More...
 
void wipeRemoveList ()
 Remove all callbacks from the remove callback list. More...
 
virtual void clearRemoveList ()
 Virtual version of above. More...
 
void wipeReflectList ()
 Remove all callbacks from the reflect callback list. More...
 
virtual void applyPostReflectCallbacks (const DtStateMsg &msg)
 Apply callbacks after a state msg is reflected. More...
 
virtual void loseOwnership (const RTI::AttributeHandleSet &attrs)
 Gets called whenever we lose ownership of a set of attributes. More...
 
virtual void gainOwnership (const RTI::AttributeHandleSet &attrs, bool notifyOwnershipManagement=true)
 Gets called whenever we gain ownership of a set of attributes. More...
 
virtual void processUpdatesOff (const RTI::AttributeHandleSet &set)
 Callback for handling turnUpdatesOffForObjectInstance RTI call. More...
 
void processUpdatesOn (const RTI::AttributeHandleSet &set)
 Callback for handling turnUpdatesOnForObjectInstance RTI call. More...
 
virtual bool known () const
 Returns true if the object has been registered with, or discovered via the RTI. More...
 
virtual void dumpRtiException (const char *functionName, const RTI::Exception *exc) const
 Print message to explain the RTI Exception. More...
 
virtual void computeEligible ()
 Recomputes the set of attrs that are eligible for sending. More...
 
virtual void justRegistered ()
 Called by DtHlaObjectManager right after a DtHlaObject is created, if it was created to represent a newly registered object. More...
 
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. More...
 

Static Protected Member Functions

static void reflectAttributeValuesCb (const DtStateMsg &stateMsg, void *hlaObj)
 Callback for handling state messages for the HLA object. More...
 
static void updatesOnCb (RTI::ObjectHandle handle, const RTI::AttributeHandleSet &attributeSet, void *usr)
 Callback for handling turnUpdatesOnForObjectInstance RTI call. More...
 
static void updatesOffCb (RTI::ObjectHandle handle, const RTI::AttributeHandleSet &attributeSet, void *usr)
 Callback for handling turnUpdatesOffForObjectInstance RTI call. More...
 

Protected Attributes

char * myName
 
DtExerciseConnmyExConn
 
bool myReflecting
 
bool myUpdating
 
DtList myRemoveCbList
 
DtList myReflectCbList
 
DtListItemmyRemoveCbListNextPtr
 
DtListItemmyReflectCbListNextPtr
 
DtTime myLastSimTimeUpdateReceived
 
DtTime myLastReceivedTimeStamp
 
DtObjClassDescmyClassDesc
 
SplitUpdateDiscriminant mySplitUpdate
 Flag to indicate when to split values between update and self reflect. More...
 
RTI::ObjectHandle myObjectId
 
RTI::AttributeHandleSet * myEligibleAttrs
 Attributes that are eligible to be sent from within update() - passed to generateUpdate. More...
 
RTI::AttributeHandleSet * myNeededAttrs
 Set of owned attributes for which we have received a turnUpdatesOn more recently than a turnUpdatesOff. More...
 
RTI::AttributeHandleSet * myOwnedAttributes
 Set of attributes owned by the local federate. More...
 
RTI::AttributeHandleSet * myRequestedAttributes
 Requested by other federates. More...
 
RTI::AttributeHandleSet * myForcedAttributes
 Requested by a call to setForcedUpdate. More...
 
RTI::AttributeHandleSet * myRequiredAttributes
 Union of forced and requested - not computed until needed. More...
 
bool myUpdateRequiredAttributes
 
RTI::AttributeHandleSet * mySelfReflectSplitAttrs
 When self reflecting, these attributes are the differences between eligible needed and eligible subscribed. More...
 
RTI::AttributeHandleSet * myEligibleNeeded
 Eligible attributes that are needed remotely. More...
 
RTI::AttributeHandleSet * myEligibleSubscribed
 Eligible attributes that are subscribed locally. More...
 
RTI::AttributeHandleSet * myScratchAttributes
 Scratch set to use temporarily saves temporary allocation. More...
 
DtOwnershipHandlermyOwnershipHandler
 

Friends

class DtHlaObjectManager
 

Detailed Description

Instances of DtHlaObject are used to represent HLA objects which are communicated across the network.

There should be one DtHlaObject instance for each "known" object in the federation execution. To enforce this restriction, only the DtHlaObjectManager can create DtHlaObjects. DtHlaObject keeps track of which attributes are locally owned. It also defines the interface for the virtual functions reflect, and generateUpdate which are using when receiving or sending updates through the RTI respectively. DtHlaObject is used by DtObjectPublisher and DtReflectedObject, so many applications will not need to deal directly with DtHlaObjects.

Member Enumeration Documentation

When remotely needed and locally subscribed are the same, split is not necessary.

Enumerator
UpdateBothLocalAndRemote 
UpdateRemoteOnly 
UpdateLocalOnly 
UpdateSplit 

Constructor & Destructor Documentation

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.

The RTI provides us with the handle, name and class. Object is not ready to use until setupReflecting is called.

DtHlaObject::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.

We provide a name and class, and the RTI chooses a handle after the register call. Object is not ready to use until setupUpdating is called.

virtual DtHlaObject::~DtHlaObject ( )
virtual

Destructor.

Make sure to call cleanupFromUpdating and/or cleanupFromReflecting before deleting the object.

DtHlaObject::DtHlaObject ( )
protected

Default constructor: not implemented; do not call.

DtHlaObject::DtHlaObject ( const DtHlaObject src)
protected

Copy constructor: not implemented; do not call.

Member Function Documentation

virtual void DtHlaObject::acquireAttributes ( const RTI::AttributeHandleSet &  attrs,
bool  ifAvailable = false 
)
virtual

Attempt to acquire ownership of attributes.

If ifAvailable is true, use the RTI's "IfAvailable" version of attributeOwnershipAcquisition. You have not actually gained ownership of the attributes until you receive an attributeOwnershipAcquisitionNotification callback from the RTI. Caller needs to handle RTI-generated exceptions.

virtual void DtHlaObject::acquireObject ( bool  ifAvailable = false)
virtual

Attempt to acquire ownership of all attributes for an object.

If ifAvailable is true, use the RTI's "IfAvailable" version of attributeOwnershipAcquisition. You have not actually gained ownership of the attributes until you receive an attributeOwnershipAcquisitionNotification callback from the RTI. Caller needs to handle RTI-generated exceptions.

virtual void DtHlaObject::addHandlesToSet ( RTI::AttributeHandleSet &  destinationSet,
const RTI::AttributeHandleSet &  sourceSet 
)
protectedvirtual

Add source attribute set to destination checking each handle for membership first Depracated - use DtFom::setInsert.

virtual void DtHlaObject::addPostReflectCb ( DtObjectReflectAttributeValuesCb  cb,
void *  usr 
)
virtual

Add (register) function to be called after each reflectAttrValues.

virtual void DtHlaObject::addRemoveObjectCb ( DtRemoveObjectCb  cb,
void *  usr 
)
virtual

Add (register) function to be called when object is about to be removed.

virtual void DtHlaObject::applyPostReflectCallbacks ( const DtStateMsg msg)
protectedvirtual

Apply callbacks after a state msg is reflected.

const RTI::AttributeHandleSet & DtHlaObject::attrHandleSet ( )
inlinevirtual

Get the set of attributes associated with this object's FOM class.

References DtObjClassDesc::attrHandleSet(), and myClassDesc.

virtual const RTI::AttributeHandleSet& DtHlaObject::attributesNeededByFederation ( )
virtual

Returns the set of attributes that are currently needed by the federation, i.e.

those that have been specified in startUpdates calls more recently than in stopUpdates calls. This set may contain attributes that are not locally owned.

virtual void DtHlaObject::callReflect ( const DtStateMsg msg)
virtual

Calls reflect, and any postReflect callbacks.

Override reflect rather than this function to change the way an HLA object reflects a stateMsg. This function is called when we receive an update from the RTI.

virtual void DtHlaObject::callReflectLocal ( const DtStateMsg msg)
virtual

Calls reflectLocal, and any postReflect callbacks.

Override reflectLocal rather than this function to change the way an HLA object reflects a stateMsg that we generate locally. This function is called from within update() when the exercise connection's reflecting flag is set.

virtual void DtHlaObject::cancelAcquireAttributes ( const RTI::AttributeHandleSet &  attrs)
virtual

Cancel the request to acquire ownership of attrs.

If the cancel goes through, you will receive a confirmAttributeOwnershipAcquisitionCancellation RTI callback. Caller must handle RTI-generated exceptions.

virtual void DtHlaObject::cancelNegotiatedDivest ( const RTI::AttributeHandleSet &  attrs)
virtual

Cancel a negotiated divestiture of attributes.

Caller needs to handle RTI-generated exceptions.

DtObjClassDesc & DtHlaObject::classDesc ( ) const
inlinevirtual

Get the class descriptor for the object's class.

References myClassDesc.

bool DtHlaObject::classNeededByFederation ( )

Returns true if the class is needed by the federation, i.e.

we've received a startRegistration or startUpdates service call from the RTI for the object's class.

virtual void DtHlaObject::cleanupFromReflecting ( )
virtual

Do the deinitialization required to stop handling reflection of object.

Call before deleting a DtHlaObject.

virtual void DtHlaObject::cleanupFromUpdating ( )
virtual

Do the deinitialization required to stop updating attributes of this object.

virtual void DtHlaObject::clearForcedAttributes ( )
virtual

Clear (empty) the set of forced attributes.

virtual void DtHlaObject::clearRemoveList ( )
protectedvirtual

Virtual version of above.

virtual void DtHlaObject::clearRequestedAttributes ( )
virtual

Clears the set of requested attributes.

Should be called after request has been serviced.

virtual void DtHlaObject::clearUpdatedAttributes ( const RTI::AttributeHandleValuePairSet &  sourceList)
protectedvirtual

Remove the attributes present in the given value set from the requested and forced handle sets.

virtual void DtHlaObject::computeEligible ( )
protectedvirtual

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 in DtHlaObjectWithStateRep.

virtual void DtHlaObject::copyToLocalAndRemote ( const RTI::AttributeHandleValuePairSet &  sourceList,
const RTI::AttributeHandleSet &  neededByRemote,
const RTI::AttributeHandleSet &  neededByLocal,
RTI::AttributeHandleValuePairSet &  toRemoteList,
RTI::AttributeHandleValuePairSet &  toLocalList 
)
protectedvirtual

Copy attribute values from source into remote and local lists.

virtual void DtHlaObject::divestAttributes ( const RTI::AttributeHandleSet &  attrs,
bool  ifAvailable = false 
)
virtual

Try to divest ownership of attrs.

if isAvailable is true Divesting is not complete (i.e. you still own the attributes) until you receive an attributeOwnershipDivestitureNotification callback from the RTI. Elements of attrs that are not currently owned are ignored. Caller needs to handle other RTI-generated exceptions.

virtual void DtHlaObject::divestObject ( bool  ifAvailable = false)
virtual

Try to divest ownership of all attrs.

if isAvailable is true Divesting is not complete (i.e. you still own the attributes) until you receive an attributeOwnershipDivestitureNotification callback from the RTI. Elements of attrs that are not currently owned are ignored. Caller needs to handle other RTI-generated exceptions.

virtual void DtHlaObject::dumpRtiException ( const char *  functionName,
const RTI::Exception *  exc 
) const
protectedvirtual

Print message to explain the RTI Exception.

Both functionName and the exception can be Null.

virtual const RTI::AttributeHandleSet& DtHlaObject::eligibleAttributes ( )
virtual

Returns the set of attributes that eligible for sending.

That is, the intersection of owned attributes and attributes needed by federation.

DtExerciseConn * DtHlaObject::exerciseConn ( ) const
inlinevirtual

Get the exercise connection for this object.

References myExConn.

virtual void DtHlaObject::forceUpdate ( )
virtual

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.

The call with no arguments, indicates the set of all of the object's published attributes. Multiple calls are cumulative, until the set is cleared with clearForcedAttributes, which should happen within update.

virtual void DtHlaObject::forceUpdate ( const RTI::AttributeHandleSet &  set)
virtual
virtual void DtHlaObject::gainOwnership ( const RTI::AttributeHandleSet &  attrs,
bool  notifyOwnershipManagement = true 
)
protectedvirtual

Gets called whenever we gain ownership of a set of attributes.

virtual void DtHlaObject::generateUpdate ( const RTI::AttributeHandleSet &  eligibileAttrs,
const RTI::AttributeHandleSet &  requiredAttrs,
DtStateMsg msg 
)
virtual

Called by update to actually generate an outgoing message.

Derived class implementations should keep track of which attributes are updated when, should check update conditions, and add values to stateMsg for only those attributes that currently need to be sent. 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. Default implementation is null, but the function is not pure virtual since some subclasses might want to override update rather than overriding generateUpdate.

Reimplemented in DtHlaObjectWithStateRep.

virtual bool DtHlaObject::handlesMatch ( const RTI::AttributeHandleValuePairSet &  handleValueSet,
const RTI::AttributeHandleSet &  handleSet 
) const
protectedvirtual

Check if the handles in the given handle-value set are in the given handle set.

virtual void DtHlaObject::justRegistered ( )
protectedvirtual

Called by DtHlaObjectManager right after a DtHlaObject is created, if it was created to represent a newly registered object.

Implementation gains ownership of all published attributes.

virtual bool DtHlaObject::known ( ) const
protectedvirtual

Returns true if the object has been registered with, or discovered via the RTI.

Should always return true once the DtHlaObject has been set up for receiving or updating.

DtTime DtHlaObject::lastReceivedTimeStamp ( ) const
inlinevirtual
DtTime DtHlaObject::lastSimTimeUpdateReceived ( ) const
inlinevirtual

Returns the value of VR-Link simulation time at the time the last attribute update was received for this object.

References myLastSimTimeUpdateReceived.

virtual void DtHlaObject::localSubscriptionChanged ( )
virtual

Called when local object class subscriptions change.

As a result, we update the set of eligible attributes to include remotely subscribed attributes, plus locally subscribed attributes.

virtual void DtHlaObject::loseOwnership ( const RTI::AttributeHandleSet &  attrs)
protectedvirtual

Gets called whenever we lose ownership of a set of attributes.

const char * DtHlaObject::name ( ) const
inlinevirtual

Get the object's name.

References myName.

virtual void DtHlaObject::negotiatedDivest ( const RTI::AttributeHandleSet &  attrs)
virtual

Try to divest ownership of attrs.

Divesting is not complete (i.e. you still own the attributes) until you receive an attributeOwnershipDivestitureNotification callback from the RTI. Elements of attrs that are not currently owned are ignored. Caller needs to handle other RTI-generated exceptions.

static void DtHlaObject::negotiatedDivestitureCb ( void *  usr)
static
int DtHlaObject::numAttributes ( ) const
inline

Get the number of attributes associated with this object's FOM class.

Non Virtual – called from Ctor

References myClassDesc, and DtObjClassDesc::numAttributes().

RTI::ObjectClassHandle DtHlaObject::objectClassHandle ( ) const
inlinevirtual

Get the object's class handle.

References DtObjClassDesc::handle(), and myClassDesc.

const RTI::ObjectHandle & DtHlaObject::objectId ( ) const
inlinevirtual

Get the object's handle.

DtHlaObject& DtHlaObject::operator= ( const DtHlaObject src)
protected

Assignment operator: not implemented; do not call.

const RTI::AttributeHandleSet & DtHlaObject::ownedAttributes ( )
inlinevirtual

Returns the set of attributes of this object that are owned by the local federate.

References myOwnedAttributes.

static void DtHlaObject::ownerAcquisitionCb ( void *  usr)
static
static void DtHlaObject::ownerAcquisitionIfAvailableCb ( void *  usr)
static

The following four static fns are for use within ownership msg callbacks.

virtual void DtHlaObject::printMsg ( const DtStateMsg msg,
bool  fullReport = false 
) 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 in DtHlaObjectWithStateRep.

virtual void DtHlaObject::processAttributeAcquisition ( const RTI::AttributeHandleSet &  attrs)
virtual

Handle an invocation of the attributeOwnershipAcquisitionNotification service.

virtual void DtHlaObject::processAttributeDivestiture ( const RTI::AttributeHandleSet &  attrs)
virtual

Handle an invocation of the attributeOwnershipDivestitureNotification service.

virtual void DtHlaObject::processConfirmAcquisitionCancellation ( const RTI::AttributeHandleSet &  attrs)
virtual

Process RTI's conformAttributeOwnershipAcquisitionCancellation service.

virtual void DtHlaObject::processProvideUpdate ( const RTI::AttributeHandleSet &  set)
virtual

Set yourself up so that on the next tick, you send an update for the appropriate attributes.

(Can't send them within this function since this is called from within an RTI service).

virtual void DtHlaObject::processRemoveObject ( )
virtual

Process notification of removal of the object from the network.

Call back all the remove object callbacks.

virtual void DtHlaObject::processRequestAssumption ( const RTI::AttributeHandleSet &  attrs,
const char *  tag 
)
virtual

Process RTI's requestAttributeOwnershipAssumption service.

virtual void DtHlaObject::processRequestRelease ( const RTI::AttributeHandleSet &  attrs,
const char *  tag 
)
virtual

Process RTI's requestAttributeOwnershipRelease service.

virtual void DtHlaObject::processUpdatesOff ( const RTI::AttributeHandleSet &  set)
protectedvirtual

Callback for handling turnUpdatesOffForObjectInstance RTI call.

void DtHlaObject::processUpdatesOn ( const RTI::AttributeHandleSet &  set)
protected

Callback for handling turnUpdatesOnForObjectInstance RTI call.

Non Virtual –called from CTOR

virtual void DtHlaObject::publicationChanged ( )
virtual

Called when there is a change in the publication status of this object's object class.

virtual void DtHlaObject::reflect ( const DtStateMsg msg)
protectedpure virtual

Handle reflection of object (receipt of state message) from the network.

called by callReflect. Override this function rather than callReflect to change the way an HLA object reflects a stateMsg.

Implemented in DtHlaObjectWithStateRep, and DtUnknownHlaObject.

static void DtHlaObject::reflectAttributeValuesCb ( const DtStateMsg stateMsg,
void *  hlaObj 
)
staticprotected

Callback for handling state messages for the HLA object.

Casts hlaObj to DtHlaObject* and calls reflect().

virtual void DtHlaObject::reflectLocal ( const DtStateMsg msg)
pure virtual

Called by callReflectLocal to handle the reflection of updates that we are sending locally.

Used when the exercise connection's reflecting flag is set.

Implemented in DtHlaObjectWithStateRep.

virtual void DtHlaObject::removePostReflectCb ( DtObjectReflectAttributeValuesCb  cb,
void *  usr 
)
virtual

Remove (deregister) function to be called after each reflectAttrValues.

virtual void DtHlaObject::removeRemoveObjectCb ( DtRemoveObjectCb  cb,
void *  usr 
)
virtual

Remove (deregister) function to be called when object is about to be removed.

const RTI::AttributeHandleSet & DtHlaObject::requestedAttributes ( )
inlinevirtual

Returns the union of all sets of attributes requested since the last call to clearRequestedAttributes.

References myRequestedAttributes.

virtual void DtHlaObject::requestUpdate ( RTI::AttributeHandleSet *  attrs = 0)
virtual

Request an update for the object for the set of attributes indicated by attrs (or all subscribed attributes if attrs is NULL).

virtual const RTI::AttributeHandleSet& DtHlaObject::requiredAttributes ( )
virtual

Returns the set of attributes that should be included in the next update regardless of whether their update conditions have been met.

void DtHlaObject::setLastReceivedTimeStamp ( DtTime  tm)
inlinevirtual
void DtHlaObject::setLastSimTimeUpdateReceived ( DtTime  tm)
inlinevirtual

Set the time an update was last received or sent.

References myLastSimTimeUpdateReceived.

virtual DtOwnershipHandler* DtHlaObject::setOwnershipHandler ( DtOwnershipHandler handler)
virtual

Ownership-Management-related functions.

Sets the current ownership handler to handler. A DtOwnershipHandler is an object that encapsulates callback function for a variety of ownership-management-related functions. Returns previous handler.

void DtHlaObject::setupClassForUpdating ( )

If the class has never been published, publish it with all attributes using DtObjClassDesc::publish.

Non Virtual – called from CTOR

virtual void DtHlaObject::setupReflecting ( )
virtual

Remote Object specific functions.

Do the initialization required to handle reflection of object.

virtual void DtHlaObject::setupUpdating ( )
virtual

Local Object specific functions.

Do the initialization required to begin updating attributes of this object. Calls registerObject() if the object has not yet been registered or discovered (that is, we are creating a new object).

virtual void DtHlaObject::unconditionalDivest ( const RTI::AttributeHandleSet &  attrs)
virtual

Unconditionally divest ownership of attrs.

Elements of attrs that are not currently owned are ignored. Caller needs to handle other RTI- generated exceptions.

static void DtHlaObject::unconditionalDivestitureCb ( void *  usr)
static
virtual void DtHlaObject::update ( )
virtual

Generate and send any necessary attribute updates through the RTI.

Called by publisher's tick function. Default implementation is to call the (logically) pure virtual generateUpdate, and then send the generated message.

Reimplemented in DtUnknownHlaObject.

static void DtHlaObject::updatesOffCb ( RTI::ObjectHandle  handle,
const RTI::AttributeHandleSet &  attributeSet,
void *  usr 
)
staticprotected

Callback for handling turnUpdatesOffForObjectInstance RTI call.

static void DtHlaObject::updatesOnCb ( RTI::ObjectHandle  handle,
const RTI::AttributeHandleSet &  attributeSet,
void *  usr 
)
staticprotected

Callback for handling turnUpdatesOnForObjectInstance RTI call.

void DtHlaObject::wipeReflectList ( )
protected

Remove all callbacks from the reflect callback list.

Non-virtual since meant to be called from dtor.

void DtHlaObject::wipeRemoveList ( )
protected

Remove all callbacks from the remove callback list.

Non-virtual since meant to be called from dtor.

Friends And Related Function Documentation

friend class DtHlaObjectManager
friend

Member Data Documentation

DtObjClassDesc& DtHlaObject::myClassDesc
protected
RTI::AttributeHandleSet* DtHlaObject::myEligibleAttrs
protected

Attributes that are eligible to be sent from within update() - passed to generateUpdate.

If we are reflecting local objects, then it's the union of needed attributes, locally subscribed attributes, and owned attributes. Otherwise, it's the union of owned attributes and needed attributes.

RTI::AttributeHandleSet* DtHlaObject::myEligibleNeeded
protected

Eligible attributes that are needed remotely.

RTI::AttributeHandleSet* DtHlaObject::myEligibleSubscribed
protected

Eligible attributes that are subscribed locally.

DtExerciseConn* DtHlaObject::myExConn
protected

Referenced by exerciseConn().

RTI::AttributeHandleSet* DtHlaObject::myForcedAttributes
protected

Requested by a call to setForcedUpdate.

DtTime DtHlaObject::myLastReceivedTimeStamp
protected
DtTime DtHlaObject::myLastSimTimeUpdateReceived
protected
char* DtHlaObject::myName
protected

Referenced by name().

RTI::AttributeHandleSet* DtHlaObject::myNeededAttrs
protected

Set of owned attributes for which we have received a turnUpdatesOn more recently than a turnUpdatesOff.

RTI::ObjectHandle DtHlaObject::myObjectId
protected
RTI::AttributeHandleSet* DtHlaObject::myOwnedAttributes
protected

Set of attributes owned by the local federate.

If we register the object, the owned set defaults to the published set.

Referenced by ownedAttributes().

DtOwnershipHandler* DtHlaObject::myOwnershipHandler
protected
DtList DtHlaObject::myReflectCbList
protected
DtListItem* DtHlaObject::myReflectCbListNextPtr
protected
bool DtHlaObject::myReflecting
protected
DtList DtHlaObject::myRemoveCbList
protected
DtListItem* DtHlaObject::myRemoveCbListNextPtr
protected
RTI::AttributeHandleSet* DtHlaObject::myRequestedAttributes
protected

Requested by other federates.

Referenced by requestedAttributes().

RTI::AttributeHandleSet* DtHlaObject::myRequiredAttributes
protected

Union of forced and requested - not computed until needed.

RTI::AttributeHandleSet* DtHlaObject::myScratchAttributes
protected

Scratch set to use temporarily saves temporary allocation.

RTI::AttributeHandleSet* DtHlaObject::mySelfReflectSplitAttrs
protected

When self reflecting, these attributes are the differences between eligible needed and eligible subscribed.

SplitUpdateDiscriminant DtHlaObject::mySplitUpdate
protected

Flag to indicate when to split values between update and self reflect.

bool DtHlaObject::myUpdateRequiredAttributes
protected
bool DtHlaObject::myUpdating
protected

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

Document ID: Generated on Tue Feb 2 21:02:17 EST 2021 from SVN revision 223668
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)