VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vrfStateData Library API Changes

Table of Contents

This document describes the public API changes in the vrfStateData library between VR-Forces 5.2 and 5.3.

The library defines the state component model — the double-buffered current-frame / next-frame state that GUI code, plug-ins, and back-end simulation code read entity state from — plus the templates and macros used to declare custom state components.

The bulk of the change in 5.3 falls into four areas:

  1. A new sidc (symbol identification code) property was added to the simulated-object state component interface, which forces every concrete frame class derived from it to implement two new virtual methods.
  2. Two new state component types (laser light and search light) were added, with corresponding enumerators and headers.
  3. The kinematic state classes gained a debug parameter on many virtual methods, and DtRwVrfKinematicState dropped several redundant overrides.
  4. makVrv::DtUniqueID was purged from the spot report and typed dictionary APIs in favour of DtUUID and plain integer types, removing a vrvCore dependency from these public headers.

The majority of the roughly seventy modified headers changed only in comments or Doxygen markup. Headers whose only changes were non-API are not listed here.

Breaking Changes

DtSimulatedObjectStateComponent gained a sidc accessor and mutator

DtSimulatedObjectStateComponent declares a new property for the symbol identification code used for visual display:

// 5.3, simulatedObjectStateComponent.h

The UNDEFINED_RETURNREF_ACCESSOR_MUTATOR macro expands to a virtual const DtString& sidc() const and a virtual void setSidc(const DtString&), both of which throw DtUnimplementedMethod in the base class. Any class that derives from DtSimulatedObjectStateComponent and is expected to serve as a concrete current-frame or next-frame state must now override these. Existing derived classes that do not override them will compile, but will throw at run time if the accessors are reached.

All in-tree concrete frame classes were updated. The current-frame classes implement only sidc(); the next-frame classes implement both. Components for which the property is not meaningful (spot reports, aerodromes, METOC services, ORBAT entries) implement stubs that return an empty string.

Class Header Implements
DtEntityStateComponentNextFrameTemplate entityStateComponent.h sidc, setSidc
DtEntityStateComponentCurrentFrameTemplate entityStateComponent.h sidc
DtEnvironmentalStateComponentNextFrame environmentalStateComponent.h sidc, setSidc
DtEnvironmentalStateComponentCurrentFrame environmentalStateComponent.h sidc
DtOrbatStateComponentNextFrame orbatStateComponent.h sidc, setSidc (stub)
DtOrbatStateComponentCurrentFrame orbatStateComponent.h sidc (stub)
DtAerodromeStateComponentNextFrame aerodromeStateComponent.h sidc, setSidc (stub)
DtAerodromeStateComponentCurrentFrame aerodromeStateComponent.h sidc (stub)
DtMetocServiceStateComponentNextFrame metocServiceStateComponent.h sidc, setSidc (stub)
DtMetocServiceStateComponentCurrentFrame metocServiceStateComponent.h sidc (stub)
DtSpotReportStateComponentNextFrame spotReportStateComponent.h sidc, setSidc (stub)
DtSpotReportStateComponentCurrentFrame spotReportStateComponent.h sidc (stub)
DtStateDataSimulatedObjectStateComponent stateDataSimulatedObjectStateComponent.h sidc, setSidc

The corresponding data structs also gained a sidc field, declared with DEFINE_ACCESSOR_MUTATOR(DtString, sidc, Sidc): DtEntityStateComponentData, DtEnvironmentalStateComponentData, and DtSpotReportStateComponentData. Code that constructs these structs by aggregate initialisation or that compares them member-by-member must account for the new field.

DtStateData::entityId changed return type

// 5.2
DtEntityIdentifier entityId() const;
// 5.3
const DtEntityIdentifier& entityId() const;

Call sites that bind the result to auto now get a reference rather than a copy. Where the returned identifier is retained past the point at which the state data may be advanced or destroyed, copy it explicitly:

DtEntityIdentifier id = stateData->entityId(); // explicit copy

