VR-Vantage 2.3 API Documentation
 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 | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
DtVrfEntityPublisher Class Reference

This class will wrap a VR-Link DtEntityPublisher to allow for easier creation of a publisher that is compatible with VR-Forces. More...

Public Member Functions

 DtVrfEntityPublisher (const DtEntityType &type, DtExerciseConn *conn, const DtGlobalObjectDesignator &glId=DtGlobalObjectDesignator::nullId(), const DtEntityIdentifier &entId=DtEntityIdentifier::nullId())
 Create a new instance of the VRF entity publisher which will, in turn, create the VR-Link entity publisher, given a object id (DIS) or name (HLA).
virtual ~DtVrfEntityPublisher ()
 Also destroys publisher.
virtual void tick ()
 Class method taken from publisher class for entities at VR-Link level.
virtual
DtExtEntityStateRepository
entityProcessStateRep ()
 Returns a pointer to the DtExtEntityStateRepository - through which you can set or inspect current state information.
virtual
DtExtEntityStateRepository
entityStateRep ()
virtual
DtExtEntityStateRepository
ensr ()
 Synonym for entityProcessStateRep().
virtual DtEntPublisherDecoderdecoder ()
 Returns a pointer to the Decoder being used to decode PDUs that we send back into the asSeenByRemote ESR.
virtual DtEntPublisherEncoderencoder ()
 Returns a pointer to the Encoder being used to encode current state into an entity state PDU.
virtual void setPublishesDiGuyInfo (bool has)
virtual bool publishesDiGuyInfo ()
DtStateRepositorysr ()
 VRL support for common functions.
const DtString & name () const
virtual const DtObjectId & id () const
 Get the entity's identifier.
virtual const DtObjectId & localId () 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 forceUpdate ()
 Force a state update to be sent during the next call to tick, even if nothing would normally cause a send.
virtual bool sendVrfObjectData ()
 Sends vrf object data update from the ensr() to the network.
virtual DtEntityPublisher * entityPublisher ()
 Returns a pointer to myPublisher (the VR-Link DtEntityPublisher)
virtual void setSendVrfObjectDataRecord (bool shouldSend)
 Sets whether a separate VrfObjectData message should be sent to convey additional VRF object information.
virtual void processDataInteraction (DtDataInteraction *i)
 Used internally. Should not be directly called.

Static Public Member Functions

static void setVrfDataTimeThreshold (DtTime time)
static DtTime vrfDataTimeThreshold ()

Protected Member Functions

 DtVrfEntityPublisher ()
 Alternate constructor that performs no initialization.
void initialize (const DtEntityType &type, DtExerciseConn *conn, const DtGlobalObjectDesignator &glId, const DtEntityIdentifier &entId)
 Called by the constructor to initialize the publisher.
virtual bool sendVrfDataUpdate ()
 Sends out a vrf data update message if needed.
virtual bool needsVrfObjectDataUpdate ()
 Return true if the vrf object data message needs to be updated from a heartbeat or if the object data has changed.
virtual bool sendMessage (const DtSimulationAddress &receiver, DtSimInterfaceContent *message)
 Methods for sending out the object update Fill out the addressing and bookkeeping data, create interaction, and send (Calls set content and send below) Returns true if content could be set (and message sent); otherwise, false.
virtual bool setContentForNet (DtDataInteraction *dataInter, DtSimInterfaceContent *content) const
 Fill out the payload data.
virtual void sendMessageInteraction (const DtSimulationAddress &receiver, DtDataInteraction &data)
 Send the message interaction.
virtual void processSendVrfObjectDataMessage (DtDataInteraction *interaction)
 Send message if interaction is requesting the entity id we are publishing.

Static Protected Member Functions

static void dataInteractionCallback (DtDataInteraction *i, void *usr)
 Used internally to see if a request is made of this object to send a vrf object update.

Protected Attributes

DtEntityPublisher * myPublisher
DtTime myTimeLastVrfDataSend
bool myPublishesDIGuyInfo

Static Protected Attributes

static DtTime theVrfDataTimeThreshold
static bool myDiGuyEncodersSetup

Private Member Functions

 DtVrfEntityPublisher (const DtVrfEntityPublisher &)
 Unimplemented.
DtVrfEntityPublisheroperator= (const DtVrfEntityPublisher &)

Detailed Description

This class will wrap a VR-Link DtEntityPublisher to allow for easier creation of a publisher that is compatible with VR-Forces.

If you want to create and publish entity objects that can be used by VR-Forces, you can use a publisher of this class to facilitate in that creation.

The way in which entities are considered compliant with VR-Forces is via the publication of the DtIfVrfDataObject message. In addition to publishing the PDU for the entity, every n seconds (default 5), a DtIfVrfDataObject message will also be sent. You can change this by setting the heartbeat values for the data object. Note that a value of < 0 will mean to not send a heartbeat

Additional note: this class is also responsible for setting up extended DI-Guy encoders, which allow the contents of DI-Guy related packets to be controlled from VrfVrlExt, so that modifications don't need to be made to code in VR-Link.

Constructor & Destructor Documentation

DtVrfEntityPublisher::DtVrfEntityPublisher ( const DtEntityType &  type,
DtExerciseConn *  conn,
const DtGlobalObjectDesignator &  glId = DtGlobalObjectDesignator::nullId(),
const DtEntityIdentifier &  entId = DtEntityIdentifier::nullId() 
)

Create a new instance of the VRF entity publisher which will, in turn, create the VR-Link entity publisher, given a object id (DIS) or name (HLA).

