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"
22 class DtVrfStateComponentDataStore;
27 : myIsRemoteAttachedObject(false)
32 : myIsRemoteAttachedObject(orig.myIsRemoteAttachedObject)
33 , myEchelonId(orig.myEchelonId)
49 bool myIsRemoteAttachedObject;
50 DtEchelonId myEchelonId;
62 : DtFrameStateInterface(storage)
84 virtual
void setExtendedData(const DtString& key, const DtString& value) {
throw DtUnimplementedMethod(
"setExtendedData(const DtString& key, const DtString& value) is not implemented for this class"); };
88 virtual ExtendedData extendedDataMap()
const {
throw DtUnimplementedMethod(
"extendedDataMap() is not implemented for this class"); };
91 mutable boost::signals2::signal<void (const DtFrameStateInterface*)> signal_extendedDataModified;
105 const bool isVrfSimulatedObject()
const;
106 void setIsVrfSimulatedObject(
const bool&);
114 const bool independentlyTasked()
const;
115 void setIndependentlyTasked(
const bool&);
117 const bool& isRemoteAttachedObject()
const;
118 void setIsRemoteAttachedObject(
const bool&);
120 const DtString engagementRules()
const;
121 void setEngagementRules(
const DtString&);
123 const bool isSubordinateOfForceLevel()
const;
124 void setIsSubordinateOfForceLevel(
const bool&);
126 const bool isTasked()
const;
127 void setIsTasked(
const bool&);
129 const bool underFire()
const;
130 void setUnderFire(
const bool&);
132 const bool executingPlan()
const;
133 void setExecutingPlan(
const bool&);
135 const bool hasPlan()
const;
136 void setHasPlan(
const bool&);
138 const bool sensorsKilled()
const;
139 void setSensorsKilled(
const bool&);
144 const int sessionId()
const;
145 void setSessionId(
const int&);
147 const int vrfMessageVersionSupported()
const;
148 void setVrfMessageVersionSupported(
const int&);
150 const ExtendedData& extendedData()
const;
151 void setExtendedData(
const ExtendedData&);
155 void clearExtendedData();
156 void updateExtendedData();
157 void removeExtendedData(
const DtString& key);
159 bool activated()
const;
162 virtual void makeWritable();
165 virtual void makeReadOnly();
169 return myExtendedDataModified;
174 myExtendedDataModified =
false;
177 ExtendedData extendedDataMap()
const;
199 const bool isVrfSimulatedObject()
const;
202 const bool independentlyTasked()
const;
203 const bool& isRemoteAttachedObject()
const;
204 const DtString engagementRules()
const;
205 const bool isSubordinateOfForceLevel()
const;
206 const bool isTasked()
const;
207 const bool underFire()
const;
208 const bool executingPlan()
const;
209 const bool hasPlan()
const;
210 const bool sensorsKilled()
const;
212 const int sessionId()
const;
213 const int vrfMessageVersionSupported()
const;
214 const ExtendedData& extendedData()
const;
215 bool activated()
const;
216 bool readComponentValid()
const;
217 ExtendedData extendedDataMap()
const;
221 virtual bool findReadComponent();
222 void handleExtendedDataUpdated(
const std::vector<UInt32>& attributesUpdated);
253 void updateDataStorage();
257 myCurrentFrameState.updateStateData(sd);
258 myNextFrameState.updateStateData(sd);
262 virtual bool forceAdvance();
265 virtual void firstFrameAdvance()
override;
268 virtual void addAdditionalStateComponents()
override;
275 myCurrentFrameState.aboutToBeDeleted();
276 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:272
void clearExtendedDataModified()
Definition: vrfStateComponent.h:172
virtual const DtString & extendedData(const DtString &key) const
Definition: vrfStateComponent.h:85
Definition: stateDataTypes.h:23
DtVrfStateComponentCurrentFrame myCurrentFrameState
Definition: vrfStateComponent.h:280
void advanceFrame(const DtVrfStateComponentData &data)
Definition: vrfStateComponent.h:227
bool extendedDataModified() const
Definition: vrfStateComponent.h:167
ExtendedData myExtendedData
Definition: vrfStateComponent.h:181
const DtFrameStateInterface * currentFrameState() const
Definition: vrfStateComponent.h:249
DtVrfStateComponentData myData
Definition: vrfStateComponent.h:237
DtVrfStateComponentData()
Definition: vrfStateComponent.h:26
Definition: stateComponent.h:257
2) Define the next frame class. This will be used for write access.
Definition: vrfStateComponent.h:95
3) Define the current frame class. This will be used for read access.
Definition: vrfStateComponent.h:190
Contains the DtUUID class declaration.
DtVrfStateComponentData myData
Definition: vrfStateComponent.h:185
DtVrfStateComponentNextFrame myNextFrameState
Definition: vrfStateComponent.h:281
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:102
DtStateData * myStateData
Definition: vrfStateComponent.h:184
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:55
const DtVrfStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: vrfStateComponent.h:197
#define UNDEFINED_CONST_METHOD(Type, Method,...)
Definition: doubleBufferedDataStorage.h:65
DtEchelonId myEchelonId
Definition: vrfStateComponent.h:182
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:336
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:219
bool myExtendedDataModified
Definition: vrfStateComponent.h:183
DtVrfStateComponentData & operator=(const DtVrfStateComponentData &rhs)
Definition: vrfStateComponent.h:37
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:370
bool myFoundComponent
Definition: vrfStateComponent.h:282
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: vrfStateComponent.h:242
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
virtual void aboutToBeDeleted()
virtual void clearExtendedData()
Definition: vrfStateComponent.h:86
DtStateData * myStateData
Definition: vrfStateComponent.h:236
ExtendedData myExtendedData
Definition: vrfStateComponent.h:234
DtEchelonId myEchelonId
Definition: vrfStateComponent.h:50
Definition: echelonId.h:13
VRF::WriteVrfStateComponentRepository myWriteVrfStateComponentRepository
Definition: vrfStateComponent.h:180
#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:24
#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
bool myFirstOverlaySet
Definition: vrfStateComponent.h:186
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:287
virtual void removeExtendedData(const DtString &key)
Definition: vrfStateComponent.h:87
virtual DtFrameStateInterface * nextFrameState()
Definition: vrfStateComponent.h:250
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: vrfStateComponent.h:255
DtVrfStateComponentData(const DtVrfStateComponentData &orig)
Definition: vrfStateComponent.h:31
unsigned int myCallbackHandle
Definition: vrfStateComponent.h:235
Contains the DtStateComponent class declaration.
Definition: stateComponent.h:71
DtVrfStateComponentData & frameState()
Definition: vrfStateComponent.h:103
bool myIsRemoteAttachedObject
Definition: vrfStateComponent.h:49
virtual const DtFrameStateInterface * nextFrameState() const
Definition: vrfStateComponent.h:251
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:282
std::map< DtString, DtString > ExtendedData
Definition: vrfStateComponent.h:58
bool isDoubleBuffered()
Definition: vrfStateComponent.h:248
VRF::ReadVrfStateComponentRepository myReadVrfStateComponentRepository
Definition: vrfStateComponent.h:233