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)
56 bool myIsRemoteAttachedObject;
57 DtEchelonId myEchelonId;
69 : DtFrameStateInterface(storage)
91 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 mutable boost::signals2::signal<void (const DtFrameStateInterface*)> signal_extendedDataModified{};
113 virtual const bool isVrfSimulatedObject()
const override;
114 virtual void setIsVrfSimulatedObject(
const bool&)
override;
116 virtual const DtString label()
const override;
117 virtual void setLabel(
const DtString&)
override;
119 virtual const DtString overlay()
const override;
120 virtual void setOverlay(
const DtString&)
override;
122 virtual const bool independentlyTasked()
const override;
123 virtual void setIndependentlyTasked(
const bool&)
override;
125 virtual const bool& isRemoteAttachedObject()
const override;
126 virtual void setIsRemoteAttachedObject(
const bool&)
override;
128 virtual const DtString engagementRules()
const override;
129 virtual void setEngagementRules(
const DtString&)
override;
131 virtual const bool isSubordinateOfForceLevel()
const override;
132 virtual void setIsSubordinateOfForceLevel(
const bool&)
override;
134 virtual const bool isTasked()
const override;
135 virtual void setIsTasked(
const bool&)
override;
137 virtual const bool underFire()
const override;
138 virtual void setUnderFire(
const bool&)
override;
140 virtual const bool executingPlan()
const override;
141 virtual void setExecutingPlan(
const bool&)
override;
143 virtual const bool hasPlan()
const override;
144 virtual void setHasPlan(
const bool&)
override;
146 virtual const bool sensorsKilled()
const override;
147 virtual void setSensorsKilled(
const bool&)
override;
149 virtual const DtEchelonId& echelonId()
const override;
150 virtual void setEchelonId(
const DtEchelonId&)
override;
152 virtual const int sessionId()
const override;
153 virtual void setSessionId(
const int&)
override;
155 virtual const int vrfMessageVersionSupported()
const override;
156 virtual void setVrfMessageVersionSupported(
const int&)
override;
158 virtual const ExtendedData& extendedData()
const override;
159 virtual void setExtendedData(
const ExtendedData&)
override;
160 virtual void setExtendedData(
const DtString& key,
const DtString& value)
override;
163 virtual void clearExtendedData()
override;
164 void updateExtendedData();
165 virtual void removeExtendedData(
const DtString& key)
override;
167 virtual bool activated()
const override;
170 virtual void makeWritable()
override;
173 virtual void makeReadOnly()
override;
177 return myExtendedDataModified;
182 myExtendedDataModified =
false;
185 virtual ExtendedData extendedDataMap()
const override;
186 virtual bool hasExtendedData(
const DtString&)
const override;
206 virtual const bool isVrfSimulatedObject()
const override;
207 virtual const DtString label()
const override;
208 virtual const DtString overlay()
const override;
209 virtual const bool independentlyTasked()
const override;
210 virtual const bool& isRemoteAttachedObject()
const override;
211 virtual const DtString engagementRules()
const override;
212 virtual const bool isSubordinateOfForceLevel()
const override;
213 virtual const bool isTasked()
const override;
214 virtual const bool underFire()
const override;
215 virtual const bool executingPlan()
const override;
216 virtual const bool hasPlan()
const override;
217 virtual const bool sensorsKilled()
const override;
218 virtual const DtEchelonId& echelonId()
const override;
219 virtual const int sessionId()
const override;
220 virtual const int vrfMessageVersionSupported()
const override;
221 virtual const ExtendedData& extendedData()
const override;
222 virtual bool activated()
const override;
223 bool readComponentValid()
const;
224 virtual ExtendedData extendedDataMap()
const override;
225 virtual bool hasExtendedData(
const DtString&)
const override;
229 virtual bool findReadComponent();
230 void handleExtendedDataUpdated(
const std::vector<UInt32>& attributesUpdated);
260 virtual void updateDataStorage()
override;
264 myCurrentFrameState.updateStateData(sd);
265 myNextFrameState.updateStateData(sd);
269 virtual bool forceAdvance()
override;
272 virtual void firstFrameAdvance()
override;
275 virtual void addAdditionalStateComponents()
override;
282 myCurrentFrameState.aboutToBeDeleted();
283 myNextFrameState.aboutToBeDeleted();
Instances of DtVrfObjectParameters are the readable/writeable objects that contain the information ne...
Definition: vrfObjectParameters.h:64
virtual void aboutToBeDeleted() override
Definition: vrfStateComponent.h:279
void clearExtendedDataModified()
Definition: vrfStateComponent.h:180
virtual const DtString & extendedData(const DtString &key) const
Definition: vrfStateComponent.h:92
Definition: stateDataTypes.h:23
DtVrfStateComponentCurrentFrame myCurrentFrameState
Definition: vrfStateComponent.h:287
void advanceFrame(const DtVrfStateComponentData &data)
Definition: vrfStateComponent.h:235
bool extendedDataModified() const
Definition: vrfStateComponent.h:175
ExtendedData myExtendedData
Definition: vrfStateComponent.h:190
DtVrfStateComponentData myData
Definition: vrfStateComponent.h:244
DtVrfStateComponentData()
Definition: vrfStateComponent.h:29
Definition: stateComponent.h:269
2) Define the next frame class. This will be used for write access.
Definition: vrfStateComponent.h:103
3) Define the current frame class. This will be used for read access.
Definition: vrfStateComponent.h:197
static tbb::spin_mutex theEchelonIdMutex
Definition: vrfStateComponent.h:23
Contains the DtUUID class declaration.
DtVrfStateComponentData myData
Definition: vrfStateComponent.h:193
DtVrfStateComponentNextFrame myNextFrameState
Definition: vrfStateComponent.h:288
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:110
virtual bool hasExtendedData(const DtString &) const
Definition: vrfStateComponent.h:96
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:62
const DtVrfStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: vrfStateComponent.h:204
#define UNDEFINED_CONST_METHOD(Type, Method,...)
Definition: doubleBufferedDataStorage.h:65
DtEchelonId myEchelonId
Definition: vrfStateComponent.h:191
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:398
virtual DtFrameStateInterface * nextFrameState() override
Definition: vrfStateComponent.h:257
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:231
bool myExtendedDataModified
Definition: vrfStateComponent.h:192
DtVrfStateComponentData & operator=(const DtVrfStateComponentData &rhs)
Definition: vrfStateComponent.h:40
virtual const DtFrameStateInterface * nextFrameState() const override
Definition: vrfStateComponent.h:258
virtual const DtFrameStateInterface * currentFrameState() const override
Definition: vrfStateComponent.h:256
virtual ExtendedData extendedDataMap() const
Definition: vrfStateComponent.h:95
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:384
bool myFoundComponent
Definition: vrfStateComponent.h:289
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: vrfStateComponent.h:249
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
virtual void aboutToBeDeleted()
virtual void clearExtendedData()
Definition: vrfStateComponent.h:93
ExtendedData myExtendedData
Definition: vrfStateComponent.h:242
DtEchelonId myEchelonId
Definition: vrfStateComponent.h:57
Definition: echelonId.h:13
VRF::WriteVrfStateComponentRepository myWriteVrfStateComponentRepository
Definition: vrfStateComponent.h:189
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
virtual void updateStateData(DtStateData *sd) override
Implement to update data storage to the new state data.
Definition: vrfStateComponent.h:262
#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
virtual void removeExtendedData(const DtString &key)
Definition: vrfStateComponent.h:94
DtVrfStateComponentData(const DtVrfStateComponentData &orig)
Definition: vrfStateComponent.h:34
unsigned int myCallbackHandle
Definition: vrfStateComponent.h:243
Contains the DtStateComponent class declaration.
Definition: stateComponent.h:76
DtVrfStateComponentData & frameState()
Definition: vrfStateComponent.h:111
bool myIsRemoteAttachedObject
Definition: vrfStateComponent.h:56
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:294
std::map< DtString, DtString > ExtendedData
Definition: vrfStateComponent.h:65
bool isDoubleBuffered()
Definition: vrfStateComponent.h:255
VRF::ReadVrfStateComponentRepository myReadVrfStateComponentRepository
Definition: vrfStateComponent.h:241