VR-Vantage 1.4.1 API Class Documentation
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...

List of all members.

Public Member Functions

 DtVrfEntityPublisher (const DtEntityType &type, DtExerciseConn *conn, const DtGlobalObjectDesignator &id=DtVrfObjectIdGenerator::nullId())
 Create a new instance of the vrf entity publisher which will, in turn, create the vrlink 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 entitys 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 const DtObjectId & id () const
 Get the entitys process's identifier.
virtual const DtObjectId & localId () const
 Get the entitys process'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 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

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

Static Protected Attributes

static DtTime theVrfDataTimeThreshold

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


Constructor & Destructor Documentation

DtVrfEntityPublisher::DtVrfEntityPublisher ( const DtEntityType &  type,
DtExerciseConn *  conn,
const DtGlobalObjectDesignator &  id = DtVrfObjectIdGenerator::nullId() 
)

Create a new instance of the vrf entity publisher which will, in turn, create the vrlink 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.


Member Function Documentation

virtual void DtVrfEntityPublisher::tick ( ) [virtual]

Class method taken from publisher class for entitys 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 const DtObjectId& DtVrfEntityPublisher::id ( ) const [virtual]

Get the entitys process's identifier.

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

Get the entitys process'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)

static void DtVrfEntityPublisher::setVrfDataTimeThreshold ( DtTime  time) [static]
static DtTime DtVrfEntityPublisher::vrfDataTimeThreshold ( ) [static]
DtVrfEntityPublisher& DtVrfEntityPublisher::operator= ( const DtVrfEntityPublisher ) [private]
virtual bool DtVrfEntityPublisher::sendVrfDataUpdate ( ) [protected, virtual]

Sends out a vrf data update message if needed.

virtual bool DtVrfEntityPublisher::needsVrfObjectDataUpdate ( ) [protected, virtual]

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 
) [protected, virtual]

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 [protected, virtual]

Fill out the payload data.

virtual void DtVrfEntityPublisher::sendMessageInteraction ( const DtSimulationAddress &  receiver,
DtDataInteraction &  data 
) [protected, virtual]

Send the message interaction.

static void DtVrfEntityPublisher::dataInteractionCallback ( DtDataInteraction *  i,
void *  usr 
) [static, protected]

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

virtual void DtVrfEntityPublisher::processSendVrfObjectDataMessage ( DtDataInteraction *  interaction) [protected, virtual]

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]

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


Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)