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())
35 : myGlobalId(orig.myGlobalId)
37 , myMarkingText(orig.myMarkingText)
38 , myEntityId(orig.myEntityId)
39 , myIsLocal(orig.myIsLocal)
62 DtString myMarkingText;
63 DtEntityIdentifier myEntityId;
76 : DtSimulatedObjectStateComponent(storage)
77 , myUUIDColumn(0xFFFFFFFF)
78 , myIsClutterEntityColumn(0xFFFFFFFF)
87 virtual const std::set<DtUUID> attachments()
const {
throw DtUnimplementedMethod(
"std::set<DtUUID> attachments() is not implemented for this class."); };
90 virtual void removeAttachment(
const DtUUID&) {
throw DtUnimplementedMethod(
"void removeAttachment(const DtUUID&) is not implemented for this class."); };
92 mutable boost::signals2::signal<void (int oldState, int newState, makVrf::SimStateID)> signal_damageStateChanged;
103 template <
typename T_BaseComponent>
114 const bool& isLocal()
const;
115 void setIsLocal(
const bool&);
120 const DtUUID& uuid()
const;
121 void setUUID(
const DtUUID&);
123 const bool isClutterEntity()
const;
124 void setIsClutterEntity(
const bool&);
126 const DtString& markingText()
const;
127 void setMarkingText(
const DtString&);
129 const DtForceType forceType()
const;
130 void setForceType(
const DtForceType&);
132 const UInt32 appearanceBits()
const;
133 void setAppearanceBits(
const UInt32&);
135 const DtEntityType
entityType()
const {
return DtEntityType(objectType()); };
140 const DtEntityIdentifier& entityId()
const;
141 void setEntityId(
const DtEntityIdentifier&);
143 const UInt32 capabilities()
const;
144 void setCapabilities(
const UInt32&);
146 const DtEntityType guise()
const;
147 void setGuise(
const DtEntityType&);
150 const DtUUID& superior()
const;
151 void setSuperior(
const DtUUID&);
153 virtual void setAppearance(
const DtAppearance& app);
156 virtual void makeWritable();
159 virtual void makeReadOnly();
171 template <
typename T_BaseComponent>
181 const bool& isLocal()
const;
183 const DtUUID& uuid()
const;
184 const DtString& markingText()
const;
185 const DtForceType forceType()
const;
186 const DtEntityType
entityType()
const {
return DtEntityType(objectType()); };
188 const DtEntityIdentifier& entityId()
const;
189 const UInt32 appearanceBits()
const;
190 const bool isClutterEntity()
const;
191 const UInt32 capabilities()
const;
192 const DtEntityType guise()
const;
194 const DtUUID& superior()
const;
199 void addAttachment(
const DtUUID&);
200 void removeAttachment(
const DtUUID&);
201 const std::set<DtUUID> attachments()
const;
204 bool checkForUpdatedItems();
207 const DtUUID _uuid()
const;
208 const DtString _markingText()
const;
209 const DtEntityIdentifier _entityId()
const;
211 bool checkEntityIdChanged();
212 bool checkUUIDChanged();
213 bool checkForceChanged();
214 bool checkMarkingTextChanged();
215 bool checkDamageStateChanged();
216 bool checkIsClutterChanged();
218 void handleDataUpdated(
const std::vector<UInt32>& attributesUpdated);
219 void completeSetup();
229 void setSuperior(
const DtUUID&);
262 void updateDataStorage();
266 myCurrentFrameState.updateStateData(sd);
267 myNextFrameState.updateStateData(sd);
270 static void addAdditionalTableColumns(Legion::SimulationDatabase*);
277 virtual void convertToRemote();
280 virtual void convertToLocal();
282 virtual void addAdditionalStateComponents()
override;
287 myCurrentFrameState.aboutToBeDeleted();
288 myNextFrameState.aboutToBeDeleted();
302 #define _ENTITY_STATE_COMPONENT 1
303 #include "vrfStateData/entityStateComponent.inl"
2) Define the next frame class. This will be used for write access.
Definition: entityStateComponent.h:104
UUID is a unique ID wrapper class.
Definition: uuid.h:59
boost::signals2::signal< void(const DtFrameStateInterface *)> signal_attachmentsChanged
Definition: entityStateComponent.h:93
unsigned int myCallbackHandle
Definition: entityStateComponent.h:237
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:162
const DtEntityType entityType() const
Definition: entityStateComponent.h:186
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:111
Definition: stateDataTypes.h:23
DtString myMarkingText
Definition: entityStateComponent.h:62
tbb::spin_mutex myCompleteSetupMutex
Definition: entityStateComponent.h:243
DtEntityStateComponentCurrentFrameTemplate< DtEntityStateComponent > DtEntityStateComponentCurrentFrame
Definition: entityStateComponent.h:247
bool myIsClutterEntity
Definition: entityStateComponent.h:238
int myForceId
Definition: entityStateComponent.h:235
Definition: stateComponent.h:62
virtual void addAttachment(const DtUUID &)
Definition: entityStateComponent.h:89
1) Define the interface class that will be used to represent the next and current frames...
Definition: entityStateComponent.h:70
DtStateData * myStateData
Definition: entityStateComponent.h:233
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:99
DtEntityStateComponentData(const DtEntityStateComponentData &orig)
Definition: entityStateComponent.h:34
bool isDoubleBuffered()
Definition: entityStateComponent.h:257
boost::signals2::scoped_connection myCompleteSetupConnection
Definition: entityStateComponent.h:242
boost::signals2::signal< void(const DtUUID &oldSuperior, const DtUUID &newSuperior)> signal_superiorChanged
Definition: entityStateComponent.h:94
boost::signals2::signal< void(bool oldIsClutter, bool newIsClutter)> signal_isClutterChanged
Definition: entityStateComponent.h:95
virtual const DtFrameStateInterface * nextFrameState() const
Definition: entityStateComponent.h:260
const DtEntityStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: entityStateComponent.h:179
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: entityStateComponent.h:264
Definition: entityStateComponent.h:25
void advanceFrame(const DtEntityStateComponentData &data)
Definition: entityStateComponent.h:222
Definition: objectType.h:27
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: entityStateComponent.h:251
std::set< DtUUID > myAttachments
Definition: entityStateComponent.h:240
virtual void aboutToBeDeleted() override
Definition: entityStateComponent.h:284
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:172
DtString myGlobalId
Definition: entityStateComponent.h:61
DtEntityStateComponentNextFrame myNextFrameState
Definition: entityStateComponent.h:293
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:379
DtUUID mySuperior
Definition: entityStateComponent.h:234
DtEntityIdentifier myEntityId
Definition: entityStateComponent.h:63
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
virtual void aboutToBeDeleted()
LOM::ReadEntityRepository myReadEntityStateRepository
Definition: entityStateComponent.h:232
UInt32 myUUIDColumn
Definition: entityStateComponent.h:98
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
LOM::WriteEntityRepository myWriteEntityStateRepository
Definition: entityStateComponent.h:294
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
DtEntityStateComponentData myData
Definition: entityStateComponent.h:165
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:299
DtEntityStateComponentData myData
Definition: entityStateComponent.h:244
DtEntityStateComponentCurrentFrame myCurrentFrameState
Definition: entityStateComponent.h:292
DtEntityStateComponentNextFrameTemplate< DtEntityStateComponent > DtEntityStateComponentNextFrame
Definition: entityStateComponent.h:168
Legion::WriteStateInstance writeStateInstance() override
Definition: entityStateComponent.h:274
#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:64
DtEntityStateComponentData & frameState()
Definition: entityStateComponent.h:112
virtual void setEntityType(const DtObjectType &ot)
Definition: entityStateComponent.h:88
void setEntityType(const DtEntityType &t)
Definition: entityStateComponent.h:138
DtStateData * myStateData
Definition: entityStateComponent.h:163
int myDamageState
Definition: entityStateComponent.h:236
DtEntityStateComponentData & operator=(const DtEntityStateComponentData &rhs)
Definition: entityStateComponent.h:43
virtual DtFrameStateInterface * nextFrameState()
Definition: entityStateComponent.h:259
bool myIsLocal
Definition: entityStateComponent.h:65
const DtFrameStateInterface * currentFrameState() const
Definition: entityStateComponent.h:258
DtUUID mySuperior
Definition: entityStateComponent.h:164
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:241
const DtEntityType entityType() const
Definition: entityStateComponent.h:135
This class holds the state data that represents each simulation object in the system.
Definition: stateDataManager.h:73