This class will use the default factory as supplied in the DtVrfObjectIdGenerator class

The state repository will initially be set to the DtExtEntityStateRepository class. You can change it in the global DtVrfEntityPublisher class before calling this creator

virtual DtVrfEntityPublisher::~DtVrfEntityPublisher ( )
virtual

Also destroys publisher.

DtVrfEntityPublisher::DtVrfEntityPublisher ( const DtVrfEntityPublisher )
private

Unimplemented.

DtVrfEntityPublisher::DtVrfEntityPublisher ( )
protected

Alternate constructor that performs no initialization.

Can be used in subclasses to override how initialization is performed. If this constructor is used, the initialize function (or a equivalent replacement) must be called before this class will publish anything.

Member Function Documentation

virtual void DtVrfEntityPublisher::tick ( )
virtual

Class method taken from publisher class for entities at VR-Link level.

This will simply call down to the publisher to handle the method. This function should be called once per frame for each entity object. It determines if any data needs to be sent to the other exercise participants, and sends that data.

In addition to publishing the entity, if need be, will also send the DtIfVrfObjectData message.

virtual DtExtEntityStateRepository* DtVrfEntityPublisher::entityProcessStateRep ( )
virtual

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

virtual DtExtEntityStateRepository* DtVrfEntityPublisher::entityStateRep ( )
virtual
virtual DtExtEntityStateRepository* DtVrfEntityPublisher::ensr ( )
virtual
virtual DtEntPublisherDecoder* DtVrfEntityPublisher::decoder ( )
virtual

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

virtual DtEntPublisherEncoder* DtVrfEntityPublisher::encoder ( )
virtual

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

virtual void DtVrfEntityPublisher::setPublishesDiGuyInfo ( bool  has)
virtual
virtual bool DtVrfEntityPublisher::publishesDiGuyInfo ( )
virtual
DtStateRepository* DtVrfEntityPublisher::sr ( )
inline

VRL support for common functions.

const DtString& DtVrfEntityPublisher::name ( ) const
inline
virtual const DtObjectId& DtVrfEntityPublisher::id ( ) const
virtual

Get the entity's identifier.

virtual const DtObjectId& DtVrfEntityPublisher::localId ( ) const
virtual

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

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

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

virtual void DtVrfEntityPublisher::forceUpdate ( )
virtual

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

virtual bool DtVrfEntityPublisher::sendVrfObjectData ( )
virtual

Sends vrf object data update from the ensr() to the network.

virtual DtEntityPublisher* DtVrfEntityPublisher::entityPublisher ( )
virtual

Returns a pointer to myPublisher (the VR-Link DtEntityPublisher)

virtual void DtVrfEntityPublisher::setSendVrfObjectDataRecord ( bool  shouldSend)
virtual

Sets whether a separate VrfObjectData message should be sent to convey additional VRF object information.

static void DtVrfEntityPublisher::setVrfDataTimeThreshold ( DtTime  time)
static
static DtTime DtVrfEntityPublisher::vrfDataTimeThreshold ( )
static
DtVrfEntityPublisher& DtVrfEntityPublisher::operator= ( const DtVrfEntityPublisher )
private
void DtVrfEntityPublisher::initialize ( const DtEntityType &  type,
DtExerciseConn *  conn,
const DtGlobalObjectDesignator &  glId,
const DtEntityIdentifier &  entId 
)
protected

Called by the constructor to initialize the publisher.

virtual bool DtVrfEntityPublisher::sendVrfDataUpdate ( )
protectedvirtual

Sends out a vrf data update message if needed.

virtual bool DtVrfEntityPublisher::needsVrfObjectDataUpdate ( )
protectedvirtual

Return true if the vrf object data message needs to be updated from a heartbeat or if the object data has changed.

If it does, then the heartbeat time for the next update will also be updated

virtual bool DtVrfEntityPublisher::sendMessage ( const DtSimulationAddress &  receiver,
DtSimInterfaceContent message 
)
protectedvirtual

Methods for sending out the object update Fill out the addressing and bookkeeping data, create interaction, and send (Calls set content and send below) Returns true if content could be set (and message sent); otherwise, false.

virtual bool DtVrfEntityPublisher::setContentForNet ( DtDataInteraction *  dataInter,
DtSimInterfaceContent content 
) const
protectedvirtual

Fill out the payload data.

virtual void DtVrfEntityPublisher::sendMessageInteraction ( const DtSimulationAddress &  receiver,
DtDataInteraction &  data 
)
protectedvirtual

Send the message interaction.

static void DtVrfEntityPublisher::dataInteractionCallback ( DtDataInteraction *  i,
void usr 
)
staticprotected

Used internally to see if a request is made of this object to send a vrf object update.

virtual void DtVrfEntityPublisher::processSendVrfObjectDataMessage ( DtDataInteraction *  interaction)
protectedvirtual

Send message if interaction is requesting the entity id we are publishing.

virtual void DtVrfEntityPublisher::processDataInteraction ( DtDataInteraction *  i)
virtual

Used internally. Should not be directly called.

Member Data Documentation

DtEntityPublisher* DtVrfEntityPublisher::myPublisher
protected
DtTime DtVrfEntityPublisher::myTimeLastVrfDataSend
protected
DtTime DtVrfEntityPublisher::theVrfDataTimeThreshold
staticprotected
bool DtVrfEntityPublisher::myPublishesDIGuyInfo
protected
bool DtVrfEntityPublisher::myDiGuyEncodersSetup
staticprotected

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


Copyright © 2005-2018 VT MAK. All Rights Reserved (www.mak.com)