VR-Link API Documentation for HLA 4
 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 | Static 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. More...
 
virtual ~DtObjectPublisher ()
 Destructor. More...
 
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. More...
 
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. More...
 
virtual void setHlaObject (DtHlaObjectWithStateRep *obj, DtHlaStateEncoder *encoder=0, DtHlaStateDecoder *decoder=0)
 This version takes an existing DtHlaObject, and uses it. More...
 
virtual void detachHlaObject ()
 Detach HLA object - bringing the DtObjectPublisher back to the state it was in before setHlaObject was called. More...
 
virtual DtStateRepositorystateRep ()
 Returns a pointer to the DtStateRepository - through which you can set or inspect current state information. More...
 
virtual DtStateRepositorysr ()
 Synonym for stateRep(). More...
 
virtual DtStateRepositoryapproximateRemoteStateRep ()
 Returns a pointer to the approximate remote DtStateRepository – This state repository contains the contents of the last sent message. More...
 
virtual DtHlaStateDecoderdecoder ()
 Returns a pointer to the Decoder being used to decode state messages that we send back into the asSeenByRemote SR. More...
 
virtual DtHlaStateEncoderencoder ()
 Returns a pointer to the Encoder being used to encode current state into an outgoing message. More...
 
virtual DtHlaObjectWithStateRephlaObject ()
 Get the object's hlaObject. More...
 
virtual DtExerciseConnexerciseConn ()
 Get our exercise connection. More...
 
virtual const DtObjectIdid () const
 Get the object's local identifier. More...
 
virtual const DtObjectIdobjectId () const
 Get the object's local identifier. More...
 
virtual const DtObjectIdlocalId () const
 Get the object's local identifier. More...
 
virtual const DtStringname () const
 Get the object's name. More...
 
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. More...
 
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. More...
 
virtual void forceUpdate (const RTI::AttributeHandleSet &set)
 
virtual bool tick ()
 Tick (update) this object. More...
 
virtual bool parallelTick ()
 Tick (update) this object in parallel threads. More...
 
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. More...
 
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. More...
 
virtual void removeRegion (DtDDMRegionSP regionToRemove)
 Removes the specified region from the set of publishing regions, and calls unassociateRegionForUpdates on the RTI Ambassador. More...
 
virtual void setUpdateRateWarningThreshold (unsigned short updatesPerSecond)
 Sets & overrides the default (static) updates per second for a specific instance If a negative integer is passed to it, it will use the difference of the max value of an unsigned short and the absolute value of the negative integer. More...
 
virtual unsigned short updateRateWarningThreshold () const
 Returns the value of the overridden rate warning threshold. More...
 
virtual void checkForUpdateRateWarning ()
 Helper function that determines whether or not to trigger a spam warning. More...
 
 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. More...
 
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. More...
 
static void setDfltUpdateRateWarningThreshold (unsigned short updatesPerSecond)
 Sets the default (static) updates per second for any instance. More...
 
static unsigned short dfltUpdateRateWarningThreshold ()
 Return the value of theDfltUpdateRateWarningThreshold. More...
 

Protected Member Functions

 DtObjectPublisher (DtStateRepository *stateRep, DtStateRepository *asSeenByRemote, bool okToDeleteStateRep=true, const DtDDMRegionSet *regionSet=0)
 Constructor which does not include the DtExerciseConn. More...
 
virtual void setExerciseConn (DtExerciseConn *conn)
 Allows the DtExerciseConn to be set after initial publisher creation. More...
 
virtual void processRemoveObject (DtHlaObject *obj)
 Called by removeObjectCb to detachHlaObject when our underlying DtHlaObject goes away. More...
 

Protected Attributes

DtExerciseConnmyExConn
 
DtHlaObjectWithStateRepmyHlaObj
 
DtStateRepositorymyStateRep
 
DtStateRepositorymyAsSeenByRemote
 
DtHlaStateEncodermyEncoder
 
DtHlaStateDecodermyDecoder
 
DtObjectId myObjectId
 
bool myOkToDeleteStateRepFlag
 
DtString myName
 
bool myDeleteObjInDtorFlag
 
DtDDMRegionSet myPublishingRegions
 
DtTime myRealTimeLastUpdate
 
DtTime myLastSpamCheckTime
 
unsigned short myNumberOfUpdatesPerSecond
 
unsigned short myUpdateRateWarningThreshold
 
bool myCanWarn
 

Static Protected Attributes

static unsigned short theDfltUpdateRateWarningThreshold
 Static member that holds the value of the number of updates to be sent to trigger a spam warning. More...
 

Private Member Functions

 DtObjectPublisher (const DtObjectPublisher &orig)
 copy constructor – not implemented More...
 
DtObjectPublisheroperator= (const DtObjectPublisher &orig)
 assignment operator – not implemented More...
 

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 ( DtStateRepository stateRep,
DtStateRepository asSeenByRemote,
bool  okToDeleteStateRep = true,
const DtDDMRegionSet regionSet = 0 
)
protected

Constructor which does not include the DtExerciseConn.

This is typically not desired, but may be useful in certain cases when a derived publisher wants to better control how the object is published.

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 void DtObjectPublisher::checkForUpdateRateWarning ( )
virtual

Helper function that determines whether or not to trigger a spam warning.

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.

static unsigned short DtObjectPublisher::dfltUpdateRateWarningThreshold ( )
static

Return the value of theDfltUpdateRateWarningThreshold.

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 bool DtObjectPublisher::parallelTick ( )
virtual

Tick (update) this object in parallel threads.

Will return true if data was sent.

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.

static void DtObjectPublisher::setDfltUpdateRateWarningThreshold ( unsigned short  updatesPerSecond)
static

