VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
spotReportAutoEnabler.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  ******************************************************************************/
5 
6 #pragma once
7 
8 #include <set>
9 #include <vector>
10 #include "webServerObjectList.h"
11 #include "roleDefinitionStore.h"
12 #include <vrfutil/uuid.h>
13 
14 namespace makVrf { class DtVrlinkVrfRemoteController; }
15 
33 {
34 public:
36 
39 
41  void initialize(bool enabled);
42 
44  void shutdown();
45 
49  const std::vector<DtRoleDefinition>& roles,
50  const DtWebServerObjectList& trackedObjects);
51 
53  void onEntityAdded(const DtWebServerObjectPtr& obj);
54 
57  void onScenarioChanged();
58 
59 private:
61  bool isEntityEligible(int forceType, const DtUUID& uuid) const;
62 
64  void sendEnableRequest(const DtUUID& uuid);
65 
67  bool myEnabled = false;
68 
70  std::set<int> myEligibleForces;
71 
73  std::set<DtUUID> myEligibleUuids;
74 
76  std::set<DtUUID> mySentUuids;
77 };
UUID is a unique ID wrapper class.
Definition: uuid.h:59
void onScenarioChanged()
Clear the sent-tracking set so that entities reappearing after a scenario reload will be re-evaluated...
std::set< DtUUID > myEligibleUuids
Union of all contactsFromUUID values across active role definitions.
Definition: spotReportAutoEnabler.h:73
void 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 ne...
DtSpotReportAutoEnabler(makVrf::DtVrlinkVrfRemoteController &remoteController)
void onEntityAdded(const DtWebServerObjectPtr &obj)
Evaluate a newly-discovered entity and send the request if eligible.
std::set< DtUUID > mySentUuids
UUIDs that have already been sent the enable request in this session.
Definition: spotReportAutoEnabler.h:76
Contains the DtUUID class declaration.
makVrf::DtVrlinkVrfRemoteController & myRemoteController
Definition: spotReportAutoEnabler.h:66
DtSpotReportAutoEnabler & operator=(const DtSpotReportAutoEnabler &)=delete
bool isEntityEligible(int forceType, const DtUUID &uuid) const
Returns true if the given force type or UUID is in the eligible sets.
DtSpotReportAutoEnabler — automatically sends DtSetSpotReportingRequestEnableToGuiIfOff to entities w...
Definition: spotReportAutoEnabler.h:32
DtWebServerObjectList — thread-safe container for tracked VRF objects.
Definition: webServerObjectList.h:25
std::set< int > myEligibleForces
Union of all contactsFromForce values across active role definitions.
Definition: spotReportAutoEnabler.h:70
void sendEnableRequest(const DtUUID &uuid)
Sends DtSetSpotReportingRequestEnableToGuiIfOff to the given entity.
void initialize(bool enabled)
Arm or disarm the auto-enabler. When disabled, all other calls are no-ops.
void shutdown()
Clear internal state. Must be called before the remote controller is destroyed.
std::shared_ptr< DtWebServerObject > DtWebServerObjectPtr
Definition: webServerObject.h:90
bool myEnabled
Definition: spotReportAutoEnabler.h:67

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)