![]() |
VR-Forces Developer's Guide
|
This document describes the public API changes in the vrfutil library between VR-Forces 5.2 and VR-Forces 5.3.
vrfutil is the foundational utility library of VR-Forces: it supplies the scenario and back-end description objects, the simulation model set, the reflected (DtRw*) data types used throughout the product, and a number of small shared services. Because every other VR-Forces library and most toolkit code depends on it, changes here have wide reach.
The largest source of breakage in 5.3 is the replacement of the "run duration" concept with an absolute "run until" time, and the removal of the scenario random number seed. Both of these ripple through scenario.h, scenarioExplorer.h, scenarioBatchRecord.h, and backend.h. Beyond that, several types were renamed or relocated, and a small number of pure virtual interface methods gained parameters.
Changes that are internal to an implementation or limited to comments are not listed.
Scenario run termination is now expressed as the time at which the run stops rather than the length of the run. The old default of -1 (run indefinitely) became 0. Every accessor pair that carried the old concept was renamed; none of the old names were kept as deprecated aliases, so every call site must be updated.
| Class (header) | 5.2 declaration | 5.3 declaration |
|---|---|---|
DtScenario (scenario.h) | virtual DtTime runDurationTime() const | virtual DtTime runUntilTime() const |
DtScenario (scenario.h) | virtual void setRunDurationTime(DtTime) | virtual void setRunUntilTime(DtTime) |
DtScenario (scenario.h) | virtual bool isRunDurationTimeSpecified() | virtual bool isRunUntilTimeSpecified() |
DtScenarioExplorer (scenarioExplorer.h) | virtual DtTime runDurationTime() and virtual DtTime runDurationTime() const | virtual DtTime runUntilTime() const |
DtScenarioBatchRecord (scenarioBatchRecord.h) | virtual void setRunDuration(const DtRwClockTime&) | virtual void setRunUntil(const DtRwClockTime&) |
DtScenarioBatchRecord (scenarioBatchRecord.h) | virtual const DtRwClockTime& runDuration() const | virtual const DtRwClockTime& runUntil() const |
DtScenarioBatchRecord (scenarioBatchRecord.h) | virtual void setSimulationRunDuration(const DtRwClockTime&) | virtual void setSimulationRunUntil(const DtRwClockTime&) |
DtScenarioBatchRecord (scenarioBatchRecord.h) | virtual const DtRwClockTime& simulationRunDuration() const | virtual const DtRwClockTime& simulationRunUntil() const |
DtScenarioBatchRecord (scenarioBatchRecord.h) | virtual bool useSimulationDuration() const | virtual bool useSimulationRunUntil() const |
DtBackend (backend.h) | virtual void setRunDurationTime(DtTime) | virtual void setRunUntilTime(DtTime) |
DtBackend (backend.h) | virtual DtTime runDurationTime() const | virtual DtTime runUntilTime() const |
Note that DtScenarioExplorer previously declared both a non-const and a const runDurationTime; only a const runUntilTime remains. Code that called the non-const overload on a non-const explorer now binds to the const method, which is source compatible once the name is changed.
The equivalent change was made to DtIfStatus in vrfmsgs/ifStatus.h (setRunDurationTime/runDurationTime became setRunUntilTime/runUntilTime), since the value is carried between the GUI and the back-ends.
On disk, DtScenario writes a new run-until-time element and DtScenarioBatchRecord writes run-until and simulation-run-until. The old run-duration-time, run-duration, and simulation-run-duration elements are still read for backwards compatibility with 5.2 files, but 5.3 no longer writes them as the authoritative value. Tools that parse scenario or batch files must be taught to read the new element names.
The per-scenario random number seed and its batch override were removed. There is no replacement; seeding is no longer a scenario-level property.
The random-number-seed element is no longer written by either DtScenario or DtScenarioBatchRecord.
The three long-named methods that controlled setting the exercise start time when the first object is created were replaced with a simpler pair. The new behavior sets the start time to the local time-of-day component of the current UTM global time at the first placement latitude and longitude; the configurable "10 AM" offset is gone.
Callers that passed a non-default second argument have no equivalent in 5.3 and must set the exercise start time explicitly if a specific time of day is required.
The scenario run identifier is now a UUID rather than an integer.
backend.h now includes vrfutil/uuid.h. The matching accessors on DtIfStatus changed in the same way. Code that compared run IDs numerically, stored them in an int, or printed them with an integer format must be updated to use DtUUID.
msdlHierarchyPropertyMappings.h renamed the SIDC wrapper class and the corresponding mutator on DtMsdlHierarchyPropertyMappings. This is part of a wider rename of "SIDC code" to "Sidc" across the product.
| 5.2 declaration | 5.3 declaration |
|---|---|
class DtSidcCode : public DtString | class DtSidc : public DtString |
DtSidcCode(const DtString&) | DtSidc(const DtString&) |
DtSidcCode(const DtSidcCode&) | DtSidc(const DtSidc&) |
virtual bool matches(const DtSidcCode&) | virtual bool matches(const DtSidc&) |
virtual void addSidcCode(const std::string&) | virtual void addSidc(const std::string&) |
The remaining mapSidcTo*, addToHierarchyMapping, and addToDataItemMapping methods kept their names and signatures; only parameter names changed, so those call sites are unaffected.
Periodic checkpointing was added alongside periodic snapshots, so the ambiguous enabled accessors were renamed to name the subsystem they control.
The constructor gained two defaulted parameters. Existing four-argument calls still compile.
The Boost serialization class version of DtPeriodicSnapshotSettings advanced to 2, and the serialized member name changed from myEnabled to mySnapshotsEnabled. Version 1 archives are still readable.
Existing calls that ignore the return value compile unchanged. Classes that override addFormation must change the return type and return the created or replaced entry.
This is a pure virtual on an abstract handler in scenarioLoadManager.h. Every derived handler must add the parameter; otherwise the override no longer matches and the class remains abstract.
vrfSimOptionsInterface.h added a pure virtual accessor. Any class implementing this mixin interface must supply it.
The default argument keeps existing calls valid, but overrides in derived parsers must be updated to match the new signature.
The public member and its use-sounding-points configuration parameter were removed from terrainInterfaceConfig.h. Code that read or wrote config.useSoundingPoints will not compile, and terrain interface configuration files that still contain use-sounding-points should have the parameter deleted.
TDL message support was removed from VR-Forces, taking two public symbols with it.
| Removed symbol | Header |
|---|---|
DtTDLMessagesEnabledName ("tdl-messages-enabled") | simSettingsObjectTypes.h |
DtTDLReportEntityType | predefinedEntityTypes.h |
The related DtSpotReportEntityType and DtSpotReportEnvironmentalType are unchanged.
Every ASCII serialization type constant in asciiSerializable.h changed storage type.
The string values are unchanged, and most uses (comparison against a DtString, passing to a function taking const DtString& or const char*) continue to compile through implicit conversion. Code that relied on the constants being DtString objects will not, most commonly when calling a DtString member function directly on the constant, or when deducing the type in a template or an auto declaration. In those places, wrap the constant explicitly:
The enumeration dictionary manager moved from vrfGuiCore down into vrfutil so that non-GUI code can use it. In the process it left the makVrf namespace and no longer derives from makVrv::DtVirtualBaseClass.
The public methods (clearEnumerations, initializeEnumerations, loadEnumerations, dictionary, setEntityTypesFileDirectory, entityTypesFileDirectory, resourceUnitOfMeasurementFor) are unchanged. Code that referred to makVrf::DtEntityTypeDictionaryManager must drop the namespace qualification and include the new header.
makVrf::DtVrfEntityTypeDictionaryManager remains in vrfGuiCore and is unaffected at its own call sites, but it now multiply inherits from DtEntityTypeDictionaryManager and makVrv::DtVirtualBaseClass. Code that passed a DtVrfEntityTypeDictionaryManager where a makVrv::DtVirtualBaseClass was expected still works; code that relied on DtEntityTypeDictionaryManager itself being a DtVirtualBaseClass does not.
rollUpValues and averageContributionFrom moved from the protected section to the public section of DtTrueAggregateRollUpHelper. This widens access, so existing code is unaffected, but note that the class now acquires a static recursive mutex for the lifetime of the object in order to protect the global roll-up rule registry it temporarily replaces. Constructing two helpers concurrently on different threads now serializes; construct them for as short a scope as possible.
Translation units that relied on vrfutil/rwUUID.h to pull in the Boost UUID declarations must now include <boost/uuid/uuid.hpp> themselves.
| Symbol | 5.2 location | 5.3 location |
|---|---|---|
enum DtScenarioCapabilities and its enumerators | vrfmsgs/ifStatus.h | vrfutil/scenarioCapabilities.h |
hasCapability(const DtU32&, DtScenarioCapabilities) | vrfmsgs/ifStatus.h (exported as DT_DLL_vrfmsgs) | vrfutil/scenarioCapabilities.h (exported as DT_DLL_vrfutil) |
setCapability(DtU32&, DtScenarioCapabilities, bool) | vrfmsgs/ifStatus.h (exported as DT_DLL_vrfmsgs) | vrfutil/scenarioCapabilities.h (exported as DT_DLL_vrfutil) |
const DtU32 DtScenarioCapabilities_All | vrfmsgs/ifStatus.h | vrfutil/scenarioCapabilities.h |
DtEntityTypeDictionaryManager | vrfGuiCore/vrfEntityTypeDictionaryManager.h, namespace makVrf | vrfutil/entityTypeDictionaryManager.h, global namespace |
The enumerator values and function signatures of the capability symbols are unchanged. ifStatus.h includes vrfutil/scenarioCapabilities.h, so code that included ifStatus.h still compiles; code that used the capability helpers without including ifStatus.h should include the new header directly. Applications that link against the capability helpers must now link vrfutil rather than relying on vrfmsgs to export them.
Three new headers introduce hit zones, which subdivide an entity's bounding volume into separately targetable and damageable regions.
vrfutil/hitZoneId.h defines DtHitZoneId, a value type pairing a zone function with a zone number, packable into a 16-bit integer for transmission and storage. The header also defines the zone function constants DtHitZoneFunctionUnspecified, DtHitZoneFunctionWeapon, DtHitZoneFunctionSensor, DtHitZoneFunctionMovement, DtHitZoneFunctionAny, and the wildcard DtHitZoneNumberAny.
DtHitZoneId provides operator== and operator<, so it can be used directly as a key in ordered containers.
vrfutil/rwHitZone.h defines DtRwHitZone, a DtReaderWriter describing one hit zone. It exposes zoneId/setZoneId, boundingVolume/setBoundingVolume, and hitZoneDamageParamsType/setHitZoneDamageParamsType, and serializes the elements zone-id, bounding-volume, and zone-damage-params. vrfutil/rwHitZoneList.h defines DtRwHitZoneList, a DtRwTemplatedListPtr<DtRwHitZone, true> specialization that overrides prePutSelf.
The corresponding reader/writer type names were added to vrfutil/vrfRwTypes.h: DtRwHitZoneType ("DtRwHitZone"), DtXMLHitZoneType ("hitZone"), and DtXMLHitZonesType ("hitZones").
DtSimulationModelSet gained a hit zone damage parameters file entry, defaulting to $(model-set-directory)/hitZoneDamageParams.mtl:
DtScenarioExplorer exposes the matching list of files from the scenario:
vrfutil/sidcReader.h defines makVrf::DtSidcReader, a reader and indexed container for SIDC symbol definitions loaded from settings/enumerations/sidc.json. Each entry is a nested SidcItem struct carrying the name, title, item type, dimensionality, category, tags, formats, CIM reference, and a SidcThumbnail.
Lookups are index backed: findByName and findByTitle return a single item or nullptr, while findByCategory, findByTag, and findByFormat return vectors. clear releases the items and indexes. The class is designed for subclassing; the load, lookup, and index-building methods are virtual.
Two new headers provide a typed registry for process-wide service objects, replacing ad hoc static instances.
vrfutil/vrfSingleton.h defines DtVrfSingleton, the base class for any registrable singleton. A derived class must supply a class name, which the REGISTER_SINGLETON macro generates:
vrfutil/vrfSingletonRoot.h defines DtVrfSingletonRoot, the container. Instances are registered with registerInstance and retrieved either by class name or through the type-safe template accessor:
DtVrfSingleton::cleanup is called during removal from the root, giving a place for teardown that cannot safely run in the destructor.
vrfutil/rwNameReservationConfig.h defines the reflected configuration that drives pre-reservation of object names across back-ends. DtRwObjectNameReservationConfig describes one object type: the object type identifier, the list of matching entity types, the name format string, the starting ID, how many names to reserve, the remaining-name threshold at which more are reserved, and the sub-object types whose names are reserved alongside it. DtRwNameReservationConfig holds a DtRwObjectNameReservationConfigList of those entries and is read and written with the free functions ReadFromFile and WriteToFile.
vrfutil/rwNavigationSignalFlagVector.h adds maritime signal flag support. It defines the DtNavigationSignalFlag enum (ICS and NATO numerals, substitutes, procedural flags such as DtPREP and DtCORPEN, the alphabet flags DtFlagA through DtFlagZ, DtCountryFlag, and DtNoFlag), the DtHalyardPosition enum with DtHalyardPositionCount, and DtRwNavigationSignalFlagVector, a named reader/writer vector of flag values.
Conversion helpers are provided in both directions. Note the distinction between the display and identifier forms for halyards: DtHalyardPositionToString and DtStringToHalyardPosition use human-readable names such as "Port 1" and are intended for UI and logging, while DtHalyardPositionToIdentifier and DtIdentifierToHalyardPosition use single-word forms such as "PortYard1" and are the correct choice for reader/writer element names in whitespace-delimited streams. Using the display form in a serialized stream will not round-trip.
The type names DtRwNavigationSignalFlagVectorType ("DtRwNavigationSignalFlagVector") and DtXMLNavigationSignalFlagVectorType ("navigationSignalFlagVector") were added to vrfutil/vrfRwTypes.h.
vrfutil/enumUtils.h is a new header containing a single free function that builds a display string describing every field of an entity type from an enumeration dictionary:
It returns false when no description could be found for the entity type.
DtIffMode5Settings gained four accessor pairs covering additional Mode 5 reply fields:
DtIffGeneralSettings added an override of the base class assignment operator, virtual DtIffModeSetting& operator=(const DtIffModeSetting&) override, so that assignment through a DtIffModeSetting reference copies the general settings correctly.
Resources and supplies are now partitioned into numbered bins, with bin 0 reserved for general storage. DtSimResource exposes the underlying reflected bin value for cases that need the reader/writer object rather than the integer:
DtSupplyEntry gained a bin of its own, serialized as the bin element with a default of 0:
The bin parameters on DtSimResourceManager (addResource, removeResource, lookupResource, lookupResources, resources, restoreResources) are unchanged from 5.2.
The following reflected types gained accessors and serialized elements. Existing data files remain readable; the new elements take their defaults when absent.
| Class (header) | Added accessors | New serialized element |
|---|---|---|
DtRwNavigationProfile (rwNavigationProfile.h) | semanticTagsThatPreventTransitionPoints() (const and non-const) | semantic-tags-that-prevent-transition-points |
DtRwNavigationProfileFeatureEntry (rwNavigationProfileFeatureEntry.h) | setAltitudeBuffer(double), altitudeBuffer() | altitude-buffer |
DtRwSensorContactInfo (rwSensorContactInfo.h) | setContactSidc(const DtString&), contactSidc(), operator!= | sidc |
DtRwScriptInformation (rwScriptInformation.h) | setTickWhileDestroyed(bool), tickWhileDestroyed(), setTickImmediately(bool), tickImmediately() | tick-while-destroyed, tick-immediately |
DtRwLocationReference (rwLocationReference.h) | setObjectAndVector(const DtUUID&, const DtVector&) | none |
DtRwColor (rwColor.h) | setAbgr(unsigned), abgr() | none |
DtRwIndividualLifeFormWeaponStateType (rwIndividualLifeFormWeaponStateType.h) | theXmlType(), xmlType() override, environment-based getData override | none |
Note that DtRwSensorContactInfo also changed the default value of the original-detection-time and original-detection-date-and-time elements from 0 to -1, so that "never detected" is distinguishable from "detected at time zero". Code that tested these values against 0 should test against a negative value instead.
DtScenario gained two non-virtual-dispatch entry points for parsing a scenario from an in-memory buffer rather than a file:
DtBackend gained state used to coordinate checkpoint saves across multiple back-ends and to detect missed status messages:
scenarioFragment is true when the current load or close is for one piece of a larger multi-back-end checkpoint. The matching scenarioFragment accessors and a scenarioStatusGeneration counter were added to DtIfStatus.
Slow-job warnings can now be rate limited, both globally per queue and per callback label:
The existing setWarnTime overloads are unchanged, and the default behavior is unthrottled.
The Tracy profiler facade gained callstack depth control and a way to start the profiler without enabling collection:
All of the DtPROFILE* marker macros now expand to the callstack-capturing Tracy zone variants and consult tracyCallstackDepth() at runtime. The macro names, parameters, and semantics are otherwise unchanged, so instrumented code needs no edits; with the default depth of 0 the behavior matches 5.2.
| Symbol | Header | Description |
|---|---|---|
DtStdinIsInteractive() | vrfVlKeyboard.h | Returns true when standard input is a terminal. Use before polling for console input so non-interactive runs do not block. |
DtEmbarkationPending | extendedDataKeywords.h | Set while a drop (Embark On) is pending for a fixed-wing entity. Distinct from DtEmbarkationInProcess. |
DtSpiderWebEntityType | predefinedEntityTypes.h | Entity type 19.0.0.5.0.0.0. |
DtDamagePointsStatePropType, DtTotalDamagePointsStatePropType | vrfStatePropertyTypes.h | State property types damage-points and total-damage-points. |
DtNavigationStatePropertyContext | vrfStatePropertyTypes.h | State property context Navigation. |
DtNavigationContextRoadUsePreferenceStatePropType | vrfStatePropertyTypes.h | State property NavRoadPreference within the navigation context. |
DtRoadUsePreferenceIgnoreRoads, DtVehicleRoadUsePreferenceUseRoads, DtVehicleRoadUsePreferenceOnlyRoads, DtHumanRoadUsePreferenceAvoidRoads, DtHumanRoadUsePreferenceIgnorePaths | vrfStatePropertyTypes.h | Legal values for the road use preference state property. Mirror any change to these in pathUtil.lua. |
DtScriptedTaskSidcVariable | vrfScriptedTasksConstants.h | Scripted task parameter variable sidc. |
DtXMLClampToTerrain | vrfRwTypes.h | XML element name clampSlotToTerrain. |
DtLuaNavFindExitPointJobType, DtLuaMultiAsyncJobType | asciiSerializable.h | Serialization type names for the new Lua job types. |
DtVrfFileParser::uuid2DataMap() | vrfFileParser.h | Returns the parsed UUID-to-data map. Populated when loadOrderOfBattleFile is called with parseToInternalBuffers true. |
DtAisTrack::addClassCounter(int), computeShipClass(), shipClass() | aisTrack.h | AIS class A/B determination from message type counts. |
The AIS binary file format version was raised from 01.10 to 01.11 to accommodate the ship class indicator, so AIS_FILE_VERSION in aisFileVersion.h changed value. Previously generated AIS binary files must be regenerated.
| Header | Breaking | Additions |
|---|---|---|
asciiSerializable.h | Type constants changed from const DtString to constexpr char[] | DtLuaNavFindExitPointJobType, DtLuaMultiAsyncJobType |
aisFileVersion.h | AIS_FILE_VERSION raised to 01.11 | None |
aisTrack.h | None | addClassCounter, computeShipClass, shipClass |
backend.h | scenarioRunId type change; runDurationTime renamed | scenarioFragment, lastSeenScenarioStatusGeneration |
entityTypeDictionaryManager.h | DtEntityTypeDictionaryManager moved here from vrfGuiCore, left makVrf, dropped DtVirtualBaseClass base | New header |
enumUtils.h | None | fullEntityTypeDescription |
extendedDataKeywords.h | None | DtEmbarkationPending |
formationTable.h | addFormation return type changed | None |
hitZoneId.h | None | DtHitZoneId and zone function constants |
iffGeneralSettings.h | None | operator= override |
iffMode5Settings.h | None | Reply, line test, and location data accessors |
msdlHierarchyPropertyMappings.h | DtSidcCode renamed DtSidc; addSidcCode renamed addSidc | None |
periodicSnapshotSettings.h | enabled/setEnabled renamed; constructor extended | Checkpoint accessors |
predefinedEntityTypes.h | DtTDLReportEntityType removed | DtSpiderWebEntityType |
profiler.h | None | Callstack depth control; setStartupTracyWithoutCollect |
rwColor.h | None | setAbgr, abgr |
rwHitZone.h, rwHitZoneList.h | None | DtRwHitZone, DtRwHitZoneList |
rwIndividualLifeFormWeaponStateType.h | None | theXmlType, xmlType, environment getData |
rwLocationReference.h | None | setObjectAndVector |
rwNameReservationConfig.h | None | DtRwObjectNameReservationConfig, DtRwNameReservationConfig |
rwNavigationProfile.h | None | semanticTagsThatPreventTransitionPoints |
rwNavigationProfileFeatureEntry.h | None | setAltitudeBuffer, altitudeBuffer |
rwNavigationSignalFlagVector.h | None | Signal flag and halyard enums, conversions, DtRwNavigationSignalFlagVector |
rwScriptInformation.h | None | tickWhileDestroyed, tickImmediately |
rwSensorContactInfo.h | Detection time defaults changed from 0 to -1 | contactSidc, operator!= |
rwUUID.h | No longer includes <boost/uuid/uuid.hpp> | None |
scenario.h | Run duration renamed; random number seed removed; start-time API replaced | getSelf stream overloads |
scenarioBatchRecord.h | Run duration renamed; random number seed override removed | None |
scenarioCapabilities.h | Capability enum and helpers moved here from vrfmsgs/ifStatus.h | New header |
scenarioExplorer.h | Run duration renamed; randomNumberSeed removed | hitZoneDamageParametersFilenames |
scenarioLoadManager.h | saveScenarioPiece pure virtual gained flags | None |
sidcReader.h | None | makVrf::DtSidcReader |
simResource.h | None | binVariable |
simSettingsObjectTypes.h | DtTDLMessagesEnabledName removed | None |
simulationModelSet.h | None | Hit zone damage parameters file accessors |
supplyEntry.h | None | bin, setBin |
terrainInterfaceConfig.h | useSoundingPoints removed | None |
trueAggregateRollUpHelper.h | rollUpValues and averageContributionFrom now public; construction serializes on a static mutex | None |
vrfCallbackQueue.h | None | setWarnQueueMinInterval, setWarnLabelMinInterval |
vrfFileParser.h | loadOrderOfBattleFile gained a parameter | uuid2DataMap |
vrfRwTypes.h | None | Hit zone, navigation signal flag, and clamp-to-terrain type names |
vrfScriptedTasksConstants.h | None | DtScriptedTaskSidcVariable |
vrfSimOptionsInterface.h | maximumObjectVertices added as a pure virtual | None |
vrfSingleton.h, vrfSingletonRoot.h | None | DtVrfSingleton, DtVrfSingletonRoot, REGISTER_SINGLETON |
vrfStatePropertyTypes.h | None | Damage point, navigation context, and road use preference constants |
vrfVlKeyboard.h | None | DtStdinIsInteractive |
Return to VR-Forces 5.3 API Migration Guide.
[Home]