Sets the default (static) updates per second for any instance.

virtual void DtObjectPublisher::setExerciseConn ( DtExerciseConn conn)
protectedvirtual

Allows the DtExerciseConn to be set after initial publisher creation.

This should only be used when using the constructor which does not take an exercise connection.

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.

virtual void DtObjectPublisher::setUpdateRateWarningThreshold ( unsigned short  updatesPerSecond)
virtual

Sets & overrides the default (static) updates per second for a specific instance If a negative integer is passed to it, it will use the difference of the max value of an unsigned short and the absolute value of the negative integer.

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 bool DtObjectPublisher::tick ( )
virtual

Tick (update) this object.

Will return true if data was sent.

Reimplemented in DtEntityPublisher, DtEmitterSystemPublisher, DtAggregatePublisher, DtIffPublisher, DtActiveSonarPublisher, DtAerodromePublisher, and DtUnderwaterAcousticsPublisher.

virtual unsigned short DtObjectPublisher::updateRateWarningThreshold ( ) const
virtual

Returns the value of the overridden rate warning threshold.

Member Data Documentation

DtStateRepository* DtObjectPublisher::myAsSeenByRemote
protected
bool DtObjectPublisher::myCanWarn
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().

DtTime DtObjectPublisher::myLastSpamCheckTime
protected
DtString DtObjectPublisher::myName
protected
unsigned short DtObjectPublisher::myNumberOfUpdatesPerSecond
protected
DtObjectId DtObjectPublisher::myObjectId
protected
bool DtObjectPublisher::myOkToDeleteStateRepFlag
protected
DtDDMRegionSet DtObjectPublisher::myPublishingRegions
protected
DtTime DtObjectPublisher::myRealTimeLastUpdate
protected
DtStateRepository* DtObjectPublisher::myStateRep
protected

Referenced by DtActiveSonarBeamPublisher::activeSonarBeamStateRep(), DtActiveSonarPublisher::activeSonarStateRep(), DtAdditionalPassiveActivitiesPublisher::additionalPassiveActivitiesStateRep(), DtAerodromePublisher::aerodromeStateRep(), DtAggregatePublisher::aggregateStateRep(), DtArealObjectPublisher::aosr(), DtArealObjectPublisher::arealObjectStateRep(), DtActiveSonarPublisher::asr(), DtActiveSonarBeamPublisher::asr(), DtAdditionalPassiveActivitiesPublisher::asr(), DtAggregatePublisher::asr(), DtAerodromePublisher::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(), DtIFFDataPublisher::IFFDataStateRep(), DtIffPublisher::iffStateRep(), DtIffPublisher::isr(), DtIFFDataPublisher::Isr(), DtLandSurfacePublisher::landSurfaceStateRep(), DtLinearObjectPublisher::linearObjectStateRep(), DtLinearObjectPublisher::losr(), DtLandSurfacePublisher::lsr(), DtMode1Publisher::mode1StateRep(), DtMode2Publisher::mode2StateRep(), DtMode3APublisher::mode3AStateRep(), DtMode3CPublisher::Mode3CStateRep(), DtMode4Publisher::mode4StateRep(), DtMode5Publisher::mode5StateRep(), DtModeSPublisher::modeSStateRep(), DtMode1Publisher::msr(), DtMode2Publisher::msr(), DtMode3APublisher::msr(), DtMode3CPublisher::msr(), DtMode4Publisher::msr(), DtMode5Publisher::msr(), DtModeSPublisher::msr(), DtRRBPublisher::msr(), DtPointObjectPublisher::pointObjectStateRep(), DtPointObjectPublisher::posr(), DtPropulsionNoisePublisher::propulsionNoiseStateRep(), DtPropulsionNoisePublisher::psr(), DtRadioTransmitterPublisher::radioXmitRep(), DtRadioReceiverPublisher::receiverRep(), DtRRBPublisher::rrbStateRep(), DtRadioReceiverPublisher::rsr(), DtRunwayPublisher::rsr(), DtRunwayPublisher::runwayStateRep(), DtServicePublisher::serviceStateRep(), DtSovietPublisher::sovietStateRep(), sr(), DtServicePublisher::ssr(), DtSubsurfaceLayerPublisher::ssr(), DtSovietPublisher::ssr(), stateRep(), DtSubsurfaceLayerPublisher::subsurfaceLayerStateRep(), DtTCASDataPublisher::TCASDataStateRep(), DtTimeAndDatePublisher::timeAndDateStateRep(), DtTroposphereLayerPublisher::troposphereLayerStateRep(), DtRadioTransmitterPublisher::tsr(), DtTimeAndDatePublisher::tsr(), DtTroposphereLayerPublisher::tsr(), DtTurbulenceLayerPublisher::tsr(), DtTCASDataPublisher::Tsr(), DtTurbulenceLayerPublisher::turbulenceLayerStateRep(), DtUnderwaterAcousticsPublisher::underwaterAcousticsStateRep(), DtUnderwaterAcousticsPublisher::usr(), DtVRLinkStatePublisher::vrlinkStateStateRep(), DtVRLinkStatePublisher::vsr(), DtWaterSurfacePublisher::waterSurfaceStateRep(), DtWeatherPublisher::weatherStateRep(), DtWindCorridorPublisher::windCorridorStateRep(), DtWeatherPublisher::wsr(), DtWindCorridorPublisher::wsr(), and DtWaterSurfacePublisher::wsr().

unsigned short DtObjectPublisher::myUpdateRateWarningThreshold
protected
unsigned short DtObjectPublisher::theDfltUpdateRateWarningThreshold
staticprotected

Static member that holds the value of the number of updates to be sent to trigger a spam warning.


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

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)