VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | 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 Types

typedef DtAttributePdu *(* DtNonCoupledAttributePduCreator )(const DtPduWithAttributeRecordSets *, void *)
 Function prototype for functions that create DtAggregateStateRepositories.

Public Member Functions

 DtObjectPublisher (DtExerciseConn *conn, DtStateRepository *stateRep, DtStateRepository *asSeenByRemote, bool okToDeleteStateRep=true)
 Constructor takes an DtExerciseConn which must have a lifetime greater than the ObjectPubliser.
virtual ~DtObjectPublisher ()
 Destructor.
virtual DtStateRepositorystateRep ()
 Returns a pointer to the DtStateRepository - through which you can set or inspect current state information.
virtual DtStateRepositorysr ()
 Returns a pointer to the DtStateRepository - through which you can set or inspect current state information.
virtual DtExerciseConnexerciseConn ()
 Get our exercise connection.
virtual const DtObjectIdlocalId () const =0
 The localId is the same as the globalId, a DtEntityIdentifier unique to this object.
virtual const DtObjectIdid () const =0
 The id is the same as the globalId, a DtEntityIdentifier unique to this object.
virtual const
DtGlobalObjectDesignator
globalId () const =0
 The entityIdentifier unique to this object.
virtual void forceUpdate ()=0
 For publisher to send PDU on next tick.
virtual void tick ()=0
 Tick (update) this object.
virtual void parallelTick ()
 Tick (update) this object in parallel threads.
virtual void setTimeThreshold (DtTime time)
 Set the heartbeat rate for this object.
virtual DtTime timeThreshold () const
 The heartbeat rate for this object.
virtual DtStateRepositoryapproximateRemoteStateRep ()
 Returns a pointer to the approximate remote DtStateRepository – This state repository contains the contents of the last sent message.
virtual DtTime lastTimeUpdated () const
 Returns the value of wallclock time at the time an update was last received for the entity.
virtual DtTime lastSimTimeUpdated () const
 Returns the value of sim time at the time an update was last received for the entity.
virtual void setUseCustomThreshold (bool useCustom)
 Sets whether or not this object will use a custom threshold value, or the default.
virtual bool useCustomThreshold ()
 Returns whether or not this object will use a custom threshold value, or the default.
virtual void setAttributePduStrategy (DtAttributePduStrategy strat)
 Sets/Gets whether to couple the attribute PDU.
virtual DtAttributePduStrategy attributePduStrategy () const
DtNonCoupledAttributePduCreator setNonCoupledAttributePduCreator (DtNonCoupledAttributePduCreator creator)
 Give us a function to be used for creating non-coupled Attribute PDUs.
DtNonCoupledAttributePduCreator nonCoupledAttributePduCreator (void)

Static Public Member Functions

static void setDfltTimeThreshold (DtTime time)
 Set the default heartbeat rate.
static DtTime dfltTimeThreshold ()
 The default heartbeat rate, see setDfltTimeThreshold().
static
DtNonCoupledAttributePduCreator 
setDefaultNonCoupledAttributePduCreator (DtNonCoupledAttributePduCreator creator)
 Give us a function to be used for creating non-coupled Attribute PDUs.
static
DtNonCoupledAttributePduCreator 
defaultNonCoupledAttributePduCreator (void)

Protected Member Functions

virtual void send (DtPdu *pdu) const
 Puts the PDU on the network and updates timestamps.

Protected Attributes

DtExerciseConnmyExConn
DtStateRepositorymyStateRep
DtStateRepositorymyAsSeenByRemote
bool myOkToDeleteStateRepFlag
bool myUseCustomThreshold
DtTime myTimeThreshold
DtTime mySimTimeLastUpdate
 Set in const send() method.
DtTime myRealTimeLastUpdate
 Set in const send() method.
DtNonCoupledAttributePduCreator myNonCoupledAttributePduCreator
DtAttributePduStrategy myAttributePduStrategy

Static Protected Attributes

static
DtNonCoupledAttributePduCreator 
theDefaultNonCoupledAttributePduCreator
static DtTime theDfltTimeThreshold

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.

Member Typedef Documentation

typedef DtAttributePdu*(* DtObjectPublisher::DtNonCoupledAttributePduCreator)(const DtPduWithAttributeRecordSets *, void *)

Function prototype for functions that create DtAggregateStateRepositories.

Constructor & Destructor Documentation

DtObjectPublisher::DtObjectPublisher ( DtExerciseConn conn,
DtStateRepository stateRep,
DtStateRepository asSeenByRemote,
bool  okToDeleteStateRep = true 
)

Constructor takes an DtExerciseConn which must have a lifetime greater than the ObjectPubliser.

It also takes two DtStateRepositories, the stateRep which it destroys in the DTOR if the okToDeleteStateRep flag was set to true, and the asSeenByRemote which is destroyed in the dtor every time.

virtual DtObjectPublisher::~DtObjectPublisher ( )
virtual

