10 #include <vlpi/disEnums.h>
11 #include <legionStandardOM/sets/writeEntityRepository.hpp>
12 #include "legionStandardOM/sets/readEntityRepository.hpp"
13 #include "legionDataStore/view.h"
14 #include <tbb/spin_mutex.h>
18 class ReadEntityRepository;
30 : myUUID(
DtUUID::nullUUID())
32 , myCheckForNameReservation(true)
36 : myGlobalId(orig.myGlobalId)
38 , myMarkingText(orig.myMarkingText)
39 , myCallsign(orig.myCallsign)
40 , myEntityId(orig.myEntityId)
41 , myIsLocal(orig.myIsLocal)
42 , myCheckForNameReservation(orig.myCheckForNameReservation)
69 DtString myMarkingText;
71 DtEntityIdentifier myEntityId;
74 bool myCheckForNameReservation;
85 : DtSimulatedObjectStateComponent(storage)
86 , myUUIDColumn(0xFFFFFFFF)
87 , myIsClutterEntityColumn(0xFFFFFFFF)
97 virtual const std::set<DtUUID> attachments()
const {
throw DtUnimplementedMethod(
"std::set<DtUUID> attachments() is not implemented for this class."); };
100 virtual void removeAttachment(
const DtUUID&) {
throw DtUnimplementedMethod(
"void removeAttachment(const DtUUID&) is not implemented for this class."); };
102 mutable boost::signals2::signal<void (int oldState, int newState, makVrf::SimStateID)> signal_damageStateChanged;
114 template <
typename T_BaseComponent>
125 const bool& isLocal()
const;
126 void setIsLocal(
const bool&);
128 const bool& checkForNameReservation()
const;
129 void setCheckForNameReservation(
const bool&);
134 const DtUUID& uuid()
const;
135 void setUUID(
const DtUUID&);
137 const bool isClutterEntity()
const;
138 void setIsClutterEntity(
const bool&);
140 const DtString& markingText()
const;
141 void setMarkingText(
const DtString&);
146 const DtForceType forceType()
const;
147 void setForceType(
const DtForceType&);
149 const UInt32 appearanceBits()
const;
150 void setAppearanceBits(
const UInt32&);
152 const DtEntityType
entityType()
const {
return DtEntityType(objectType()); };
153 const DtObjectType objectType()
const;
154 void setEntityType(
const DtObjectType&);
157 const DtEntityIdentifier& entityId()
const;
158 void setEntityId(
const DtEntityIdentifier&);
160 const UInt32 capabilities()
const;
161 void setCapabilities(
const UInt32&);
163 const DtEntityType guise()
const;
164 void setGuise(
const DtEntityType&);
167 const DtUUID& superior()
const;
168 void setSuperior(
const DtUUID&);
170 virtual void setAppearance(
const DtAppearance& app);
173 virtual void makeWritable();
176 virtual void makeReadOnly();
188 template <
typename T_BaseComponent>
198 const bool& isLocal()
const;
199 const bool& checkForNameReservation()
const;
201 const DtUUID& uuid()
const;
202 const DtString& markingText()
const;
204 const DtForceType forceType()
const;
205 const DtEntityType
entityType()
const {
return DtEntityType(objectType()); };
206 const DtObjectType objectType()
const;
207 const DtEntityIdentifier& entityId()
const;
208 const UInt32 appearanceBits()
const;
209 const bool isClutterEntity()
const;
210 const UInt32 capabilities()
const;
211 const DtEntityType guise()
const;
213 const DtUUID& superior()
const;
218 void addAttachment(
const DtUUID&);
219 void removeAttachment(
const DtUUID&);
220 const std::set<DtUUID> attachments()
const;
223 bool checkForUpdatedItems();
226 const DtUUID _uuid()
const;
227 const DtString _markingText()
const;
228 const DtEntityIdentifier _entityId()
const;
230 bool checkEntityIdChanged();
231 bool checkUUIDChanged();
232 bool checkForceChanged();
233 bool checkMarkingTextChanged();
234 bool checkDamageStateChanged();
235 bool checkIsClutterChanged();
237 void handleDataUpdated(
const std::vector<UInt32>& attributesUpdated);
238 void completeSetup();
248 void setSuperior(
const DtUUID&);
281 void updateDataStorage();
285 myCurrentFrameState.updateStateData(sd);
286 myNextFrameState.updateStateData(sd);
289 static void addAdditionalTableColumns(Legion::SimulationDatabase*);
296 virtual void convertToRemote();
299 virtual void convertToLocal();
301 virtual void addAdditionalStateComponents()
override;
306 myCurrentFrameState.aboutToBeDeleted();
307 myNextFrameState.aboutToBeDeleted();
321 #define _ENTITY_STATE_COMPONENT 1
322 #include "vrfStateData/entityStateComponent.inl"
2) Define the next frame class. This will be used for write access.
Definition: entityStateComponent.h:115
UUID is a unique ID wrapper class.
Definition: uuid.h:59
boost::signals2::signal< void(const DtFrameStateInterface *)> signal_attachmentsChanged
Definition: entityStateComponent.h:103
unsigned int myCallbackHandle
Definition: entityStateComponent.h:256
Instances of DtVrfObjectParameters are the readable/writeable objects that contain the information ne...
Definition: vrfObjectParameters.h:63
unsigned int UInt32
Definition: stateDataTypes.h:18
LOM::WriteEntityRepository myWriteEntityStateRepository
Definition: entityStateComponent.h:179
const DtEntityType entityType() const
Definition: entityStateComponent.h:205
const DtEntityStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: entityStateComponent.h:122
Definition: stateDataTypes.h:23
DtString myMarkingText
Definition: entityStateComponent.h:69
tbb::spin_mutex myCompleteSetupMutex
Definition: entityStateComponent.h:262
DtEntityStateComponentCurrentFrameTemplate< DtEntityStateComponent > DtEntityStateComponentCurrentFrame
Definition: entityStateComponent.h:266
bool myCheckForNameReservation
Definition: entityStateComponent.h:74
bool myIsClutterEntity
Definition: entityStateComponent.h:257
int myForceId
Definition: entityStateComponent.h:254
Definition: stateComponent.h:62
virtual void addAttachment(const DtUUID &)
Definition: entityStateComponent.h:99
1) Define the interface class that will be used to represent the next and current frames...
Definition: entityStateComponent.h:79
DtStateData * myStateData
Definition: entityStateComponent.h:252
Definition: stateComponent.h:266
The DtSimulatedObjectStateComponent is an interface that all main components (those that are consider...
Definition: simulatedObjectStateComponent.h:21
UInt32 myIsClutterEntityColumn
Definition: entityStateComponent.h:110
DtEntityStateComponentData(const DtEntityStateComponentData &orig)
Definition: entityStateComponent.h:35
bool isDoubleBuffered()
Definition: entityStateComponent.h:276
boost::signals2::scoped_connection myCompleteSetupConnection
Definition: entityStateComponent.h:261
boost::signals2::signal< void(const DtUUID &oldSuperior, const DtUUID &newSuperior)> signal_superiorChanged
Definition: entityStateComponent.h:104
boost::signals2::signal< void(bool oldIsClutter, bool newIsClutter)> signal_isClutterChanged
Definition: entityStateComponent.h:105
virtual const DtFrameStateInterface * nextFrameState() const
Definition: entityStateComponent.h:279
const DtEntityStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: entityStateComponent.h:196
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: entityStateComponent.h:283
Definition: entityStateComponent.h:25
void advanceFrame(const DtEntityStateComponentData &data)
Definition: entityStateComponent.h:241
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: entityStateComponent.h:270
std::set< DtUUID > myAttachments
Definition: entityStateComponent.h:259
virtual void aboutToBeDeleted() override
Definition: entityStateComponent.h:303
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:339
DtEntityStateComponentData()
Definition: entityStateComponent.h:29
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:228
3) Define the current frame class. This will be used for read access.
Definition: entityStateComponent.h:189
DtString myGlobalId
Definition: entityStateComponent.h:68
boost::signals2::signal< void(const DtString &, const DtString &, makVrf::SimStateID)> signal_callsignChanged
Definition: entityStateComponent.h:106
DtEntityStateComponentNextFrame myNextFrameState
Definition: entityStateComponent.h:312
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:379
DtUUID mySuperior
Definition: entityStateComponent.h:253
DtEntityIdentifier myEntityId
Definition: entityStateComponent.h:71
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
virtual void aboutToBeDeleted()
LOM::ReadEntityRepository myReadEntityStateRepository
Definition: entityStateComponent.h:251
UInt32 myUUIDColumn
Definition: entityStateComponent.h:109
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
LOM::WriteEntityRepository myWriteEntityStateRepository
Definition: entityStateComponent.h:313
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
DtEntityStateComponentData myData
Definition: entityStateComponent.h:182
unsigned long long SimStateID
Definition: entityStateComponent.h:27
DtStateComponentCreator< DtEntityStateComponentImplementation > DtEntityStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: entityStateComponent.h:318
DtEntityStateComponentData myData
Definition: entityStateComponent.h:263
DtEntityStateComponentCurrentFrame myCurrentFrameState
Definition: entityStateComponent.h:311
DtString myCallsign
Definition: entityStateComponent.h:70
DtEntityStateComponentNextFrameTemplate< DtEntityStateComponent > DtEntityStateComponentNextFrame
Definition: entityStateComponent.h:185
Legion::WriteStateInstance writeStateInstance() override
Definition: entityStateComponent.h:293
#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
DtUUID myUUID
Definition: entityStateComponent.h:72
DtEntityStateComponentData & frameState()
Definition: entityStateComponent.h:123
virtual void setEntityType(const DtObjectType &ot)
Definition: entityStateComponent.h:98
void setEntityType(const DtEntityType &t)
Definition: entityStateComponent.h:155
DtStateData * myStateData
Definition: entityStateComponent.h:180
int myDamageState
Definition: entityStateComponent.h:255
DtEntityStateComponentData & operator=(const DtEntityStateComponentData &rhs)
Definition: entityStateComponent.h:46
virtual DtFrameStateInterface * nextFrameState()
Definition: entityStateComponent.h:278
bool myIsLocal
Definition: entityStateComponent.h:73
const DtFrameStateInterface * currentFrameState() const
Definition: entityStateComponent.h:277
DtUUID mySuperior
Definition: entityStateComponent.h:181
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:291
tbb::spin_rw_mutex myAttachmentsMutex
Definition: entityStateComponent.h:260
const DtEntityType entityType() const
Definition: entityStateComponent.h:152
This class holds the state data that represents each simulation object in the system.
Definition: stateDataManager.h:73