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

Instances of DtObjectPublisher are used for local or source simulations of objects, (i.e. More...

+ Inheritance diagram for DtObjectPublisher:
+ Collaboration diagram for DtObjectPublisher:

List of all members.

Public Member Functions

 DtObjectPublisher (DtExerciseConn *conn, DtStateRepository *stateRep, DtStateRepository *asSeenByRemote, bool okToDeleteStateRep=true, const DtDDMRegionSet *regionSet=0)
 Constructor.
virtual ~DtObjectPublisher ()
 Destructor.
virtual void setHlaObject (const char *className, DtHlaStateEncoder *encoder=0, DtHlaStateDecoder *decoder=0, const char *objectName=0, const DtDDMRegionSet *regionSet=0)
 A DtObjectPublisher is not capable of communicating data through the RTI until setHlaObject is called.
virtual void setHlaObject (RTI::ObjectClassHandle hand, DtHlaStateEncoder *encoder=0, DtHlaStateDecoder *decoder=0, const char *objectName=0, const DtDDMRegionSet *regionSet=0)
 This version takes a classHandle and optional object name, and creates the DtHlaObject for you.
virtual void setHlaObject (DtHlaObjectWithStateRep *obj, DtHlaStateEncoder *encoder=0, DtHlaStateDecoder *decoder=0)
 This version takes an existing DtHlaObject, and uses it.
virtual void detachHlaObject ()
 Detach HLA object - bringing the DtObjectPublisher back to the state it was in before setHlaObject was called.
virtual DtStateRepositorystateRep ()
 Returns a pointer to the DtStateRepository - through which you can set or inspect current state information.
virtual DtStateRepositorysr ()
 Synonym for stateRep().
virtual DtStateRepositoryapproximateRemoteStateRep ()
 Returns a pointer to the approximate remote DtStateRepository -- This state repository contains the contents of the last sent message.
virtual DtHlaStateDecoderdecoder ()
 Returns a pointer to the Decoder being used to decode state messages that we send back into the asSeenByRemote SR.
virtual DtHlaStateEncoderencoder ()
 Returns a pointer to the Encoder being used to encode current state into an outgoing message.
virtual DtHlaObjectWithStateRephlaObject ()
 Get the object's hlaObject.
virtual DtExerciseConnexerciseConn ()
 Get our exercise connection.
virtual const DtObjectIdid () const
 Get the object's local identifier.
virtual const DtObjectIdobjectId () const
 Get the object's local identifier.
virtual const DtObjectIdlocalId () const
 Get the object's local identifier.
virtual const DtStringname () const
 Get the object's name.
virtual const
DtGlobalObjectDesignator
globalId () const
 Get the HLA object's global object designator - the object name in RTI1.3.3, but the objectId in RTI1.0.3.
virtual void forceUpdate ()
 Specify a set of attributes that should be included in the ahvps the next time tick is called, even if they would not otherwise need to be sent.
virtual void forceUpdate (const RTI::AttributeHandleSet &set)
virtual void tick ()
 Tick (update) this object.
virtual void setDeleteObjInDtorFlag (bool onOff)
 Set/Get a flag that determines whether to try to delete the HLA object that we represent, upon destruction of this DtObjectPublisher.
virtual bool deleteObjInDtorFlag () const
virtual const DtDDMRegionSetpublishingRegions () const
virtual void addRegion (DtDDMRegionSP regionToAdd)
 Adds the specified region to the set of publishing regions, and calls associateRegionForUpdates on the RTI Ambassador.
virtual void removeRegion (DtDDMRegionSP regionToRemove)
 Removes the specified region from the set of publishing regions, and calls unassociateRegionForUpdates on the RTI Ambassador.
 DtObjectPublisher (DtExerciseConn *conn, const char *name=0)
 These constructors and init functions are obsolete, but are here for backwards compatibility with pre-3.4 releases.
void init (RTI::ObjectClassHandle hand, DtStateRepository *stateRep, DtStateRepository *asSeenByRemote, DtHlaStateEncoder *encoder=0, DtHlaStateDecoder *decoder=0)
void init (const char *className, DtStateRepository *stateRep, DtStateRepository *asSeenByRemote, DtHlaStateEncoder *encoder=0, DtHlaStateDecoder *decoder=0)

Static Public Member Functions

static void removeObjectCb (DtHlaObject *obj, void *pub)
 Callback to be called when our underlying DtHlaObject goes away.

Protected Member Functions

virtual void processRemoveObject (DtHlaObject *obj)
 Called by removeObjectCb to detachHlaObject when our underlying DtHlaObject goes away.

Protected Attributes

DtExerciseConnmyExConn
DtHlaObjectWithStateRepmyHlaObj
DtStateRepositorymyStateRep
DtStateRepositorymyAsSeenByRemote
DtHlaStateEncodermyEncoder
DtHlaStateDecodermyDecoder
DtObjectId myObjectId
bool myOkToDeleteStateRepFlag
DtString myName
bool myDeleteObjInDtorFlag
DtDDMRegionSet myPublishingRegions

Private Member Functions

 DtObjectPublisher (const DtObjectPublisher &orig)
 copy constructor -- not implemented
DtObjectPublisheroperator= (const DtObjectPublisher &orig)
 assignment operator -- not implemented

Detailed Description

Instances of DtObjectPublisher are used for local or source simulations of objects, (i.e.

these objects are not dependent on data being produced elsewhere on the network for their existence). These object send data to the network.


Constructor & Destructor Documentation

DtObjectPublisher::DtObjectPublisher ( DtExerciseConn conn,
DtStateRepository stateRep,
DtStateRepository asSeenByRemote,
bool  okToDeleteStateRep = true,
const DtDDMRegionSet regionSet = 0 
)

Constructor.

Object is not fully constructed until setHlaObject is called - typically by subclass constructor.

Destructor.

If we own the privilege to delete, and the deleteObjInDtor flag is true, this will cause the HLA object we are publishing to be deleted.

copy constructor -- not implemented

DtObjectPublisher::DtObjectPublisher ( DtExerciseConn conn,
const char *  name = 0 
)

These constructors and init functions are obsolete, but are here for backwards compatibility with pre-3.4 releases.

Please use the constructor and setHlaObject functions described at the top of this class definition instead.


Member Function Documentation

virtual void DtObjectPublisher::addRegion ( DtDDMRegionSP  regionToAdd) [virtual]

Adds the specified region to the set of publishing regions, and calls associateRegionForUpdates on the RTI Ambassador.

Returns a pointer to the approximate remote DtStateRepository -- This state repository contains the contents of the last sent message.

VR-Link keeps this SR so it can ensure that object updates get sent only when their data have changed.

References myAsSeenByRemote.

Returns a pointer to the Decoder being used to decode state messages that we send back into the asSeenByRemote SR.

virtual bool DtObjectPublisher::deleteObjInDtorFlag ( ) const [virtual]
virtual void DtObjectPublisher::detachHlaObject ( ) [virtual]

Detach HLA object - bringing the DtObjectPublisher back to the state it was in before setHlaObject was called.

Typically called only by destructor.

Returns a pointer to the Encoder being used to encode current state into an outgoing message.

Get our exercise connection.

References myExConn.

virtual void DtObjectPublisher::forceUpdate ( ) [virtual]

Specify a set of attributes that should be included in the ahvps the next time tick 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 attributes. Multiple calls are cumulative, until the set is cleared with clearForcedAttributes, which should happen within tick.

Reimplemented in DtEmitterSystemPublisher.

virtual void DtObjectPublisher::forceUpdate ( const RTI::AttributeHandleSet &  set) [virtual]

Reimplemented in DtEmitterSystemPublisher.

virtual const DtGlobalObjectDesignator& DtObjectPublisher::globalId ( ) const [virtual]

Get the HLA object's global object designator - the object name in RTI1.3.3, but the objectId in RTI1.0.3.

Get the object's hlaObject.

References myHlaObj.

virtual const DtObjectId& DtObjectPublisher::id ( ) const [virtual]

Get the object's local identifier.

Referenced by localId().

void DtObjectPublisher::init ( RTI::ObjectClassHandle  hand,
DtStateRepository stateRep,
DtStateRepository asSeenByRemote,
DtHlaStateEncoder encoder = 0,
DtHlaStateDecoder decoder = 0 
)
void DtObjectPublisher::init ( const char *  className,
DtStateRepository stateRep,
DtStateRepository asSeenByRemote,
DtHlaStateEncoder encoder = 0,
DtHlaStateDecoder decoder = 0 
)
const DtObjectId & DtObjectPublisher::localId ( ) const [inline, virtual]

Get the object's local identifier.

References id().

virtual const DtString& DtObjectPublisher::name ( ) const [virtual]

Get the object's name.

virtual const DtObjectId& DtObjectPublisher::objectId ( ) const [virtual]

Get the object's local identifier.

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

assignment operator -- not implemented

virtual void DtObjectPublisher::processRemoveObject ( DtHlaObject obj) [protected, virtual]

Called by removeObjectCb to detachHlaObject when our underlying DtHlaObject goes away.

virtual const DtDDMRegionSet& DtObjectPublisher::publishingRegions ( ) const [virtual]
static void DtObjectPublisher::removeObjectCb ( DtHlaObject obj,
void *  pub 
) [static]

Callback to be called when our underlying DtHlaObject goes away.

virtual void DtObjectPublisher::removeRegion ( DtDDMRegionSP  regionToRemove) [virtual]

Removes the specified region from the set of publishing regions, and calls unassociateRegionForUpdates on the RTI Ambassador.

Must be the same shared pointer that was in the set passed in through the constructor, or the same shared pointer as that passed into addRegion().

virtual void DtObjectPublisher::setDeleteObjInDtorFlag ( bool  onOff) [virtual]

Set/Get a flag that determines whether to try to delete the HLA object that we represent, upon destruction of this DtObjectPublisher.

Default is true.

virtual void DtObjectPublisher::setHlaObject ( const char *  className,
DtHlaStateEncoder encoder = 0,
DtHlaStateDecoder decoder = 0,
const char *  objectName = 0,
const DtDDMRegionSet regionSet = 0 
) [virtual]

A DtObjectPublisher is not capable of communicating data through the RTI until setHlaObject is called.

It is typically called by subclass constructors. If encoder or decoder are 0, the FOM Mapper is consulted. This class assumes ownership of the encoder/decoder objects passed to setHlaObject, and will delete them on destruction, or if this function fails. If objectName is 0, a name is obtained from the RTI. This version takes a className and optional object name, and creates the DtHlaObject.

virtual void DtObjectPublisher::setHlaObject ( RTI::ObjectClassHandle  hand,
DtHlaStateEncoder encoder = 0,
DtHlaStateDecoder decoder = 0,
const char *  objectName = 0,
const DtDDMRegionSet regionSet = 0 
) [virtual]

This version takes a classHandle and optional object name, and creates the DtHlaObject for you.

virtual void DtObjectPublisher::setHlaObject ( DtHlaObjectWithStateRep obj,
DtHlaStateEncoder encoder = 0,
DtHlaStateDecoder decoder = 0 
) [virtual]

This version takes an existing DtHlaObject, and uses it.

Called by the other versions of setHlaObject.

DtStateRepository * DtObjectPublisher::sr ( ) [inline, virtual]

Synonym for stateRep().

References myStateRep.

Returns a pointer to the DtStateRepository - through which you can set or inspect current state information.

References myStateRep.

virtual void DtObjectPublisher::tick ( ) [virtual]

Tick (update) this object.

Reimplemented in DtEntityPublisher, DtAggregatePublisher, and DtEmitterSystemPublisher.


Member Data Documentation

Referenced by exerciseConn().

Referenced by hlaObject().


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)