DtStateData::entityType() and DtStateData::objectType() swapped roles at the same time — entityType() is now the primary implementation and objectType() forwards to it. Both still return DtEntityType by value, so no call site changes are required.

DtSpotReportStateComponent observer API now uses DtUUID

spotReportStateComponent.h no longer includes <vrvCore/DtUniqueID.h>. Every observer method that took or returned a makVrv::DtUniqueID now uses DtUUID:

// 5.2
virtual bool addObservedBy(const makVrv::DtUniqueID& s, double simTime);
virtual void removeObservedBy(const makVrv::DtUniqueID& s);
virtual bool observedBy(const makVrv::DtUniqueID& s) const;
virtual const std::map<makVrv::DtUniqueID, double>& observedBy() const;
// 5.3
virtual bool addObservedBy(const DtUUID& s, double simTime);
virtual void removeObservedBy(const DtUUID& s);
virtual bool observedBy(const DtUUID& s) const;
virtual const std::map<DtUUID, double>& observedBy() const;

The change applies to DtSpotReportStateComponent, DtSpotReportStateComponentNextFrame, DtSpotReportStateComponentCurrentFrame, and to the same methods on DtSpotReportStateComponentData. Overriding classes must update their signatures or the overrides will silently stop overriding.

DtSpotReportStateComponent members removed

The following accessors and mutators were removed from DtSpotReportStateComponent and from both frame classes, along with the matching fields and accessors on DtSpotReportStateComponentData:

Removed 5.2 declaration Notes
visualHandlerType() / setVisualHandlerType(const std::string&) No replacement
dataHandlerType() / setDataHandlerType(const std::string&) No replacement
isTDLReport() / setIsTDLReport(const bool&) No replacement

TDL-specific spot report handling is no longer expressed through the state component. Store equivalent information in the report's DtSimpleTypedDictionary if your application needs it.

DtStateDataWrapper::isTDLReport removed

// 5.2
bool isSpotReport() const;
bool isTDLReport() const;
// 5.3
bool isSpotReport() const;

isSpotReport() is unchanged. There is no replacement for isTDLReport().

DtSimpleTypedDictionary no longer depends on vrvCore

simpleTypedDictionary.h dropped its <vrvCore/DtUniqueID.h> includes. Two members changed signature as a result:

// 5.2
void setValue(const std::string& k, makVrv::DtUniqueID v);
makVrv::DtElementID elementIDValue(const std::string& k) const;
// 5.3
void setValue(const std::string& k, unsigned long long v);
unsigned long long elementIDValue(const std::string& k) const;

The stored string representation is unchanged, so dictionaries written by 5.2 are read correctly by 5.3. Call sites that passed a makVrv::DtUniqueID must convert to unsigned long long, and call sites that assigned the result of elementIDValue to a makVrv::DtElementID must change the variable type. Code that relied on this header transitively providing makVrv::DtUniqueID must now include <vrvCore/DtUniqueID.h> directly.

DtTimeAndDateStateComponent scenario start-time properties removed

Two properties were removed from the interface, from both frame classes, and from DtTimeAndDateStateComponentData:

Removed 5.2 declaration
int scenarioStartTimeAtLocalOnFirstObjectCreationToTime() const
void setScenarioStartTimeAtLocalOnFirstObjectCreationToTime(const int&)
bool scenarioStartTimeIsLocal() const
void setScenarioStartTimeIsLocal(const bool&)

The remaining timeToLocalOnFirstPlacement / alreadySetTimePlacement / canSetScenarioPreStartTime properties carry the surviving behaviour. The default value of myScenarioStartTimeAtLocalOnFirstObjectCreationToTime (36000 seconds) is gone with it; the component's default date and time of day is still 43200 seconds.

DtRwSimKinematicState virtual signatures gained a debug parameter

Several core kinematic accessors and mutators acquired a trailing bool debug = false argument. Existing call sites compile unchanged because the argument is defaulted, but any class that overrides these methods must update its signature, otherwise the override is silently lost and the base class implementation is used at run time.

