VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
DtSpotReportAutoEnabler Class Reference

DtSpotReportAutoEnabler — automatically sends DtSetSpotReportingRequestEnableToGuiIfOff to entities whose force or UUID appears in an active role's contactsFromForce or contactsFromUUID perspective fields.

This ensures that entities relevant to role-based contact-report views have spot reporting enabled to the front-end without disturbing entities that are already configured to report.

Life cycle:

  1. Construct with a reference to the VRF remote controller.
  2. Call initialize() with the setting value.
  3. Call onRoleDefinitionsChanged() whenever the active role definition changes.
  4. Call onEntityAdded() for each newly-discovered simulation entity.
  5. Call shutdown() before destroying the remote controller.

Thread safety: all methods must be called from the VRF update thread only.

Public Member Functions

 DtSpotReportAutoEnabler (makVrf::DtVrlinkVrfRemoteController &remoteController)
 
 DtSpotReportAutoEnabler (const DtSpotReportAutoEnabler &)=delete
 
DtSpotReportAutoEnabler & operator= (const DtSpotReportAutoEnabler &)=delete
 
void initialize (bool enabled)
 
void shutdown ()
 
void onRoleDefinitionsChanged (const std::vector< DtRoleDefinition > &roles, const DtWebServerObjectList &trackedObjects)
 
void onEntityAdded (const DtWebServerObjectPtr &obj)
 
void onScenarioChanged ()
 

Private Member Functions

bool isEntityEligible (int forceType, const DtUUID &uuid) const
 
void sendEnableRequest (const DtUUID &uuid)
 

Private Attributes

makVrf::DtVrlinkVrfRemoteController & myRemoteController
 
bool myEnabled = false
 
std::set< int > myEligibleForces
 
std::set< DtUUID > myEligibleUuids
 
std::set< DtUUID > mySentUuids
 

Constructor & Destructor Documentation

DtSpotReportAutoEnabler::DtSpotReportAutoEnabler ( makVrf::DtVrlinkVrfRemoteController &  remoteController)
explicit
DtSpotReportAutoEnabler::DtSpotReportAutoEnabler ( const DtSpotReportAutoEnabler &  )
delete

Member Function Documentation

DtSpotReportAutoEnabler& DtSpotReportAutoEnabler::operator= ( const DtSpotReportAutoEnabler &  )
delete
void DtSpotReportAutoEnabler::initialize ( bool  enabled)

Arm or disarm the auto-enabler. When disabled, all other calls are no-ops.

void DtSpotReportAutoEnabler::shutdown ( )

Clear internal state. Must be called before the remote controller is destroyed.

void DtSpotReportAutoEnabler::onRoleDefinitionsChanged ( const std::vector< DtRoleDefinition > &  roles,
const DtWebServerObjectList &  trackedObjects 
)

Re-evaluate eligibility based on the current set of active role definitions. Sends requests to any newly-eligible entities already present in trackedObjects.

void DtSpotReportAutoEnabler::onEntityAdded ( const DtWebServerObjectPtr &  obj)

Evaluate a newly-discovered entity and send the request if eligible.

void DtSpotReportAutoEnabler::onScenarioChanged ( )

Clear the sent-tracking set so that entities reappearing after a scenario reload will be re-evaluated. Call from a scenario-changed listener.

bool DtSpotReportAutoEnabler::isEntityEligible ( int  forceType,
const DtUUID &  uuid 
) const
private

Returns true if the given force type or UUID is in the eligible sets.

void DtSpotReportAutoEnabler::sendEnableRequest ( const DtUUID &  uuid)
private

Sends DtSetSpotReportingRequestEnableToGuiIfOff to the given entity.

Member Data Documentation

makVrf::DtVrlinkVrfRemoteController& DtSpotReportAutoEnabler::myRemoteController
private
bool DtSpotReportAutoEnabler::myEnabled = false
private
std::set<int> DtSpotReportAutoEnabler::myEligibleForces
private

Union of all contactsFromForce values across active role definitions.

std::set<DtUUID> DtSpotReportAutoEnabler::myEligibleUuids
private

Union of all contactsFromUUID values across active role definitions.

std::set<DtUUID> DtSpotReportAutoEnabler::mySentUuids
private

UUIDs that have already been sent the enable request in this session.


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

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)