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"); };
95 virtual ExtendedData extendedDataMap()
const {
throw DtUnimplementedMethod(
"extendedDataMap() is not implemented for this class"); };
98 mutable boost::signals2::signal<void (const DtFrameStateInterface*)> signal_extendedDataModified;
112 const bool isVrfSimulatedObject()
const;
113 void setIsVrfSimulatedObject(
const bool&);
121 const bool independentlyTasked()
const;
122 void setIndependentlyTasked(
const bool&);
124 const bool& isRemoteAttachedObject()
const;
125 void setIsRemoteAttachedObject(
const bool&);
127 const DtString engagementRules()
const;
128 void setEngagementRules(
const DtString&);
130 const bool isSubordinateOfForceLevel()
const;
131 void setIsSubordinateOfForceLevel(
const bool&);
133 const bool isTasked()
const;
134 void setIsTasked(
const bool&);
136 const bool underFire()
const;
137 void setUnderFire(
const bool&);
139 const bool executingPlan()
const;
140 void setExecutingPlan(
const bool&);
142 const bool hasPlan()
const;
143 void setHasPlan(
const bool&);
145 const bool sensorsKilled()
const;
146 void setSensorsKilled(
const bool&);
151 const int sessionId()
const;
152 void setSessionId(
const int&);
154 const int vrfMessageVersionSupported()
const;
155 void setVrfMessageVersionSupported(
const int&);
157 const ExtendedData& extendedData()
const;
158 void setExtendedData(
const ExtendedData&);
162 void clearExtendedData();
163 void updateExtendedData();
164 void removeExtendedData(
const DtString& key);
166 bool activated()
const;
169 virtual void makeWritable();
172 virtual void makeReadOnly();
176 return myExtendedDataModified;
181 myExtendedDataModified =
false;
184 ExtendedData extendedDataMap()
const;
205 const bool isVrfSimulatedObject()
const;
208 const bool independentlyTasked()
const;
209 const bool& isRemoteAttachedObject()
const;
210 const DtString engagementRules()
const;
211 const bool isSubordinateOfForceLevel()
const;
212 const bool isTasked()
const;
213 const bool underFire()
const;
214 const bool executingPlan()
const;
215 const bool hasPlan()
const;
216 const bool sensorsKilled()
const;
218 const int sessionId()
const;
219 const int vrfMessageVersionSupported()
const;
220 const ExtendedData& extendedData()
const;
221 bool activated()
const;
222 bool readComponentValid()
const;
223 ExtendedData extendedDataMap()
const;
227 virtual bool findReadComponent();
228 void handleExtendedDataUpdated(
const std::vector<UInt32>& attributesUpdated);
259 void updateDataStorage();
263 myCurrentFrameState.updateStateData(sd);
264 myNextFrameState.updateStateData(sd);
268 virtual bool forceAdvance();
271 virtual void firstFrameAdvance()
override;
274 virtual void addAdditionalStateComponents()
override;
281 myCurrentFrameState.aboutToBeDeleted();
282 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:278
void clearExtendedDataModified()
Definition: vrfStateComponent.h:179
virtual const DtString & extendedData(const DtString &key) const
Definition: vrfStateComponent.h:92
Definition: stateDataTypes.h:23
DtVrfStateComponentCurrentFrame myCurrentFrameState
Definition: vrfStateComponent.h:286
void advanceFrame(const DtVrfStateComponentData &data)
Definition: vrfStateComponent.h:233
bool extendedDataModified() const
Definition: vrfStateComponent.h:174
ExtendedData myExtendedData
Definition: vrfStateComponent.h:188
const DtFrameStateInterface * currentFrameState() const
Definition: vrfStateComponent.h:255
DtVrfStateComponentData myData
Definition: vrfStateComponent.h:243
DtVrfStateComponentData()
Definition: vrfStateComponent.h:29
Definition: stateComponent.h:266
2) Define the next frame class. This will be used for write access.
Definition: vrfStateComponent.h:102
3) Define the current frame class. This will be used for read access.
Definition: vrfStateComponent.h:196
static tbb::spin_mutex theEchelonIdMutex
Definition: vrfStateComponent.h:23
Contains the DtUUID class declaration.
DtVrfStateComponentData myData
Definition: vrfStateComponent.h:192
DtVrfStateComponentNextFrame myNextFrameState
Definition: vrfStateComponent.h:287
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:109
DtStateData * myStateData
Definition: vrfStateComponent.h:191
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:203
#define UNDEFINED_CONST_METHOD(Type, Method,...)
Definition: doubleBufferedDataStorage.h:65
DtEchelonId myEchelonId
Definition: vrfStateComponent.h:189
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:190
DtVrfStateComponentData & operator=(const DtVrfStateComponentData &rhs)
Definition: vrfStateComponent.h:40
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:379
bool myFoundComponent
Definition: vrfStateComponent.h:288
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: vrfStateComponent.h:248
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
virtual void aboutToBeDeleted()
virtual void clearExtendedData()
Definition: vrfStateComponent.h:93
DtStateData * myStateData
Definition: vrfStateComponent.h:242
ExtendedData myExtendedData
Definition: vrfStateComponent.h:240
DtEchelonId myEchelonId
Definition: vrfStateComponent.h:57
Definition: echelonId.h:13
VRF::WriteVrfStateComponentRepository myWriteVrfStateComponentRepository
Definition: vrfStateComponent.h:187
#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:293
virtual void removeExtendedData(const DtString &key)
Definition: vrfStateComponent.h:94
virtual DtFrameStateInterface * nextFrameState()
Definition: vrfStateComponent.h:256
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: vrfStateComponent.h:261
DtVrfStateComponentData(const DtVrfStateComponentData &orig)
Definition: vrfStateComponent.h:34
unsigned int myCallbackHandle
Definition: vrfStateComponent.h:241
Contains the DtStateComponent class declaration.
Definition: stateComponent.h:73
DtVrfStateComponentData & frameState()
Definition: vrfStateComponent.h:110
bool myIsRemoteAttachedObject
Definition: vrfStateComponent.h:56
virtual const DtFrameStateInterface * nextFrameState() const
Definition: vrfStateComponent.h:257
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:65
bool isDoubleBuffered()
Definition: vrfStateComponent.h:254
VRF::ReadVrfStateComponentRepository myReadVrfStateComponentRepository
Definition: vrfStateComponent.h:239