5.2 declaration 5.3 declaration
virtual const DtVector& worldPosition() const virtual const DtVector& worldPosition(bool debug = false) const
virtual void setWorldPosition(const DtVector&) virtual void setWorldPosition(const DtVector&, bool debug = false)
virtual const DtVector& setWorldPositionFromParent() virtual const DtVector& setWorldPositionFromParent(bool debug = false)
virtual const DtVector& worldVelocity() const virtual const DtVector& worldVelocity(bool debug = false) const
virtual void setWorldVelocity(const DtVector&, bool recomputeSpeed = true) virtual void setWorldVelocity(const DtVector&, bool recomputeSpeed = true, bool debug = false)
virtual void setParentPosition(const DtVector&) virtual void setParentPosition(const DtVector&, bool debug = false)
virtual void setParentVelocity(const DtVector&, bool recomputeSpeed = true) virtual void setParentVelocity(const DtVector&, bool recomputeSpeed = true, bool debug = false)

DtRwVrfKinematicState signature changes and removed overrides

DtRwVrfKinematicState follows the same debug pattern for its local- and relative-frame methods:

5.2 declaration 5.3 declaration
virtual void setLocalPosition(const DtVector&) virtual void setLocalPosition(const DtVector&, bool debug = false)
virtual const DtVector& localVelocity() const virtual const DtVector& localVelocity(bool debug = false) const
virtual void setLocalVelocity(const DtVector&, bool recomputeSpeed = true) virtual void setLocalVelocity(const DtVector&, bool recomputeSpeed = true, bool debug = false)
virtual const DtVector& relativeVelocity() const virtual const DtVector& relativeVelocity(bool debug = false) const
virtual void setRelativeVelocity(const DtVector&, bool recomputeSpeed = true) virtual void setRelativeVelocity(const DtVector&, bool recomputeSpeed = true, bool debug = false)

In addition, three overrides were removed from DtRwVrfKinematicState. The methods themselves are still available through DtRwSimKinematicState, so ordinary call sites are unaffected; only code that called the derived-class version explicitly (for example ks.DtRwVrfKinematicState::worldVelocity()) needs to change.

// removed from DtRwVrfKinematicState in 5.3
virtual const DtVector& worldVelocity() const override;
virtual const DtVector& worldAcceleration() const override;
virtual DtVector bodyVelocity() const override;

setWorldOrientationMatrix and setWorldAcceleration remain overridden, and setLocalOrientationMatrix is no longer declared with a redundant override alongside the world variant. The relative-state validation helpers (invalidateRelativeVelocity, validateRelativeVelocity, invalidateRelativeAcceleration, validateRelativeAcceleration) and localVV() moved within the class declaration but retain their public access and signatures.

DtSensorFieldOfViewStateComponent::host changed return type

// 5.2
UNDEFINED_RETURNVALUE_ACCESSOR(DtUUID, host) // const DtUUID host() const
virtual const DtUUID host() const override;
// 5.3
UNDEFINED_RETURNREF_ACCESSOR(DtUUID, host) // const DtUUID& host() const
virtual const DtUUID& host() const override;

This affects DtSensorFieldOfViewStateComponent, DtSensorFieldOfViewStateComponentNextFrame, and DtSensorFieldOfViewStateComponentCurrentFrame. Derived classes that override host() must change the return type to const DtUUID&.

DtSensorFieldOfViewStateComponent is now fully double-buffered

sensorFieldOfViewStateComponent.h introduces a DtSensorFieldOfViewStateComponentData frame-state struct, and both frame classes now expose frameState():

// 5.3
const DtSensorFieldOfViewStateComponentData& frameState() const;
DtSensorFieldOfViewStateComponentData& frameState(); // next frame only

DtSensorFieldOfViewStateComponentImplementation::updateDataStorage() now guards the promotion with myNextFrameState.isWritable() and calls advanceFrame() on the current-frame object. Previously the targeted entity was copied unconditionally. Code that relied on the targeted entity being propagated for read-only (remote) components must obtain it from the Legion read repository instead.

