![]() |
VR-Forces 5.0.3 Developer's Guide
|
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.

Public Member Functions | |
| DtVrfEntityPublisher (const DtEntityType &type, DtExerciseConn *conn, const DtGlobalObjectDesignator &glId=DtGlobalObjectDesignator::nullId(), const DtEntityIdentifier &entId=DtEntityIdentifier::nullId(), DtRwProperties *stateProps=0, DtRwProperties *paramProps=0) | |
| DtVrfEntityPublisher (const DtEntityType &type, DtExerciseConn *conn, const DtGlobalObjectDesignator &glId=DtGlobalObjectDesignator::nullId(), const DtEntityIdentifier &entId=DtEntityIdentifier::nullId(), const DtRwProperties &stateProps=DtRwProperties::emptyProperties(), const DtRwProperties ¶mProps=DtRwProperties::emptyProperties()) | |
| virtual | ~DtVrfEntityPublisher () |
| virtual void | tick () |
| virtual DtEntPublisherDecoder * | decoder () |
| virtual DtEntPublisherEncoder * | encoder () |
| virtual void | setPublishesDiGuyInfo (bool has) |
| virtual bool | publishesDiGuyInfo () |
| virtual void | setSendDiGuyPdus (bool yesNo) |
| virtual bool | sendDiGuyPdus () const |
| virtual void | createAndSendDiGuyPdus () |
| DtStateRepository * | sr () |
| const DtString & | name () const |
| virtual const DtObjectId & | id () const |
| virtual const DtObjectId & | localId () const |
| virtual const DtGlobalObjectDesignator & | globalId () const |
| virtual void | forceUpdate () |
| virtual bool | sendVrfObjectData () |
| virtual DtEntityPublisher * | entityPublisher () |
| virtual void | setSendVrfObjectDataRecord (bool shouldSend) |
| virtual void | processDataInteraction (DtDataInteraction *i) |
| virtual DtExtEntityStateRepository * | entityProcessStateRep () |
| virtual DtExtEntityStateRepository * | entityStateRep () |
| virtual DtExtEntityStateRepository * | ensr () |
Static Public Member Functions | |
| static void | setInitializer (DtExtendedAttributesInitializerPtr init) |
| static DtExtendedAttributesInitializerPtr | initializer () |
| static void | setObjectClassChooser (DtObjectClassChooserPtr chooser) |
| static DtObjectClassChooserPtr | objectClassChooser () |
| static void | setVrfDataTimeThreshold (DtTime time) |
| static DtTime | vrfDataTimeThreshold () |
Protected Member Functions | |
| DtVrfEntityPublisher () | |
| void | initialize (const DtEntityType &type, DtExerciseConn *conn, const DtGlobalObjectDesignator &glId, const DtEntityIdentifier &entId) |
| virtual bool | sendVrfDataUpdate () |
| virtual bool | needsVrfObjectDataUpdate () |
| virtual void | processSendVrfObjectDataMessage (DtDataInteraction *interaction) |
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 | sendMessage (const DtSimulationAddress &receiver, DtSimInterfaceContent *message) |
| virtual bool | setContentForNet (DtDataInteraction *dataInter, DtSimInterfaceContent *content) const |
| virtual void | sendMessageInteraction (const DtSimulationAddress &receiver, DtDataInteraction &data) |
Static Protected Member Functions | |
| static void | dataInteractionCallback (DtDataInteraction *i, void *usr) |
Protected Attributes | |
| DtEntityPublisher * | myPublisher |
| DtTime | myTimeLastVrfDataSend |
| bool | myPublishesDIGuyInfo |
| makVrfVrlinkExtToolkit::DtExtendedAttributesObjectPublisher * | myExtAttrPublisher |
Static Protected Attributes | |
| static DtTime | theVrfDataTimeThreshold |
| static bool | myDiGuyEncodersSetup |
| static DtObjectClassChooserPtr | theObjectClassChooser |
| static DtExtendedAttributesInitializerPtr | theInitializer |
Private Member Functions | |
| DtVrfEntityPublisher (const DtVrfEntityPublisher &) | |
| DtVrfEntityPublisher & | operator= (const DtVrfEntityPublisher &) |
| DtVrfEntityPublisher::DtVrfEntityPublisher | ( | const DtEntityType & | type, |
| DtExerciseConn * | conn, | ||
| const DtGlobalObjectDesignator & | glId = DtGlobalObjectDesignator::nullId(), |
||
| const DtEntityIdentifier & | entId = DtEntityIdentifier::nullId(), |
||
| DtRwProperties * | stateProps = 0, |
||
| DtRwProperties * | paramProps = 0 |
||
| ) |
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
If supplied, initializes the state repository to publish extended attributes from the supplied state properties.
| DtVrfEntityPublisher::DtVrfEntityPublisher | ( | const DtEntityType & | type, |
| DtExerciseConn * | conn, | ||
| const DtGlobalObjectDesignator & | glId = DtGlobalObjectDesignator::nullId(), |
||
| const DtEntityIdentifier & | entId = DtEntityIdentifier::nullId(), |
||
| const DtRwProperties & | stateProps = DtRwProperties::emptyProperties(), |
||
| const DtRwProperties & | paramProps = DtRwProperties::emptyProperties() |
||
| ) |
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
If supplied, initializes the state repository with the provided state properties.
|
virtual |
Destructor. Also destroys publisher.
|
private |
Unimplemented.
|
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.
|
virtual |
Class method taken from publisher class for entities at VR-Link level. This will simply call down to the publisher's tick 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.
|
virtual |
Returns a pointer to the DtExtEntityStateRepository - through which you can set or inspect current state information.
|
virtual |
Returns a pointer to the DtExtEntityStateRepository - through which you can set or inspect current state information.
|
virtual |
Returns a pointer to the DtExtEntityStateRepository - through which you can set or inspect current state information.
|
virtual |
Returns a pointer to the Decoder being used to decode PDUs/updates that we send back into the asSeenByRemote state rep.
|
virtual |
Returns a pointer to the Encoder being used to encode current state into a PDU/update.
|
virtual |
Indicates that DI-Guy data should be published.
|
virtual |
Whether or not DI-Guy data will be published.
|
virtual |
Tell the publisher to send DI Guy Attributes in Attribute PDU for DIS 7. DIS 6 and lower will send custom DI Guy PDUS.
|
virtual |
Determine whether this publisher will send DI Guy Attributes in Attribute PDU for DIS 7. DIS 6 and lower returns wheter the publisher will send DI Guy PDUs.
|
virtual |
Override this to have your own custom marshalling of DI-Guy PDUs.
|
inline |
VRL support for common functions.
|
inline |
|
virtual |
Get the entity's identifier.
|
virtual |
Get the entity's localId - same as id for DIS.
|
virtual |
Get the global object designator - same as id for DIS.
|
virtual |
Force a state update to be sent during the next call to tick, even if nothing would normally cause a send.
|
virtual |
Sends vrf object data update from the ensr() to the network.
|
virtual |
Returns a pointer to myPublisher (the VR-Link DtEntityPublisher)
|
virtual |
Sets whether a separate VrfObjectData message should be sent to convey additional VRF object information.
|
static |
Sets the extended attributes initializer used by all publishers of this type.
|
static |
Returns the extended attributes initializer used by all publishers of this type.
|
static |
Sets the object class chooser used by all publishers of this type.
|
static |
Returns the object class chooser used by all publishers of this type.
|
static |
Sets the time to update the vrf data message. The message will be sent on this time (default is five seconds) or if the data as seen by remote is different that the current time. If time is set to be -1, it will only be sent if the data is different.
|
static |
Sets the time to update the vrf data message. The message will be sent on this time (default is five seconds) or if the data as seen by remote is different that the current time. If time is set to be -1, it will only be sent if the data is different.
|
private |
Unimplemented.
|
protected |
Called by the constructor to initialize the publisher.
|
protectedvirtual |
Sends out a vrf data update message if needed.
|
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.
|
protectedvirtual |
Fill out the payload data.
|
protectedvirtual |
Fill out the payload data.
|
protectedvirtual |
Send the message interaction.
|
staticprotected |
Used internally to see if a request is made of this object to send a VRF object update.
|
protectedvirtual |
Send message if interaction is requesting the entity id we are publishing.
|
virtual |
Used internally. Should not be directly called.
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
|
staticprotected |