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
DtEntityPublisher Class Reference

Instances of DtEntityPublisher are used for local or source simulations of entities, (i.e. More...

+ Inheritance diagram for DtEntityPublisher:
+ Collaboration diagram for DtEntityPublisher:

Public Types

typedef DtEntityStateRepository *(* DtStateRepCreator )()
 Function prototype for functions that create DtEntityStateRepositories.

Public Member Functions

 DtEntityPublisher (DtEntityStateRepository *stateRepToUse, DtExerciseConn *conn, const DtObjectId &id=DtObjectId::defaultId())
 Constructor.
 DtEntityPublisher (DtExerciseConn *conn, const DtObjectId &id=DtObjectId::defaultId())
 Constructor.
 DtEntityPublisher (const DtEntityType &type, DtExerciseConn *conn, const DtObjectId &id=DtObjectId::defaultId())
 Constructor.
 DtEntityPublisher (const DtEntityType &type, DtExerciseConn *conn, DtDeadReckonTypes algorithm, DtForceType forceId, const DtEntityType &guise=guiseSameAsType(), const DtObjectId &id=DtObjectId::defaultId())
 Constructor.
virtual ~DtEntityPublisher ()
 Destructors.
virtual void tick ()
 This function should be called once per frame for each entity.
virtual DtEntityStateRepositoryentityStateRep ()
 Returns a pointer to the EntityStateRepository - through which you can set or inspect current state information.
virtual DtEntityStateRepositoryesr ()
 Synonym for entityStateRep().
virtual DtEntityStateDecoderdecoder ()
 Returns a pointer to the Decoder being used to decode PDUs that we send back into the asSeenByRemote ESR.
virtual DtEntityStateEncoderencoder ()
 Returns a pointer to the Encoder being used to encode current state into an entity state PDU.
virtual DtOwnershipHandlersetOwnershipHandler (DtOwnershipHandler *handler)
 Sets the current ownership handler to handler.
virtual const DtObjectIdid () const
 Get the entity's identifier.
virtual const DtObjectIdlocalId () const
 Get the entity's localId - same as id for DIS.
virtual const
DtGlobalObjectDesignator
globalId () const
 Get the global object designator - same as id for DIS.
virtual void sendFinalPduOnDestruction (bool on)
 Set flag indicating whether to send a final PDU with the "FinalPdu" appearance bit set, from within the DtEntityPublisher destructor.
virtual void forceUpdate ()
 Force a state update to be sent during the next call to tick, even if nothing would normally cause a send.
virtual void enableDiGuyInformation ()
 Tell the publisher to send DI Guy PDU's.
virtual void setSendDiGuyPdus (bool yesNo)
 Tell the publisher to send DI Guy PDU's.
virtual bool sendDiGuyPdus () const
 Determine whether this publisher will send DI Guy PDU's.
virtual void setSendSeesPdus (bool yesNo)
 Tell the publisher to send SEES PDU's.
virtual bool sendSeesPdus () const
 Determine whether this publisher will send SEES PDU's.
virtual void setSeesTimeThreshold (DtTime time)
 Set the SEES time threshold for sending a PDU.
virtual DtTime seesTimeThreshold () const
 Return the SEES time threshold.
virtual void setDiGuyTypeTimeThreshold (DtTime time)
 Set the DIGuy Type time threshold for sending a PDU.
virtual DtTime diGuyTypeTimeThreshold () const
 Return the DIGuy Type time threshold.
virtual void setDiGuyAppearanceTimeThreshold (DtTime time)
 Set the DIGuy Appearance time threshold for sending a PDU.
virtual DtTime diGuyAppearanceTimeThreshold () const
 Return the DIGuy Appearance time threshold.
virtual void setDiGuyActionTimeThreshold (DtTime time)
 Set the DIGuy Action time threshold for sending a PDU.
virtual DtTime diGuyActionTimeThreshold () const
 Return the DIGuy Action time threshold.
DtTime entityTypeHeartbeat (int type, int domain)
 Return the heartbeat based on entity Type.
virtual void divestObject (DtU16 siteTarget, DtU16 applicationTarget)
 Begin a DIS 7 push request for this object.
virtual void createAndSendDiGuyPdus ()
 Send DI Guy PDU's (if needed or if threshold has been exceeded).
- Public Member Functions inherited from DtObjectPublisher
 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 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.

Static Public Member Functions

static const DtEntityTypeguiseSameAsType ()
static void setStateRepCreator (DtStateRepCreator creator)
 Give us a function to be used for creating SRs.
static DtStateRepCreator stateRepCreator (void)
static void setClassDfltTimeThreshold (DtTime threshold)
static void setStationaryDfltTimeThreshold (DtTime threshold)
static void setEntityTypeDfltTimeThreshold (int type, int domain, DtTime threshold)
static void setDfltRotationThreshold (double r)
static double dfltRotationThreshold ()
static void setDfltTranslationThreshold (double t)
static double dfltTranslationThreshold ()
- Static Public Member Functions inherited from DtObjectPublisher
static void setDfltTimeThreshold (DtTime time)
 Set the default heartbeat rate.
static DtTime dfltTimeThreshold ()
 The default heartbeat rate, see setDfltTimeThreshold().

Protected Member Functions

void sendFinalPdu ()
 Not virtual since called from destructor.
virtual void createAndSendSeesPdu ()
 Send SEES PDU.
virtual bool sendSeesNeeded () const
void init (const DtObjectId &vehId)
 Not virtual since called from constructor.
- Protected Member Functions inherited from DtObjectPublisher
virtual void send (DtPdu *pdu) const
 Puts the PDU on the network and updates timestamps.

Protected Attributes

DtObjectId myId
DtEntityStateDecodermyEntityDecoder
DtEntityStateEncodermyEntityEncoder
DtDIGuyCustomPduEncodermyDiGuyEncoder
bool mySendFinalInDtor
bool mySendDiGuyPdus
bool mySendSeesPdus
DtTime mySeesPdusTimeThreshold
DtTime myLastSeesPdusUpdate
DtOwnershipHandlermyOwnershipHandler
- Protected Attributes inherited from DtObjectPublisher
DtExerciseConnmyExConn
DtStateRepositorymyStateRep
DtStateRepositorymyAsSeenByRemote
bool myOkToDeleteStateRepFlag
bool myUseCustomThreshold
DtTime myTimeThreshold
DtTime mySimTimeLastUpdate
 Set in const send() method.
DtTime myRealTimeLastUpdate
 Set in const send() method.

Static Protected Attributes

static DtStateRepCreator theStateRepCreator
static DtTime theClassDfltTimeThreshold
static bool theClassDfltIsSetFlag
static DtTime theStationaryDfltTimeThreshold
static bool theStationaryDfltIsSetFlag
static std::map< std::pair
< int, int >, DtTime
theEntityTypeHeartbeat
- Static Protected Attributes inherited from DtObjectPublisher
static DtTime theDfltTimeThreshold

Private Member Functions

 DtEntityPublisher (const DtEntityPublisher &orig)
 copy constructor - Not Implemented
DtEntityPublisheroperator= (const DtEntityPublisher &orig)
 assignment operator - Not Implemented

Detailed Description

Instances of DtEntityPublisher are used for local or source simulations of entities, (i.e.

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

Member Typedef Documentation

typedef DtEntityStateRepository*(* DtEntityPublisher::DtStateRepCreator)()

Function prototype for functions that create DtEntityStateRepositories.

Constructor & Destructor Documentation

DtEntityPublisher::DtEntityPublisher ( DtEntityStateRepository stateRepToUse,
DtExerciseConn conn,
const DtObjectId id = DtObjectId::defaultId() 
)

Constructor.

DtObjectId::defaultId() returns a special DtObjectId that is a signal to the DtEntityPublisher constructor that it should obtain its own ObjectId.

DtEntityType::defaultType() returns a special DtEntityType that indicates to the DtEntityPublisher constructor that the entity type should also be used as the guise.

DtEntityPublisher::DtEntityPublisher ( DtExerciseConn conn,
const DtObjectId id = DtObjectId::defaultId() 
)

Constructor.

DtObjectId::defaultId() returns a special DtObjectId that is a signal to the DtEntityPublisher constructor that it should obtain its own ObjectId.

DtEntityType::defaultType() returns a special DtEntityType that indicates to the DtEntityPublisher constructor that the entity type should also be used as the guise.

DtEntityPublisher::DtEntityPublisher ( const DtEntityType type,
DtExerciseConn conn,
const DtObjectId id = DtObjectId::defaultId() 
)

Constructor.

DtObjectId::defaultId() returns a special DtObjectId that is a signal to the DtEntityPublisher constructor that it should obtain its own ObjectId.

DtEntityType::defaultType() returns a special DtEntityType that indicates to the DtEntityPublisher constructor that the entity type should also be used as the guise.

DtEntityPublisher::DtEntityPublisher ( const DtEntityType type,
DtExerciseConn conn,
DtDeadReckonTypes  algorithm,
DtForceType  forceId,
const DtEntityType guise = guiseSameAsType(),
const DtObjectId id = DtObjectId::defaultId() 
)

Constructor.

DtObjectId::defaultId() returns a special DtObjectId that is a signal to the DtEntityPublisher constructor that it should obtain its own ObjectId.

DtEntityType::defaultType() returns a special DtEntityType that indicates to the DtEntityPublisher constructor that the entity type should also be used as the guise.

virtual DtEntityPublisher::~DtEntityPublisher ( )
virtual

Destructors.

DtEntityPublisher::DtEntityPublisher ( const DtEntityPublisher orig)
private

copy constructor - Not Implemented

Member Function Documentation

virtual void DtEntityPublisher::createAndSendDiGuyPdus ( )
virtual

Send DI Guy PDU's (if needed or if threshold has been exceeded).

virtual void DtEntityPublisher::createAndSendSeesPdu ( )
protectedvirtual

Send SEES PDU.

DtEntityStateDecoder * DtEntityPublisher::decoder ( )
inlinevirtual

Returns a pointer to the Decoder being used to decode PDUs that we send back into the asSeenByRemote ESR.

References myEntityDecoder.

double DtEntityPublisher::dfltRotationThreshold ( )
inlinestatic
Deprecated:
Please use the DtThresholder static member functions instead.
double DtEntityPublisher::dfltTranslationThreshold ( )
inlinestatic
Deprecated:
Please use the DtThresholder static member functions instead.
virtual DtTime DtEntityPublisher::diGuyActionTimeThreshold ( ) const
virtual

Return the DIGuy Action time threshold.

virtual DtTime DtEntityPublisher::diGuyAppearanceTimeThreshold ( ) const
virtual

Return the DIGuy Appearance time threshold.

virtual DtTime DtEntityPublisher::diGuyTypeTimeThreshold ( ) const
virtual

Return the DIGuy Type time threshold.

virtual void DtEntityPublisher::divestObject ( DtU16  siteTarget,
DtU16  applicationTarget 
)
virtual

Begin a DIS 7 push request for this object.

This just passes through to the OwnershipHandler The entire process will by default be automated from here.

Parameters
siteTargetthe destination site where you want the object to go
appicationTargetthe destination application where you want the object to go.
virtual void DtEntityPublisher::enableDiGuyInformation ( )
virtual

Tell the publisher to send DI Guy PDU's.

DtEntityStateEncoder * DtEntityPublisher::encoder ( )
inlinevirtual

Returns a pointer to the Encoder being used to encode current state into an entity state PDU.

References myEntityEncoder.

DtEntityStateRepository * DtEntityPublisher::entityStateRep ( )
inlinevirtual

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

References esr().

DtTime DtEntityPublisher::entityTypeHeartbeat ( int  type,
int  domain 
)

Return the heartbeat based on entity Type.

DtEntityStateRepository * DtEntityPublisher::esr ( )
inlinevirtual

Synonym for entityStateRep().

References DtObjectPublisher::stateRep().

Referenced by entityStateRep().

virtual void DtEntityPublisher::forceUpdate ( )
virtual

Force a state update to be sent during the next call to tick, even if nothing would normally cause a send.

Implements DtObjectPublisher.

virtual const DtGlobalObjectDesignator& DtEntityPublisher::globalId ( ) const
virtual

Get the global object designator - same as id for DIS.

Implements DtObjectPublisher.

static const DtEntityType& DtEntityPublisher::guiseSameAsType ( )
static
const DtObjectId & DtEntityPublisher::id ( ) const
inlinevirtual

Get the entity's identifier.

Implements DtObjectPublisher.

References myId.

Referenced by localId().

void DtEntityPublisher::init ( const DtObjectId vehId)
protected

Not virtual since called from constructor.

const DtObjectId & DtEntityPublisher::localId ( ) const
inlinevirtual

Get the entity's localId - same as id for DIS.

Implements DtObjectPublisher.

References id().

DtEntityPublisher& DtEntityPublisher::operator= ( const DtEntityPublisher orig)
private

assignment operator - Not Implemented

virtual DtTime DtEntityPublisher::seesTimeThreshold ( ) const
virtual

Return the SEES time threshold.

virtual bool DtEntityPublisher::sendDiGuyPdus ( ) const
virtual

Determine whether this publisher will send DI Guy PDU's.

void DtEntityPublisher::sendFinalPdu ( )
protected

Not virtual since called from destructor.

void DtEntityPublisher::sendFinalPduOnDestruction ( bool  on)
inlinevirtual

Set flag indicating whether to send a final PDU with the "FinalPdu" appearance bit set, from within the DtEntityPublisher destructor.

References mySendFinalInDtor.

virtual bool DtEntityPublisher::sendSeesNeeded ( ) const
protectedvirtual
virtual bool DtEntityPublisher::sendSeesPdus ( ) const
virtual

Determine whether this publisher will send SEES PDU's.

static void DtEntityPublisher::setClassDfltTimeThreshold ( DtTime  threshold)
static
void DtEntityPublisher::setDfltRotationThreshold ( double  r)
inlinestatic
Deprecated:
Please use the DtThresholder static member functions instead.
void DtEntityPublisher::setDfltTranslationThreshold ( double  t)
inlinestatic
Deprecated:
Please use the DtThresholder static member functions instead.
virtual void DtEntityPublisher::setDiGuyActionTimeThreshold ( DtTime  time)
virtual

Set the DIGuy Action time threshold for sending a PDU.

virtual void DtEntityPublisher::setDiGuyAppearanceTimeThreshold ( DtTime  time)
virtual

Set the DIGuy Appearance time threshold for sending a PDU.

virtual void DtEntityPublisher::setDiGuyTypeTimeThreshold ( DtTime  time)
virtual

Set the DIGuy Type time threshold for sending a PDU.

static void DtEntityPublisher::setEntityTypeDfltTimeThreshold ( int  type,
int  domain,
DtTime  threshold 
)
static
virtual DtOwnershipHandler* DtEntityPublisher::setOwnershipHandler ( DtOwnershipHandler handler)
virtual

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.

virtual void DtEntityPublisher::setSeesTimeThreshold ( DtTime  time)
virtual

Set the SEES time threshold for sending a PDU.

virtual void DtEntityPublisher::setSendDiGuyPdus ( bool  yesNo)
virtual

Tell the publisher to send DI Guy PDU's.

Deprecated:
Use enableDiGuyInformation instead;
virtual void DtEntityPublisher::setSendSeesPdus ( bool  yesNo)
virtual

Tell the publisher to send SEES PDU's.

static void DtEntityPublisher::setStateRepCreator ( DtStateRepCreator  creator)
static

Give us a function to be used for creating SRs.

static void DtEntityPublisher::setStationaryDfltTimeThreshold ( DtTime  threshold)
static
static DtStateRepCreator DtEntityPublisher::stateRepCreator ( void  )
static
virtual void DtEntityPublisher::tick ( )
virtual

This function should be called once per frame for each entity.

It determines if any data needs to be sent to the other exercise participants, and sends that data.

Implements DtObjectPublisher.

Member Data Documentation

DtDIGuyCustomPduEncoder* DtEntityPublisher::myDiGuyEncoder
protected
DtEntityStateDecoder* DtEntityPublisher::myEntityDecoder
protected

Referenced by decoder().

DtEntityStateEncoder* DtEntityPublisher::myEntityEncoder
protected

Referenced by encoder().

DtObjectId DtEntityPublisher::myId
protected

Referenced by id().

DtTime DtEntityPublisher::myLastSeesPdusUpdate
protected
DtOwnershipHandler* DtEntityPublisher::myOwnershipHandler
protected
DtTime DtEntityPublisher::mySeesPdusTimeThreshold
protected
bool DtEntityPublisher::mySendDiGuyPdus
protected
bool DtEntityPublisher::mySendFinalInDtor
protected
bool DtEntityPublisher::mySendSeesPdus
protected
bool DtEntityPublisher::theClassDfltIsSetFlag
staticprotected
DtTime DtEntityPublisher::theClassDfltTimeThreshold
staticprotected
std::map<std::pair<int,int>,DtTime> DtEntityPublisher::theEntityTypeHeartbeat
staticprotected
DtStateRepCreator DtEntityPublisher::theStateRepCreator
staticprotected
bool DtEntityPublisher::theStationaryDfltIsSetFlag
staticprotected
DtTime DtEntityPublisher::theStationaryDfltTimeThreshold
staticprotected

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

Document ID: Generated on Thu Feb 22 04:26:36 EST 2018 from SVN revision 186468
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)