Destructor.

DtObjectPublisher::DtObjectPublisher ( const DtObjectPublisher orig)
private

copy constructor – not implemented

Member Function Documentation

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 DtAttributePduStrategy DtObjectPublisher::attributePduStrategy ( ) const
virtual
static DtNonCoupledAttributePduCreator DtObjectPublisher::defaultNonCoupledAttributePduCreator ( void  )
static
static DtTime DtObjectPublisher::dfltTimeThreshold ( )
static

The default heartbeat rate, see setDfltTimeThreshold().

DtExerciseConn * DtObjectPublisher::exerciseConn ( )
inlinevirtual

Get our exercise connection.

References myExConn.

virtual void DtObjectPublisher::forceUpdate ( )
pure virtual
virtual const DtGlobalObjectDesignator& DtObjectPublisher::globalId ( ) const
pure virtual
virtual const DtObjectId& DtObjectPublisher::id ( ) const
pure virtual
virtual DtTime DtObjectPublisher::lastSimTimeUpdated ( ) const
virtual

Returns the value of sim time at the time an update was last received for the entity.

virtual DtTime DtObjectPublisher::lastTimeUpdated ( ) const
virtual

Returns the value of wallclock time at the time an update was last received for the entity.

virtual const DtObjectId& DtObjectPublisher::localId ( ) const
pure virtual
DtNonCoupledAttributePduCreator DtObjectPublisher::nonCoupledAttributePduCreator ( void  )
DtObjectPublisher& DtObjectPublisher::operator= ( const DtObjectPublisher orig)
private

assignment operator – not implemented

virtual void DtObjectPublisher::parallelTick ( )
virtual

Tick (update) this object in parallel threads.

virtual void DtObjectPublisher::send ( DtPdu pdu) const
protectedvirtual

Puts the PDU on the network and updates timestamps.

virtual void DtObjectPublisher::setAttributePduStrategy ( DtAttributePduStrategy  strat)
virtual

Sets/Gets whether to couple the attribute PDU.

static DtNonCoupledAttributePduCreator DtObjectPublisher::setDefaultNonCoupledAttributePduCreator ( DtNonCoupledAttributePduCreator  creator)
static

Give us a function to be used for creating non-coupled Attribute PDUs.

static void DtObjectPublisher::setDfltTimeThreshold ( DtTime  time)
static

Set the default heartbeat rate.

The time passed to this function is the number of seconds between heartbeats in published objects at rest. The default time is 5s.

DtNonCoupledAttributePduCreator DtObjectPublisher::setNonCoupledAttributePduCreator ( DtNonCoupledAttributePduCreator  creator)

Give us a function to be used for creating non-coupled Attribute PDUs.

virtual void DtObjectPublisher::setTimeThreshold ( DtTime  time)
virtual

Set the heartbeat rate for this object.

The default rate for all objects is configured by setDfltTimeThreshold(). If this is set, the customThreshold is also set to true;

virtual void DtObjectPublisher::setUseCustomThreshold ( bool  useCustom)
virtual

Sets whether or not this object will use a custom threshold value, or the default.

DtStateRepository * DtObjectPublisher::sr ( )
inlinevirtual

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

References myStateRep.

DtStateRepository * DtObjectPublisher::stateRep ( )
inlinevirtual

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

References myStateRep.

Referenced by DtEntityPublisher::esr().

virtual void DtObjectPublisher::tick ( )
pure virtual
virtual DtTime DtObjectPublisher::timeThreshold ( ) const
virtual

The heartbeat rate for this object.

virtual bool DtObjectPublisher::useCustomThreshold ( )
virtual

Returns whether or not this object will use a custom threshold value, or the default.

Member Data Documentation

DtStateRepository* DtObjectPublisher::myAsSeenByRemote
protected
DtAttributePduStrategy DtObjectPublisher::myAttributePduStrategy
protected
DtExerciseConn* DtObjectPublisher::myExConn
protected

Referenced by exerciseConn().

DtNonCoupledAttributePduCreator DtObjectPublisher::myNonCoupledAttributePduCreator
protected
bool DtObjectPublisher::myOkToDeleteStateRepFlag
protected
DtTime DtObjectPublisher::myRealTimeLastUpdate
mutableprotected

Set in const send() method.

DtTime DtObjectPublisher::mySimTimeLastUpdate
mutableprotected

Set in const send() method.

DtStateRepository* DtObjectPublisher::myStateRep
protected
DtTime DtObjectPublisher::myTimeThreshold
protected
bool DtObjectPublisher::myUseCustomThreshold
protected
DtNonCoupledAttributePduCreator DtObjectPublisher::theDefaultNonCoupledAttributePduCreator
staticprotected
DtTime DtObjectPublisher::theDfltTimeThreshold
staticprotected

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

Document ID: Generated on Mon Apr 8 04:49:21 EDT 2019 from SVN revision 197403
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)