13 #include <vlutil/vlTime.h>
14 #include "legionDataStore/writeStateInstance.h"
15 #include "legionDataStore/readStateInstance.h"
16 #include "legionDataStore/view.h"
17 #include "vrfOM/sets/readVrfStateComponentRepository.hpp"
18 #include "vrfOM/sets/writeVrfStateComponentRepository.hpp"
19 #include <tbb/spin_mutex.h>
23 class DtVrfStateComponentDataStore;
30 : myIsRemoteAttachedObject(false)
35 : myIsRemoteAttachedObject(orig.myIsRemoteAttachedObject)
36 , myEchelonId(orig.myEchelonId)
37 , myLabel(orig.myLabel)
59 bool myIsRemoteAttachedObject;
60 DtEchelonId myEchelonId;
73 : DtFrameStateInterface(storage)
95 virtual
void setExtendedData(const DtString& key, const DtString& value) {
throw DtUnimplementedMethod(
"setExtendedData(const DtString& key, const DtString& value) is not implemented for this class"); };
99 virtual ExtendedData extendedDataMap()
const {
throw DtUnimplementedMethod(
"extendedDataMap() is not implemented for this class"); };
102 mutable boost::signals2::signal<void (const DtFrameStateInterface*)> signal_extendedDataModified;
116 const bool isVrfSimulatedObject()
const;
117 void setIsVrfSimulatedObject(
const bool&);
125 const bool independentlyTasked()
const;
126 void setIndependentlyTasked(
const bool&);
128 const bool& isRemoteAttachedObject()
const;
129 void setIsRemoteAttachedObject(
const bool&);
131 const DtString engagementRules()
const;
132 void setEngagementRules(
const DtString&);
134 const bool isSubordinateOfForceLevel()
const;
135 void setIsSubordinateOfForceLevel(
const bool&);
137 const bool isTasked()
const;
138 void setIsTasked(
const bool&);
140 const bool underFire()
const;
141 void setUnderFire(
const bool&);
143 const bool executingPlan()
const;
144 void setExecutingPlan(
const bool&);
146 const bool hasPlan()
const;
147 void setHasPlan(
const bool&);
149 const bool sensorsKilled()
const;
150 void setSensorsKilled(
const bool&);
155 const int sessionId()
const;
156 void setSessionId(
const int&);
158 const int vrfMessageVersionSupported()
const;
159 void setVrfMessageVersionSupported(
const int&);
161 const ExtendedData& extendedData()
const;
162 void setExtendedData(
const ExtendedData&);
166 void clearExtendedData();
167 void updateExtendedData();
168 void removeExtendedData(
const DtString& key);
170 bool activated()
const;
173 virtual void makeWritable();
176 virtual void makeReadOnly();
180 return myExtendedDataModified;
185 myExtendedDataModified =
false;
188 ExtendedData extendedDataMap()
const;
209 const bool isVrfSimulatedObject()
const;
212 const bool independentlyTasked()
const;
213 const bool& isRemoteAttachedObject()
const;
214 const DtString engagementRules()
const;
215 const bool isSubordinateOfForceLevel()
const;
216 const bool isTasked()
const;
217 const bool underFire()
const;
218 const bool executingPlan()
const;
219 const bool hasPlan()
const;
220 const bool sensorsKilled()
const;
222 const int sessionId()
const;
223 const int vrfMessageVersionSupported()
const;
224 const ExtendedData& extendedData()
const;
225 bool activated()
const;
226 bool readComponentValid()
const;
227 ExtendedData extendedDataMap()
const;
231 virtual bool findReadComponent();
232 void handleExtendedDataUpdated(
const std::vector<UInt32>& attributesUpdated);
263 void updateDataStorage();
267 myCurrentFrameState.updateStateData(sd);
268 myNextFrameState.updateStateData(sd);
272 virtual bool forceAdvance();
275 virtual void firstFrameAdvance()
override;
278 virtual void addAdditionalStateComponents()
override;
285 myCurrentFrameState.aboutToBeDeleted();
286 myNextFrameState.aboutToBeDeleted();
Instances of DtVrfObjectParameters are the readable/writeable objects that contain the information ne...
Definition: vrfObjectParameters.h:63
virtual void aboutToBeDeleted() override
Definition: vrfStateComponent.h:282
void clearExtendedDataModified()
Definition: vrfStateComponent.h:183
virtual const DtString & extendedData(const DtString &key) const
Definition: vrfStateComponent.h:96
Definition: stateDataTypes.h:23
DtVrfStateComponentCurrentFrame myCurrentFrameState
Definition: vrfStateComponent.h:290
void advanceFrame(const DtVrfStateComponentData &data)
Definition: vrfStateComponent.h:237
bool extendedDataModified() const
Definition: vrfStateComponent.h:178
ExtendedData myExtendedData
Definition: vrfStateComponent.h:192
const DtFrameStateInterface * currentFrameState() const
Definition: vrfStateComponent.h:259
DtVrfStateComponentData myData
Definition: vrfStateComponent.h:247
DtVrfStateComponentData()
Definition: vrfStateComponent.h:29
Definition: stateComponent.h:266
DtString myLabel
Definition: vrfStateComponent.h:61
2) Define the next frame class. This will be used for write access.
Definition: vrfStateComponent.h:106
3) Define the current frame class. This will be used for read access.
Definition: vrfStateComponent.h:200
static tbb::spin_mutex theEchelonIdMutex
Definition: vrfStateComponent.h:23
Contains the DtUUID class declaration.
DtVrfStateComponentData myData
Definition: vrfStateComponent.h:196
DtVrfStateComponentNextFrame myNextFrameState
Definition: vrfStateComponent.h:291
const DtVrfStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: vrfStateComponent.h:113
DtStateData * myStateData
Definition: vrfStateComponent.h:195
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: vrfStateComponent.h:66
const DtVrfStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: vrfStateComponent.h:207
#define UNDEFINED_CONST_METHOD(Type, Method,...)
Definition: doubleBufferedDataStorage.h:65
DtEchelonId myEchelonId
Definition: vrfStateComponent.h:193
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:339
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:228
bool myExtendedDataModified
Definition: vrfStateComponent.h:194
DtVrfStateComponentData & operator=(const DtVrfStateComponentData &rhs)
Definition: vrfStateComponent.h:41
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:379
bool myFoundComponent
Definition: vrfStateComponent.h:292
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: vrfStateComponent.h:252
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
virtual void aboutToBeDeleted()
virtual void clearExtendedData()
Definition: vrfStateComponent.h:97
DtStateData * myStateData
Definition: vrfStateComponent.h:246
ExtendedData myExtendedData
Definition: vrfStateComponent.h:244
DtEchelonId myEchelonId
Definition: vrfStateComponent.h:60
Definition: echelonId.h:13
VRF::WriteVrfStateComponentRepository myWriteVrfStateComponentRepository
Definition: vrfStateComponent.h:191
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
Definition: vrfStateComponent.h:27
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:26
DtStateComponentCreator< DtVrfStateComponentImplementation, false > DtVrfStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: vrfStateComponent.h:297
virtual void removeExtendedData(const DtString &key)
Definition: vrfStateComponent.h:98
virtual DtFrameStateInterface * nextFrameState()
Definition: vrfStateComponent.h:260
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: vrfStateComponent.h:265
DtVrfStateComponentData(const DtVrfStateComponentData &orig)
Definition: vrfStateComponent.h:34
unsigned int myCallbackHandle
Definition: vrfStateComponent.h:245
Contains the DtStateComponent class declaration.
Definition: stateComponent.h:73
DtVrfStateComponentData & frameState()
Definition: vrfStateComponent.h:114
bool myIsRemoteAttachedObject
Definition: vrfStateComponent.h:59
virtual const DtFrameStateInterface * nextFrameState() const
Definition: vrfStateComponent.h:261
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:291
std::map< DtString, DtString > ExtendedData
Definition: vrfStateComponent.h:69
bool isDoubleBuffered()
Definition: vrfStateComponent.h:258
VRF::ReadVrfStateComponentRepository myReadVrfStateComponentRepository
Definition: vrfStateComponent.h:243