VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aggregateMoveAlongPSR.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
11 
12 #pragma once
13 
15 #include "vrfobjcore/simObject.h"
17 #include <readerWriter/rwString.h>
18 #include <readerWriter/rwReal.h>
20 #include "vrfutil/rwStringList.h"
21 #include <readerWriter/rwBoolean.h>
22 #include <vrfutil/rwUUID.h>
25 
26 #include <set>
27 
34 {
36  {
37  DtSubordinateMoveAlongInfo() : promotionId(-1), taskTrackingNum(-1) {};
38  DtSubordinateMoveAlongInfo(int promId, int ttNum) : promotionId(promId), taskTrackingNum(ttNum) {};
39  int promotionId;
41  };
42 
43  typedef std::map<DtUUID, DtSubordinateMoveAlongInfo> DtUuidSubordinateInfoMap;
44  //typedef std::map<DtUUID, int> DtUUIDPromotionIdMap;
45  typedef std::map<int, DtUUID> DtPromotionIdUUIDMap;
46 
47 public:
48 
51  const DtString& rwName = DtString::nullString(),
52  DtReaderWriterRegistry* parentRegistry = 0);
53 
56  const DtString& rwName = DtString::nullString(),
57  DtReaderWriterRegistry* parentRegistry = 0);
58 
60  virtual ~DtAggregateMoveAlongPSR() override;
61 
64 
67  const DtString& rwName = DtString::nullString(),
68  DtReaderWriterRegistry* parentRegistry = 0) const override;
69 
73  virtual DtString type() const override;
74 
77  virtual void setPreviousPreferRoads(bool bYes);
78  virtual bool previousPreferRoads() const;
79  virtual bool previousPreferRoadsSpecified() const;
80  virtual void previousPreferRoadsUnsetSpecified();
82 
86  virtual void setRoute(const DtUUID& route);
87 
89  virtual DtSimObjectReference route() const;
91 
96  virtual void setTimeToNextMaintainFormationTick(DtTime simTime);
97  virtual DtTime timeToNextMaintainFormationTick() const;
99 
101  virtual DtUUID lookupRoute(int promotionId) const;
102 
104  virtual DtUUID lookupRoute(const DtUUID& subordinate) const;
105 
107  virtual void clearPromotionIdRouteList();
108 
110  virtual void addPromotionIdRouteEntry(int promotionId,
111  const DtUUID& route);
112 
114  virtual const DtPromotionIdUUIDMap& promotionIdRouteMap() const;
115 
117  virtual void addTaskedSubordinatePromotionIdEntry(
118  const DtUUID& subordinate, int promotionId, int taskTrackingNum);
119 
121  virtual void changeSubordinatePromotionId(
122  const DtUUID& subordinate, int newPromotionId);
123 
125  virtual void removeTaskedSubordinate(const DtUUID& subordiante);
126 
129  virtual bool isATaskedSubordinate(const DtUUID& subordinate);
130 
133  virtual bool isATaskedSubordinateWithTrackingNumber(const DtUUID& subordinate, int trackingNum) const;
134 
136  virtual void removeRoute(const DtUUID& route);
137 
139  virtual void clearTaskSubordinates();
140 
142  virtual bool taskedSubordinatesEmpty() const;
143 
146  virtual void setMovingToRoute(bool trueOrFalse);
147  virtual bool movingToRoute() const;
149 
151  virtual const DtUuidSubordinateInfoMap& taskedSubordinates() const;
152 
155  virtual void setRouteIsDiscovered(bool value);
156  virtual bool routeIsDiscovered() const;
158 
161  virtual void setIsGeneratingFormationRoutes(bool value);
162  virtual bool isGeneratingFormationRoutes() const;
164 
167  virtual void setIsReevaluatingFormationRoutes(bool value);
168  virtual bool isReevaluatingFormationRoutes() const;
170 
173  virtual void setSpeed(double aSpeed);
174  virtual double speed() const;
176 
180  virtual void setFormationName(const DtString& name);
181  virtual DtString formationName()const;
182 
184  virtual void setFormationLeader(const DtUUID& leader);
185  virtual DtUUID formationLeader() const;
186 
189  virtual void putSelf(std::string& fp, int indentLevel = 0,
190  bool writeUnspecified = false,
191  const DtFilename& path = DtReaderWriter::appPath()) override;
192 
195  virtual void getSelf(DtlObjPtr args, const SearchPaths& searchPaths,
196  const DtVariableBindingsList& variableBindings) override;
197 
199  static DtVrfProcessStateRepository* creator (const DtString& rwName,
200  DtLocalObject* vrfObject, DtReaderWriterRegistry* parentRegistry);
201 
202 protected:
203 
208 
211 
214 
217 
220 
226 
232 
236 
239 
243 
246 
249 
252 
255 
258 };
UUID is a unique ID wrapper class.
Definition: uuid.h:59
std::map< int, DtUUID > DtPromotionIdUUIDMap
Definition: aggregateMoveAlongPSR.h:45
Definition: aggregateMoveAlongPSR.h:35
virtual void getSelf(DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings) override
Top level to read itself from an input stream. searchPath is passed down to all DtReaderWriter member...
DtPromotionIdUUIDList myPromotionIdRouteList
Readable writeable list of promotion Id/route. Valid only immediately after getSelf() has been called...
Definition: aggregateMoveAlongPSR.h:225
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
Definition: readerWriterRegistry.h:39
Contains the DtUUID class declaration.
DtRwBoolean myIsGeneratingFormationRoutes
Flag indicating whether we are currently generating formation routes.
Definition: aggregateMoveAlongPSR.h:248
DtRwString myFormationName
The current formation name.
Definition: aggregateMoveAlongPSR.h:257
std::map< DtUUID, DtSubordinateMoveAlongInfo > DtUuidSubordinateInfoMap
Definition: aggregateMoveAlongPSR.h:43
DtSubordinateMoveAlongInfo()
Definition: aggregateMoveAlongPSR.h:37
DtUuidSubordinateInfoMap myCurrentlyTaskedSubordinates
Map of currently tasked subordinate object uuids to promotion Id.
Definition: aggregateMoveAlongPSR.h:213
uuid class
Definition: rwUUID.h:26
Specialized reader/writer version of the shared object reference that will encapsulate the actual sha...
Definition: rwSimObjectReference.h:21
DtRwSimObjectReference myRoute
Route the aggregate is currently moving along.
Definition: aggregateMoveAlongPSR.h:219
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
DtRwBoolean myRouteIsDiscovered
Flag indicating whether has been discovered or not.
Definition: aggregateMoveAlongPSR.h:245
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
int taskTrackingNum
Definition: aggregateMoveAlongPSR.h:40
virtual DtVrfProcessStateRepository * clone(const DtString &rwName=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=0) const =0
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
DtRwBoolean myMovingToRoute
Flag indicating whether we&#39;re in the moving to route phase of the task.
Definition: aggregateMoveAlongPSR.h:242
DtSubordinateMoveAlongInfo(int promId, int ttNum)
Definition: aggregateMoveAlongPSR.h:38
DtPromotionIdUUIDMap myPromotionIndexRouteMap
Map of promotion Ids (formation positions) to route uuids.
Definition: aggregateMoveAlongPSR.h:210
virtual void putSelf(std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
Top level call to write itself to file. If write unspecified is true, will write entries that are uns...
DtRwBoolean myPreviousPreferRoads
Cache the previous setting of internal state property &quot;UseRoads&quot;.
Definition: aggregateMoveAlongPSR.h:206
Description: Readable, Writable DtReal (double)
Definition: rwReal.h:27
DtRwReal mySpeed
Speed from task or ordered speed.
Definition: aggregateMoveAlongPSR.h:254
Class DtVrfProcessStateRepository: Abstract base class for all process state repositories. Process state repositories represent (potentially) shared, savable information for one or more components functioning together to achieve some process or set of processes; such as aiming and firing a weapon; moving an object; or just waiting a specified amount of time.
Definition: vrfProcessStateRepository.h:45
DtPromotionIdUUIDList myPromotionIdEntityList
Readable writeable list of promotion Id/entity. Valid only immediately after getSelf() has been calle...
Definition: aggregateMoveAlongPSR.h:231
Description: Readable, Writable bool.
Definition: rwBoolean.h:26
DtRwSubordinateMoveAlongInfoList mySubordinateInfoList
List of information on subordinates that are currently tasked to move along. This replaces myPromotio...
Definition: aggregateMoveAlongPSR.h:235
file aggregateMoveAlongPSR.h
Definition: aggregateMoveAlongPSR.h:33
virtual DtString type() const =0
Returns the string type of the repository, as defined in psrTypes.h.
DtRwReal myTimeToNextMaintainFormationTick
Time in seconds until next tick in which to perform formation monitoring.
Definition: aggregateMoveAlongPSR.h:238
static const DtFilename & appPath()
Gets the current working directory. The first time this accessor is called, it determines the current...
const DtVrfProcessStateRepository & operator=(const DtVrfProcessStateRepository &orig)
A locally simulated VRF object.
Definition: localObject.h:98
DtRwUUID myFormationLeader
The leader of the formation (for leadFollowInFormation)
Definition: aggregateMoveAlongPSR.h:216
DtRwBoolean myIsReevaluatingFormationRoutes
Flag indicating whether we are currently reevaluating formation routes.
Definition: aggregateMoveAlongPSR.h:251

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)