VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
spotReportGeneratorController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 #pragma once
12 
15 #include <list>
18 #include "vrftasks/spotReport.h"
20 
23 class DtSimReport;
27 class DtSimMessage;
28 class DtVrfObjectMessage;
29 class DtSettingsObject;
30 class DtBoolSetting;
31 
50 {
51 private:
59 public:
60 
64  DtSimulationServices* simManager, DtComponentDescriptor* desc=0,
65  DtReaderWriterRegistry *parentRegistry=0);
66 
69 
73  virtual bool init();
74 
77  virtual const char* type() const;
78 
82  virtual void tick();
83 
85  static void setSpotReportingCallback(DtSimMessage * msg, void * usr);
86 
87  virtual void processSetSpotReporting(DtSimMessage * msg);
88 
92  virtual void setLocalEnabled(bool on);
93 
101  virtual void setGlobalEnabledOverridingLocal();
102 
105  virtual void resendSpotReports(unsigned long requestId);
106 
110  static DtSimComponent * creator(const DtString& name,
111  DtLocalObject* owner,
112  DtSimulationServices* simManager,
113  DtComponentDescriptor* desc = 0,
114  DtReaderWriterRegistry* parentRegistry = 0);
115 
116 protected:
117 
122  virtual void turnSpotReportingOn();
123  virtual void turnSpotReportingOff();
125 
127  virtual bool createPorts();
128 
134  virtual bool createPSR();
135 
138  virtual void processObjectAboutToBeRemoved(const DtSimObject* object);
139 
141  virtual void registerRadioMessageCallbacks();
142 
146  virtual void sendDestroyedReports(unsigned long resendId, bool queueMissing = false);
147 
151  virtual DtSpotReport* createDestroyedReport(unsigned long resendId, const DtUUID& entity, bool& objectIsNoLongerDestroyed);
152 
163  virtual void generateAndSendSpotReports();
164 
172  virtual bool isTypeAndForceForReport(
173  DtRwSensorContactInfo* contact);
174 
179  virtual DtSpotReport* createSpotReportForContact(
180  const DtRwSensorContactInfo& contactInfo);
181 
183  virtual void updateSpotReportForContact(DtSpotReport& spotReport,
184  const DtRwSensorContactInfo& contact);
185 
190  virtual void sendSpotReport(DtSpotReport& spotReport, bool superiorOnly);
191 
192  std::vector<DtUUID> getSpotReportSuperiorPeers();
193 
195  virtual void sendSpotReports(const std::vector<DtSimReport*>& spotReports, bool superiorOnly);
196 
198  virtual void sendStopSpottingReports(const std::set<DtUUID>& stoppedSpotting);
199 
205  virtual bool spotReportNeedsUpdateAndResend(const DtSpotReport& spotRep,
206  const DtRwSensorContactInfo& contact, DtSpotReport::Reason& reason) const;
207 
210  virtual double heartbeatDeltaFor(const DtSpotReport& spotRep,
211  const DtRwSensorContactInfo& contact) const;
212 
219  virtual const DtSimReportMessageType& spotReportTypeString() const;
220 
227  virtual const DtSimReportMessageType& stopSpottingReportTypeString() const;
228 
232  static void settingConsumerCallback(const DtSettingsObject* settingsObject,
233  void* usr);
236  virtual void readGlobalEnabledSetting(const DtBoolSetting* enabledSetting);
237 
240 
241  static void hostilitiesChangedCallback(DtU8 force, void* usr);
242  virtual void processHostilitiesChanged(DtU8 force);
244 
249  virtual bool reportingEnabled() const;
250 
254  virtual bool checkSpotReportUpdateConditions(const DtSpotReport& spotRep,
255  const DtRwSensorContactInfo& contact, DtSpotReport::Reason& reason) const;
256 
259  virtual bool checkDeltaDistanceConditions(const DtSpotReport& spotRep,
260  const DtRwSensorContactInfo& contact) const;
261 
263  virtual bool checkDeltaHeartbeatConditions(const DtSpotReport& spotRep,
264  const DtRwSensorContactInfo& contact) const;
265 
267  virtual bool entityHasUpdateRate(const DtRwSensorContactInfo& contactInfo) const;
268 
270  virtual void timedTick();
271 
273  virtual void processSimObjectAdded(DtSimObjectReference);
274 
275  static void requestSpotReportsCallback(DtSimMessage* msg, void* usr);
276  virtual void processRequestSpotReports(DtSimMessage* msg);
277 
279  virtual void processSetRemoteSensorReceiver(DtSimMessage* msg);
280 
282  static void setRemoteSensorReceiverCallback(DtSimMessage* msg, void* usr);
283 
284 protected:
285 
294 
295  DtObjectTypesListOutputPort* myTypesToDetectOutputPort;
303 
306 
310 
313 
317 
321 
323 
325 
326  typedef std::map<DtUUID, std::vector<unsigned long> > MissingDestroyedObjectsMap;
328 
329  typedef std::map<DtUUID, boost::signals2::connection> RemovalSignalsMap;
331 
332  boost::signals2::scoped_connection mySimObjectAddedConnection;
333 };
334 
UUID is a unique ID wrapper class.
Definition: rwUUID.h:226
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
const DtSpotReportGeneratorControllerDescriptor * myDescriptor
Pointer to this components descriptor.
Definition: spotReportGeneratorController.h:305
bool myGlobalEnabled
Holds a copy of the global spot reports enabled setting. When the global value changes, this value will be updated by.
Definition: spotReportGeneratorController.h:320
const DtControllerComponent & operator=(const DtControllerComponent &orig)
assignment operator
std::map< DtUUID, std::vector< unsigned long > > MissingDestroyedObjectsMap
Definition: spotReportGeneratorController.h:326
Definition: boolSetting.h:30
DtSpotReportGeneratorControllerDescriptor; descriptor for the DtSpotReportGeneratorController compone...
Definition: spotReportGeneratorControllerDescriptor.h:23
virtual void timedTick()
This version of tick checks to see if the time to tick has arrived. It checks to see if myNextTickTim...
virtual const char * type() const =0
This returns a string from compTypes.h, and identifies the type of component.
Reason
Definition: spotReport.h:38
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
Definition: vrfObjectMessageTypeTemplate.h:24
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
This class represents the data gathered by a sensor about a particular single sensor contact...
Definition: rwSensorContactInfo.h:68
virtual bool init()
Calls setRadio()
RemovalSignalsMap myRemovalSignalsMap
Definition: spotReportGeneratorController.h:330
Definition: settingsObject.h:27
File: sensorContactListIOPort.h.
Definition: sensorContactListIOPort.h:31
Process State Repository for DtSpotReportGeneratorController.
Definition: spotReportGeneratorControllerPSR.h:19
std::map< DtUUID, boost::signals2::connection > RemovalSignalsMap
Definition: spotReportGeneratorController.h:329
File: simMsg.h.
Definition: simMessage.h:35
double myLastHeartbeatTime
Definition: spotReportGeneratorController.h:322
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
Instances of DtObjectTypesListOutputPort are output ports through which data producers can send a lis...
Definition: objectTypesListIOPort.h:46
MissingDestroyedObjectsMap myMissingDestroyedObjectsMap
Definition: spotReportGeneratorController.h:327
Define constants for types of tasks, sets, admin messages, reports, and sim commands (all sent via ra...
The base class for all messages to/from a specific DtVrfObject. Various subclasses of this class will...
Definition: vrfObjectMessage.h:30
This class is for monitoring a DtSensorContactInfoList for changes. When instantiated, this class registers a callback with the list, and maintains internal state as to whether the callback has been invoked since the last time listChanged() was called.
Definition: sensorContactInfoList.h:145
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
int myCurrentForceType
Definition: spotReportGeneratorController.h:311
bool myHostilitiesChangeFlag
Flag which gets set to true when hostilities changed, and cleared the following tick.
Definition: spotReportGeneratorController.h:316
End User Description: DtControllerComponent is the base class for all controllers components...
Definition: controllerComponent.h:31
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:89
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:79
DtSensorContactInfoListChangeMonitor myContactListMonitor
Definition: spotReportGeneratorController.h:312
bool myNeedsSpotReportFlush
Definition: spotReportGeneratorController.h:324
DtSpotReportGeneratorControllerPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: spotReportGeneratorController.h:309
DtSpotReportGeneratorController is a controller that sends spot reports based on the contact list in ...
Definition: spotReportGeneratorController.h:49
boost::signals2::scoped_connection mySimObjectAddedConnection
Definition: spotReportGeneratorController.h:332
DtSpotReport; subclass of DtSimReport.
Definition: spotReport.h:35
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86
DtSimReport is an abstract base class from which real reports can derive. It manages the read/write c...
Definition: simReport.h:25

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)