DtStateDataManager::reserve is no longer cumulative

reserve(unsigned int) now behaves as a high-water mark rather than a running total. In 5.2 two successive calls of reserve(1000) produced capacity for 2000 entities; in 5.3 the second call is a no-op. Pass the total required capacity in a single call:

// 5.2 idiom
mgr->reserve(1000);
mgr->reserve(1000); // total 2000
// 5.3
mgr->reserve(2000);

The method is still not thread safe.

Additions

New state component type enumerators

DtStateComponent::StateComponentTypeEnum in stateComponent.h gained two enumerators. No enumerators were removed, and no existing value changed, so plug-ins that persist numeric component types remain compatible.

Enumerator Value Status
LaserLightStateComponent 33 Added
SearchLightStateComponent 34 Added
UserStateComponent 64 Unchanged — user components still start here

stateDataTypes.h itself has no API changes in 5.3; the SimStateID, UInt64, UInt32, UInt8, Bool, and DtInstanceUpdatedCallback type aliases, the DtUnimplementedMethod and DtUnknownStateComponent types, InvalidSimStateID, and the COMPONENT_TYPE / CREATOR_TYPE macros are all unchanged.

laserLightStateComponent.h

The new header defines a state component for entity-mounted laser light emitters. It follows the standard four-class pattern — DtLaserLightStateComponent (interface), DtLaserLightStateComponentNextFrame (write), DtLaserLightStateComponentCurrentFrame (read), DtLaserLightStateComponentImplementation (double-buffered) — plus DtLaserLightStateComponentData and the DtLaserLightStateComponentCreator typedef.

The interface exposes three groups of properties:

Group Accessors
Laser light signal / setSignal (unsigned), spread / setSpread (radians), wavelength / setWavelength (nanometers)
Aimable system powerOn / setPowerOn, trackingMode / setTrackingMode, laserId / setLaserId (DtString), relativeOrientation / setRelativeOrientation (DtTaitBryan), targetedLocation / setTargetedLocation (geocentric), targetedRelativeLocation / setTargetedRelativeLocation, targetedEntity / setTargetedEntity (DtUUID)
Embedded system host() (const DtUUID&), entityId() (const DtEntityIdentifier&), relativeLocation / setRelativeLocation
auto* laser = stateData->nextFrameStateComponent<DtLaserLightStateComponentNextFrame>();
laser->setPowerOn(true);
laser->setWavelength(1064.0);
laser->setTargetedEntity(targetUuid);

Register the component in the usual way with REGISTER_STATE_COMPONENT(DtLaserLightStateComponentCreator, DtLaserLightStateComponentImplementation).

searchLightStateComponent.h

The new header defines a state component for steerable search lights. It has the same class structure and the same aimable-system and embedded-system property groups as the laser light component, with a different first group:

Group Accessors
Search light lightType / setLightType (unsigned), color / setColor (packed RGBA), intensity / setIntensity, range / setRange (meters), coneAngle / setConeAngle (radians)
Aimable system powerOn, trackingMode, searchId (DtString), relativeOrientation, targetedLocation, targetedRelativeLocation, targetedEntity
Embedded system host(), entityId(), relativeLocation / setRelativeLocation

The supporting types are DtSearchLightStateComponentData and DtSearchLightStateComponentCreator.

trueAggregateRollUp.h

The new header moves the true-aggregate property roll-up logic into vrfStateData so that it can be shared between the GUI and the web server. It declares two classes in the global namespace.

DtTrueAggregateRollUp derives from DtTrueAggregateRollUpHelper and rolls state and parameter properties up an aggregate hierarchy:

