VR-Forces 4.8 Class Documentation
 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"
19 
22 class DtSimReport;
26 class DtSimMessage;
27 class DtVrfObjectMessage;
28 class DtSettingsObject;
29 class DtBoolSetting;
30 
49 {
50 private:
58 public:
59 
63  DtSimManager* simManager, DtComponentDescriptor* desc=0,
64  DtReaderWriterRegistry *parentRegistry=0);
65 
68 
72  virtual bool init();
73 
76  virtual const char* type() const;
77 
81  virtual void tick();
82 
84  static void setSpotReportingCallback(DtSimMessage * msg, void * usr);
85 
86  virtual void processSetSpotReporting(DtSimMessage * msg);
87 
91  virtual void setLocalEnabled(bool on);
92 
100  virtual void setGlobalEnabledOverridingLocal();
101 
104  virtual void resendSpotReports(unsigned long requestId);
105 
109  static DtSimComponent * creator(const DtString& name,
110  DtVrfObject* owner,
111  DtSimManager* simManager,
112  DtComponentDescriptor* desc = 0,
113  DtReaderWriterRegistry* parentRegistry = 0);
114 
115 protected:
116 
121  virtual void turnSpotReportingOn();
122  virtual void turnSpotReportingOff();
124 
126  virtual bool createPorts();
127 
133  virtual bool createPSR();
134 
137  static void objectAboutToBeRemovedCallback(const DtVrfObject* object, void* usr);
138  virtual void processObjectAboutToBeRemoved(const DtVrfObject* 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 
193  virtual void sendSpotReports(const std::vector<DtSimReport*>& spotReports, bool superiorOnly);
194 
196  virtual void sendStopSpottingReports(const std::set<DtUUID>& stoppedSpotting);
197 
203  virtual bool spotReportNeedsUpdateAndResend(const DtSpotReport& spotRep,
204  const DtRwSensorContactInfo& contact, DtSpotReport::Reason& reason) const;
205 
208  virtual double heartbeatDeltaFor(const DtSpotReport& spotRep,
209  const DtRwSensorContactInfo& contact) const;
210 
217  virtual const DtSimReportMessageType& spotReportTypeString() const;
218 
225  virtual const DtSimReportMessageType& stopSpottingReportTypeString() const;
226 
230  static void settingConsumerCallback(const DtSettingsObject* settingsObject,
231  void* usr);
234  virtual void readGlobalEnabledSetting(const DtBoolSetting* enabledSetting);
235 
238 
239  static void hostilitiesChangedCallback(DtU8 force, void* usr);
240  virtual void processHostilitiesChanged(DtU8 force);
242 
247  virtual bool reportingEnabled() const;
248 
252  virtual bool checkSpotReportUpdateConditions(const DtSpotReport& spotRep,
253  const DtRwSensorContactInfo& contact, DtSpotReport::Reason& reason) const;
254 
257  virtual bool checkDeltaDistanceConditions(const DtSpotReport& spotRep,
258  const DtRwSensorContactInfo& contact) const;
259 
261  virtual bool checkDeltaHeartbeatConditions(const DtSpotReport& spotRep,
262  const DtRwSensorContactInfo& contact) const;
263 
265  virtual bool entityHasUpdateRate(const DtRwSensorContactInfo& contactInfo) const;
266 
268  virtual void timedTick();
269 
271  static void objectAddedCb(const DtVrfObject*, void* usr);
272  virtual void processObjectAdded(const DtVrfObject*);
273 
274  static void requestSpotReportsCallback(DtSimMessage* msg, void* usr);
275  virtual void processRequestSpotReports(DtSimMessage* msg);
276 
278  virtual void processSetRemoteSensorReceiver(DtSimMessage* msg);
279 
281  static void setRemoteSensorReceiverCallback(DtSimMessage* msg, void* usr);
282 
283 protected:
284 
293 
294  DtObjectTypesListOutputPort* myTypesToDetectOutputPort;
302 
305 
309 
312 
316 
320 
322 
324 
325  typedef std::map<DtUUID, std::vector<unsigned long> > MissingDestroyedObjectsMap;
327 };
328 
UUID is a unique ID wrapper class.
Definition: rwUUID.h:222
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
const DtSpotReportGeneratorControllerDescriptor * myDescriptor
Pointer to this components descriptor.
Definition: spotReportGeneratorController.h:304
bool myGlobalEnabled
Holds a copy of the global spot reports enabled setting.
Definition: spotReportGeneratorController.h:319
const DtControllerComponent & operator=(const DtControllerComponent &orig)
assignment operator
std::map< DtUUID, std::vector< unsigned long > > MissingDestroyedObjectsMap
Definition: spotReportGeneratorController.h:325
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.
virtual const char * type() const =0
This returns a string from compTypes.h, and identifies the type of component.
Reason
Definition: spotReport.h:38
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:42
Definition: readerWriterRegistry.h:39
This class represents the data gathered by a sensor about a particular single sensor contact...
Definition: rwSensorContactInfo.h:67
virtual bool init()
Calls setRadio()
Definition: settingsObject.h:27
File: sensorContactListIOPort.h.
Definition: sensorContactListIOPort.h:31
Process State Repository for DtSpotReportGeneratorController.
Definition: spotReportGeneratorControllerPSR.h:19
File: simMsg.h.
Definition: simMessage.h:35
double myLastHeartbeatTime
Definition: spotReportGeneratorController.h:321
virtual void tick()
This gives the thread of control to the component.
Instances of DtObjectTypesListOutputPort are output ports through which data producers can send a lis...
Definition: objectTypesListIOPort.h:46
MissingDestroyedObjectsMap myMissingDestroyedObjectsMap
Definition: spotReportGeneratorController.h:326
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.
Definition: vrfObjectMessage.h:30
This class is for monitoring a DtSensorContactInfoList for changes.
Definition: sensorContactInfoList.h:143
virtual bool createPorts()
Called by init.
int myCurrentForceType
Definition: spotReportGeneratorController.h:310
bool myHostilitiesChangeFlag
Flag which gets set to true when hostilities changed, and cleared the following tick.
Definition: spotReportGeneratorController.h:315
End User Description: DtControllerComponent is the base class for all controllers components...
Definition: controllerComponent.h:29
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
DtSensorContactInfoListChangeMonitor myContactListMonitor
Definition: spotReportGeneratorController.h:311
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
bool myNeedsSpotReportFlush
Definition: spotReportGeneratorController.h:323
DtSpotReportGeneratorControllerPSR * myProcessState
Container for state data associated with this component.
Definition: spotReportGeneratorController.h:308
DtSpotReportGeneratorController is a controller that sends spot reports based on the contact list in ...
Definition: spotReportGeneratorController.h:48
DtSpotReport; subclass of DtSimReport.
Definition: spotReport.h:35
DtSimReport is an abstract base class from which real reports can derive.
Definition: simReport.h:26

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)