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

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.

virtual DtObjectPublisher::~DtObjectPublisher ( )
virtual

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.

DtObjectPublisher::DtObjectPublisher ( const DtObjectPublisher orig)
private

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.

DtStateRepository * DtObjectPublisher::approximateRemoteStateRep ( )
inlinevirtual

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.

virtual DtHlaStateDecoder* DtObjectPublisher::decoder ( )
virtual

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.

virtual DtHlaStateEncoder* DtObjectPublisher::encoder ( )
virtual

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

DtExerciseConn * DtObjectPublisher::exerciseConn ( )
inlinevirtual

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, DtActiveSonarPublisher, and DtUnderwaterAcousticsPublisher.

virtual void DtObjectPublisher::forceUpdate ( const RTI::AttributeHandleSet &  set)
virtual
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.

DtHlaObjectWithStateRep * DtObjectPublisher::hlaObject ( )
inlinevirtual

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
inlinevirtual

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)
protectedvirtual

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 ( )
inlinevirtual

Synonym for stateRep().

References myStateRep.

DtStateRepository * DtObjectPublisher::stateRep ( )
inlinevirtual

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

References myStateRep.

virtual void DtObjectPublisher::tick ( )
virtual

Member Data Documentation

DtStateRepository* DtObjectPublisher::myAsSeenByRemote
protected
DtHlaStateDecoder* DtObjectPublisher::myDecoder
protected
bool DtObjectPublisher::myDeleteObjInDtorFlag
protected
DtHlaStateEncoder* DtObjectPublisher::myEncoder
protected
DtExerciseConn* DtObjectPublisher::myExConn
protected

Referenced by exerciseConn().

DtHlaObjectWithStateRep* DtObjectPublisher::myHlaObj
protected

Referenced by hlaObject().

DtString DtObjectPublisher::myName
protected
DtObjectId DtObjectPublisher::myObjectId
protected
bool DtObjectPublisher::myOkToDeleteStateRepFlag
protected
DtDDMRegionSet DtObjectPublisher::myPublishingRegions
protected
DtStateRepository* DtObjectPublisher::myStateRep
protected

Referenced by DtActiveSonarBeamPublisher::activeSonarBeamStateRep(), DtActiveSonarPublisher::activeSonarStateRep(), DtAdditionalPassiveActivitiesPublisher::additionalPassiveActivitiesStateRep(), DtAggregatePublisher::aggregateStateRep(), DtArealObjectPublisher::aosr(), DtArealObjectPublisher::arealObjectStateRep(), DtActiveSonarPublisher::asr(), DtActiveSonarBeamPublisher::asr(), DtAdditionalPassiveActivitiesPublisher::asr(), DtAggregatePublisher::asr(), DtEmitterBeamPublisher::bsr(), DtDesignatorPublisher::designatorStateRep(), DtDIGuyObjectPublisher::dIGuyObjectStateRep(), DtDesignatorPublisher::dsr(), DtDIGuyObjectPublisher::dsr(), DtEmitterBeamPublisher::emitrBeamRep(), DtEmitterSystemPublisher::emitterSystemRep(), DtEntityPublisher::entityStateRep(), DtEnvironmentProcessPublisher::environmentProcessStateRep(), DtEnvironmentProcessPublisher::epsr(), DtEmitterSystemPublisher::esr(), DtEntityPublisher::esr(), DtGriddedDataPublisher::gdsr(), DtGriddedDataPublisher::gridDataStateRep(), DtIffPublisher::iffStateRep(), DtIffPublisher::isr(), DtLinearObjectPublisher::linearObjectStateRep(), DtLinearObjectPublisher::losr(), DtPointObjectPublisher::pointObjectStateRep(), DtPointObjectPublisher::posr(), DtPropulsionNoisePublisher::propulsionNoiseStateRep(), DtPropulsionNoisePublisher::psr(), DtRadioTransmitterPublisher::radioXmitRep(), DtRadioReceiverPublisher::receiverRep(), DtRadioReceiverPublisher::rsr(), sr(), stateRep(), DtRadioTransmitterPublisher::tsr(), DtUnderwaterAcousticsPublisher::underwaterAcousticsStateRep(), and DtUnderwaterAcousticsPublisher::usr().


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

Document ID: Generated on Wed Jan 7 13:31:29 EST 2015 from SVN revision 149162
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)