{
public:
typedef std::set<const makVrf::DtStateDataWrapper*> Leafs;
virtual void parameterData(const makVrf::DtStateDataWrapper* state, DtRwProperties&) const;
virtual void parameterData(const std::set<const makVrf::DtStateDataWrapper*>&, DtRwProperties&) const;
virtual void leafNodes(const makVrf::DtStateDataWrapper* state, Leafs&,
bool includePseudoAggregates = false) const;
virtual void statePropertiesFor(const makVrf::DtStateDataWrapper* state, DtRwProperties&) const;
virtual void statePropertiesContainedIn(const Leafs&, DtRwProperties&) const;
void statePropertiesFor(const std::set<const makVrf::DtStateDataWrapper*>& ids,
DtRwProperties& parameters) const;
virtual bool hasStateProperties(const makVrf::DtStateDataWrapper*) const;
virtual bool hasStateProperty(const makVrf::DtStateDataWrapper*, const std::string& statePropName) const;
};

Numeric properties are summed across the leaf nodes. String and boolean properties that agree across all leaves are preserved; those that disagree are marked read-only or dropped.

DtTrueAggregateRollUpFunctor is the abstract callback interface that supplies UUID-to-wrapper lookup and parameter property resolution, allowing the roll-up to run in either the GUI or the web server without depending on GUI-specific identifier types:

{
public:
virtual void parameterPropertiesFor(DtTrueAggregateRollUp::Leafs& leafs,
DtRwProperties& parameters) const = 0;
virtual const makVrf::DtStateDataWrapper* lookup(const DtUUID& id) const = 0;
virtual std::set<const makVrf::DtStateDataWrapper*> lookup(const std::set<DtUUID>& ids) const = 0;
virtual bool isValid(const DtUUID& id) const;
virtual bool isValid(const makVrf::DtStateDataWrapper* state) const = 0;
};

DtFrameStateInterface removal marking

DtFrameStateInterface gained a pair of accessors that let a component be flagged for removal while still physically present in the frame state tables:

void setMarkedForRemoval(bool b);
bool markedForRemoval() const;

The flag is honoured by DtExternalFrameStateInterface::getStateComponentList<T>() and DtExternalNextFrameState::getStateComponentList<T>(), which now skip entries whose markedForRemoval() is true. Code that counts components through numComponents() and then indexes with getStateComponent(type, index) will still see the marked entries; prefer getStateComponentList<T>() when the marked entries should be excluded.

DtStateData additions

void setSidc(const DtString&);
const DtString& sidc() const;
bool ownsComponents() const;

signal_uuidChanged is now declared mutable, so it can be connected to from a const DtStateData.

DtStateDataWrapper additions

const DtRwProperties& parameterProperties() const;
const DtString& sidc() const;

parameterProperties() complements the existing stateProperties() accessor and returns the parameter (base) property record used by the true-aggregate roll-up described above.

DtSimObjectReferenceTemplate::entityType

DtEntityType entityType() const;

simObjectReferenceTemplate.h now includes <vlpi/entityType.h> to support the new method. The implementation in simObjectReferenceTemplate.inl returns a default-constructed DtEntityType when the reference is null, so the method is safe to call on an invalid reference.

DtVrfGeometryStateComponent additions

virtual const DtString& markingText() const;
virtual void setMaximumVertices(unsigned maxVertices);

setMaximumVertices throws DtUnimplementedMethod on the interface and is implemented by DtVrfGeometryStateComponentNextFrame. Use it to bound the vertex count of multi-point tactical graphics and environmental objects.

Location components expose marking text

DtEntityLocationStateComponentInterface gained UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(DtString, markingText, MarkingText), and both DtEntityLocationStateComponent and DtEnvironmentalLocationStateComponent implement virtual const DtString& markingText() const by delegating to the owning DtStateData. This lets diagnostic code identify an entity from a location component without first resolving the simulated object state component.

DtAisDataStateComponent ship class

A ship class property was added to the AIS data component:

// interface
UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(DtAisShipClass, shipClass, ShipClass)
// next frame
virtual const DtAisShipClass shipClass() const override;
virtual void setShipClass(const DtAisShipClass&) override;
// current frame
virtual const DtAisShipClass shipClass() const override;

