![]() |
VR-Forces Developer's Guide
|
This document describes the public API changes in the vrfMsgTransport library between VR-Forces 5.2 and 5.3.
The library defines the event classes that VR-Forces applications exchange over the network, the managers that route them, and the database event logging interfaces. The changes in 5.3 fall into four groups: the collision event was restructured to carry the full contents of a DIS collision, two new event types were added, the database logger switched its scenario run identifier from an integer to a UUID, and the internal Tactical Data Link message interface was removed.
It covers the following public headers:
vrfMsgTransport/collisionEvent.hvrfMsgTransport/communicationManager.hvrfMsgTransport/event.hvrfMsgTransport/eventManager.hvrfMsgTransport/sensorFieldOfViewControlEvent.hvrfMsgTransport/soundEvent.hvrfMsgTransport/transferAcknowledgeEvent.hvrfMsgTransport/vrfDatabaseEvent.hvrfMsgTransport/vrfDatabaseEventParam.inlvrfMsgTransport/vrfDatabaseLogger.hvrfMsgTransport/vrfDatabaseLoggerInterface.hvrfMsgTransport/vrfDefaultDatabaseEvents.hvrfMsgTransport/vrfTDLMessageInterface.h (removed)Changes that are internal to an implementation or limited to comments are not listed.
DtCollisionEvent previously carried only the identifier of the entity that was collided with and the collision point in entity coordinates. In 5.3 it carries the full set of fields defined for a DIS collision: both participating entities, the event identifier, the collision type, the velocity and mass of the issuing entity, and the collision point. The accessor that named the single participant was ambiguous once both participants were present, so it was renamed.
| 5.2 declaration | 5.3 declaration |
|---|---|
const DtUUID& collideId() const | const DtUUID& collidingEntityId() const |
void setCollideId(const DtUUID&) | void setCollidingEntityId(const DtUUID&) |
DtUUID myCollideId (protected) | DtUUID myCollidingEntityId (protected) |
The convenience constructor was removed. Construct the event with the default constructor and set the fields individually:
Code that reads a received collision event must be updated to use collidingEntityId(). Because the issuing entity is now carried explicitly, code that previously inferred the other participant from the sender of the event should read it from issuingEntityId() instead.
The parameter name of setEntityCoords changed from velocity to coords. This has no effect on callers, but note that the velocity of the issuing entity is now a separate field accessed through velocity() and setVelocity(); code that was storing a velocity in setEntityCoords because no other field existed must move it to setVelocity.
collisionEvent.h now includes <vlpi/disEnums.h> for the DtCollisionType enumeration used by collisionType() and setCollisionType().
The following virtual method was removed from DtCommunicationManager:
There is no replacement. The clock created by the communication manager selects its time source internally. Classes that derived from DtCommunicationManager and overrode this method must remove the override, and call sites must remove the call.
The signature of virtual void reserve(unsigned int) is unchanged, but the documented contract was corrected. In 5.2 the method was described as cumulative, so that two successive calls with 1000 reserved capacity for 2000 objects. The state data manager in fact treats the argument as a high-water mark: it grows to accommodate the largest single request seen so far, and a repeated call with the same or a smaller value does nothing. Code that relied on the cumulative description and issued incremental reservations must be changed to pass the total capacity required:
The method is not thread safe. Individual network interface implementations may apply their own reservation semantics in addition to the state data manager.
The scenario run identifier that links all database events from a single run is now a DtUUID rather than an int. This changes a virtual function signature, a protected member, and the schema of every default database table that records the identifier.
The change applies to both DtVrfDatabaseLoggerInterface and the DtVrfDatabaseLogger override. Any class that derives from either and overrides setScenarioLoadInformation must change its signature, or the override will no longer bind and the base implementation will be called instead.
The protected member DtVrfDatabaseLoggerInterface::myRunId changed type from int to DtUUID. Derived classes that read or assign it must be updated.
In vrfDefaultDatabaseEvents.h, every scenarioRunId parameter changed from intParam to uuidParam. This affects the ScenarioRun, Fire, Detonation, Object, Engagement, EngagementAttack, EngagementDefense, EngagementCasualtyReport, and EngagementDamageReport table prototypes. Custom event prototypes that add a scenarioRunId column to join against these tables must use uuidParam as well:
Databases created by 5.2 are not schema-compatible with 5.3 for these tables. Applications that query the logged data must treat scenarioRunId as a string-formatted UUID rather than an integer.
The paramType specializations in vrfDatabaseEventParam.inl now emit narrower column declarations. These specializations determine the DDL generated for a table, so existing databases and any external tooling that assumes the previous widths are affected.
| Parameter type | 5.2 column type | 5.3 column type |
|---|---|---|
DtEntityIdentifier | VARCHAR(255) | VARCHAR(20) |
DtUUID | VARCHAR(255) | VARCHAR(40) |
DtSimulationAddress | VARCHAR(255) | VARCHAR(20) |
Applications that override DtTemplatedDatabaseEventParam<T>::paramType for these types are unaffected. Applications that rely on the generated schema should recreate their tables.
The internal Tactical Data Link subsystem was removed in 5.3. See the Removed Headers section below.
The new header vrfMsgTransport/transferAcknowledgeEvent.h defines makVrfEvents::DtTransferAcknowledgeEvent, which completes the ownership transfer handshake. It is sent in response to a transfer response and reports whether the transfer will in fact proceed.
The transaction identifier matches the identifier of the transfer request and response that preceded it, so a listener can correlate the acknowledgement with the transaction it initiated.
The new header vrfMsgTransport/soundEvent.h defines makVrfEvents::DtSoundEvent, which reports a sound produced by a simulation object. The event carries the source object, the entity type describing the sound, the position of the sound relative to the source, its world location, and its loudness in decibels.
Two enumerators were added to makVrfEvents::DtEvent::EventType. The existing enumerators and the value of UserEvent are unchanged, so no existing identifier was renumbered.
| Enumerator | Value | Class |
|---|---|---|
TransferAcknowledgeEvent | 36 | DtTransferAcknowledgeEvent |
SoundEvent | 37 | DtSoundEvent |
No event type identifiers were removed.
Applications that define their own event types starting at UserEvent (128) are unaffected. Applications that hard-coded a numeric value above 35 for a custom event type instead of basing it on UserEvent will now collide with these identifiers and must be renumbered.
Two signal accessors were added to DtEventManager, following the existing pattern:
Note that vrfMsgTransport/events.h was not updated to include the two new headers. Code that relies on events.h to pull in every event class must include vrfMsgTransport/soundEvent.h and vrfMsgTransport/transferAcknowledgeEvent.h directly.
The sensor field of view control event can now carry the power state of the sensor:
A protected member bool myPowerOn was added alongside the existing state. Derived classes that define a member with the same name must rename it.
A new database event type was added to DtVrfDatabaseEvent::EventType:
| Enumerator | Value | Table |
|---|---|---|
HitZoneDamageEvent | 18 | HitZoneDamage |
The value is below the UserEvent (500) base, so user-defined event types are unaffected. The corresponding table name and prototype are registered in vrfDefaultDatabaseEvents.h as theHitZoneDamageTableName and theHitZoneDamagePrototype. The table records the event identifier, the damaged object UUID, the hit zone function and number, the munition type, whether the hit was direct, and the resulting damage state.
theDamagePrototype gained a parameter:
It records the percentage of damage an entity has taken when the entity uses a multi-hit damage system. Applications that query the Damage table with an explicit column list are unaffected; applications that assume a fixed column count must be updated.
| Header | Replacement |
|---|---|
vrfMsgTransport/vrfTDLMessageInterface.h | None |
vrfTDLMessageInterface.h declared DtVrfTDLMessageInterface, the transport that sent Tactical Data Link messages as data interactions over a VR-Link exercise connection, together with the DtVrfTDLMessageCallbackFcn and DtVrfTDLMessageInterfaceCreatorFcn function pointer typedefs. It was part of the internal Tactical Data Link subsystem, which was removed in its entirety in 5.3. There is no replacement class. Applications that sent or received TDL messages through this interface must implement the equivalent behavior directly on top of makVrfEvents::DtDataEvent and DtCommunicationManager, or use DtVrfMessageInterface for application-defined message traffic.
| Header | Breaking | Additions |
|---|---|---|
collisionEvent.h | Convenience constructor removed; collideId/setCollideId renamed; protected member renamed | issuingEntityId, eventId, collisionType, velocity, mass accessors |
communicationManager.h | setUsePerfCounter removed; reserve contract corrected | None |
event.h | None | TransferAcknowledgeEvent and SoundEvent enumerators |
eventManager.h | None | signalForTransferAcknowledgeEvent, signalForSoundEvent |
sensorFieldOfViewControlEvent.h | None | setPowerOn, powerOn |
soundEvent.h | None | New header: DtSoundEvent |
transferAcknowledgeEvent.h | None | New header: DtTransferAcknowledgeEvent |
vrfDatabaseEvent.h | None | HitZoneDamageEvent enumerator |
vrfDatabaseEventParam.inl | Identifier column widths narrowed | None |
vrfDatabaseLogger.h | setScenarioLoadInformation signature changed | None |
vrfDatabaseLoggerInterface.h | setScenarioLoadInformation signature and myRunId type changed | None |
vrfDefaultDatabaseEvents.h | scenarioRunId changed from intParam to uuidParam in nine tables | HitZoneDamage table; percentDamaged column on Damage |
vrfTDLMessageInterface.h | Header removed, no replacement | None |
Return to VR-Forces 5.3 API Migration Guide.
[Home]