DtAisDataStateComponentData gained a matching shipClass / setShipClass pair and a myShipClass field that defaults to DtAisShipClass_A.

DtGateLock::signal_gateAboutToBeUnlocked

dataGate.h adds a third static signal alongside signal_gateLocked and signal_gateUnlocked:

static boost::signals2::signal<void()> signal_gateAboutToBeUnlocked;

Connect to it to run work that must complete while the gate is still held, before readers are released.

DtEnvironmentalStateComponentImplementation::initializeFromParameters

The environmental state component implementation now overrides initializeFromParameters:

virtual void initializeFromParameters(const DtVrfObjectParameters*) override;

Classes deriving from DtEnvironmentalStateComponentImplementation that also override this method must call the base implementation.

DtSpotReportStateComponentData comparison operators

bool operator==(const DtSpotReportStateComponentData& rhs) const;
bool operator!=(const DtSpotReportStateComponentData& rhs) const;

The comparison covers every field, including the new sidc. It does not include the removed visualHandlerType, dataHandlerType, or isTDLReport fields.

Summary of Header Changes

Header Breaking Additions
aisDataStateComponent.h None shipClass / setShipClass on interface, both frames, and data
dataGate.h None DtGateLock::signal_gateAboutToBeUnlocked
entityLocationStateComponent.h None markingText accessor/mutator on the interface and component
entityStateComponent.h / .inl Must implement sidc / setSidc sidc on data struct and both frame templates
environmentalLocationStateComponent.h None markingText()
environmentalStateComponent.h Must implement sidc / setSidc sidc on data and both frames; initializeFromParameters override
aerodromeStateComponent.h, metocServiceStateComponent.h, orbatStateComponent.h Must implement sidc / setSidc None
rwSimKinematicState.h debug parameter added to seven virtual methods None
rwVrfKinematicState.h debug parameter added to five virtual methods; worldVelocity, worldAcceleration, bodyVelocity overrides removed None
searchLightStateComponent.h New header DtSearchLightStateComponent family
laserLightStateComponent.h New header DtLaserLightStateComponent family
sensorFieldOfViewStateComponent.h host() returns const DtUUID&; updateDataStorage now guarded DtSensorFieldOfViewStateComponentData; powerOn, targetedRelativeLocation, entityId(); frameState()
simObjectReferenceTemplate.h / .inl None entityType()
simpleTypedDictionary.h setValue and elementIDValue no longer use makVrv types; vrvCore include removed None
simulatedObjectStateComponent.h New sidc / setSidc virtuals on the base interface None
spotReportStateComponent.h Observer API uses DtUUID; visualHandlerType, dataHandlerType, isTDLReport removed; vrvCore include removed sidc; operator== / operator!= on the data struct
stateComponent.h None LaserLightStateComponent and SearchLightStateComponent enumerators; setMarkedForRemoval / markedForRemoval on DtFrameStateInterface
stateData.h entityId() returns const DtEntityIdentifier&; getStateComponentList filters removal-marked components setSidc / sidc; ownsComponents(); signal_uuidChanged now mutable
stateDataManager.h reserve() is a high-water mark, not cumulative None
stateDataSimulatedObjectStateComponent.h Must implement sidc / setSidc sidc / setSidc
stateDataWrapper.h isTDLReport() removed parameterProperties(); sidc()
timeAndDateStateComponent.h scenarioStartTimeAtLocalOnFirstObjectCreationToTime and scenarioStartTimeIsLocal removed None
trueAggregateRollUp.h New header DtTrueAggregateRollUp, DtTrueAggregateRollUpFunctor
vrfGeometryStateComponent.h None markingText(); setMaximumVertices()
simObjectManagerTemplate.h / .inl, stateComponentFactory.h, stateComponentImplementationTemplate.h, stateDataTypes.h, vrfStateComponent.h, doubleBufferedDataStorage.h None None

Return to VR-Forces 5.3 API Migration Guide.

[Home]


Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)