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 , myIsBackgroundEntityColumn(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;
102 template <
typename T_BaseComponent>
113 const bool& isLocal()
const;
114 void setIsLocal(
const bool&);
119 const DtUUID& uuid()
const;
120 void setUUID(
const DtUUID&);
122 const bool isBackgroundEntity()
const;
123 void setIsBackgroundEntity(
const bool&);
125 const DtString& markingText()
const;
126 void setMarkingText(
const DtString&);
128 const DtForceType forceType()
const;
129 void setForceType(
const DtForceType&);
131 const UInt32 appearanceBits()
const;
132 void setAppearanceBits(
const UInt32&);
134 const DtEntityType
entityType()
const {
return DtEntityType(objectType()); };
139 const DtEntityIdentifier& entityId()
const;
140 void setEntityId(
const DtEntityIdentifier&);
142 const UInt32 capabilities()
const;
143 void setCapabilities(
const UInt32&);
145 const DtEntityType guise()
const;
146 void setGuise(
const DtEntityType&);
149 const DtUUID& superior()
const;
150 void setSuperior(
const DtUUID&);
152 virtual void setAppearance(
const DtAppearance& app);
155 virtual void makeWritable();
158 virtual void makeReadOnly();
170 template <
typename T_BaseComponent>
180 const bool& isLocal()
const;
182 const DtUUID& uuid()
const;
183 const DtString& markingText()
const;
184 const DtForceType forceType()
const;
185 const DtEntityType
entityType()
const {
return DtEntityType(objectType()); };
187 const DtEntityIdentifier& entityId()
const;
188 const UInt32 appearanceBits()
const;
189 const bool isBackgroundEntity()
const;
190 const UInt32 capabilities()
const;
191 const DtEntityType guise()
const;
193 const DtUUID& superior()
const;
198 void addAttachment(
const DtUUID&);
199 void removeAttachment(
const DtUUID&);
200 const std::set<DtUUID> attachments()
const;
203 bool checkForUpdatedItems();
206 const DtUUID _uuid()
const;
207 const DtString _markingText()
const;
208 const DtEntityIdentifier _entityId()
const;
210 bool checkEntityIdChanged();
211 bool checkUUIDChanged();
212 bool checkForceChanged();
213 bool checkMarkingTextChanged();
214 bool checkDamageStateChanged();
216 void handleDataUpdated(
const std::vector<UInt32>& attributesUpdated);
217 void completeSetup();
227 void setSuperior(
const DtUUID&);
259 void updateDataStorage();
263 myCurrentFrameState.updateStateData(sd);
264 myNextFrameState.updateStateData(sd);
267 static void addAdditionalTableColumns(Legion::SimulationDatabase*);
274 virtual void convertToRemote();
277 virtual void convertToLocal();
279 virtual void addAdditionalStateComponents()
override;
284 myCurrentFrameState.aboutToBeDeleted();
285 myNextFrameState.aboutToBeDeleted();
299 #define _ENTITY_STATE_COMPONENT 1
300 #include "vrfStateData/entityStateComponent.inl"
2) Define the next frame class. This will be used for write access.
Definition: entityStateComponent.h:103
UUID is a unique ID wrapper class.
Definition: rwUUID.h:229
boost::signals2::signal< void(const DtFrameStateInterface *)> signal_attachmentsChanged
Definition: entityStateComponent.h:93
unsigned int myCallbackHandle
Definition: entityStateComponent.h:235
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:161
const DtEntityType entityType() const
Definition: entityStateComponent.h:185
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:110
Definition: stateDataTypes.h:23
DtString myMarkingText
Definition: entityStateComponent.h:62
tbb::spin_mutex myCompleteSetupMutex
Definition: entityStateComponent.h:240
DtEntityStateComponentCurrentFrameTemplate< DtEntityStateComponent > DtEntityStateComponentCurrentFrame
Definition: entityStateComponent.h:244
int myForceId
Definition: entityStateComponent.h:233
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 curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: entityStateComponent.h:70
DtStateData * myStateData
Definition: entityStateComponent.h:231
Definition: stateComponent.h:257
The DtSimulatedObjectStateComponent is an interface that all main components (those that are consider...
Definition: simulatedObjectStateComponent.h:21
DtEntityStateComponentData(const DtEntityStateComponentData &orig)
Definition: entityStateComponent.h:34
bool isDoubleBuffered()
Definition: entityStateComponent.h:254
boost::signals2::signal< void(const DtUUID &oldSuperior, const DtUUID &newSuperior)> signal_superiorChanged
Definition: entityStateComponent.h:94
boost::signals2::scoped_connection myCompleteSetupConnection
Definition: entityStateComponent.h:239
virtual const DtFrameStateInterface * nextFrameState() const
Definition: entityStateComponent.h:257
const DtEntityStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: entityStateComponent.h:178
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: entityStateComponent.h:261
Definition: entityStateComponent.h:25
void advanceFrame(const DtEntityStateComponentData &data)
Definition: entityStateComponent.h:220
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:248
std::set< DtUUID > myAttachments
Definition: entityStateComponent.h:237
virtual void aboutToBeDeleted() override
Definition: entityStateComponent.h:281
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:336
DtEntityStateComponentData()
Definition: entityStateComponent.h:29
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:219
3) Define the current frame class. This will be used for read access.
Definition: entityStateComponent.h:171
DtString myGlobalId
Definition: entityStateComponent.h:61
DtEntityStateComponentNextFrame myNextFrameState
Definition: entityStateComponent.h:290
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:370
DtUUID mySuperior
Definition: entityStateComponent.h:232
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:230
UInt32 myUUIDColumn
Definition: entityStateComponent.h:97
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
LOM::WriteEntityRepository myWriteEntityStateRepository
Definition: entityStateComponent.h:291
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
DtEntityStateComponentData myData
Definition: entityStateComponent.h:164
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:296
DtEntityStateComponentData myData
Definition: entityStateComponent.h:241
DtEntityStateComponentCurrentFrame myCurrentFrameState
Definition: entityStateComponent.h:289
DtEntityStateComponentNextFrameTemplate< DtEntityStateComponent > DtEntityStateComponentNextFrame
Definition: entityStateComponent.h:167
Legion::WriteStateInstance writeStateInstance() override
Definition: entityStateComponent.h:271
#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:111
virtual void setEntityType(const DtObjectType &ot)
Definition: entityStateComponent.h:88
void setEntityType(const DtEntityType &t)
Definition: entityStateComponent.h:137
DtStateData * myStateData
Definition: entityStateComponent.h:162
int myDamageState
Definition: entityStateComponent.h:234
DtEntityStateComponentData & operator=(const DtEntityStateComponentData &rhs)
Definition: entityStateComponent.h:43
virtual DtFrameStateInterface * nextFrameState()
Definition: entityStateComponent.h:256
bool myIsLocal
Definition: entityStateComponent.h:65
const DtFrameStateInterface * currentFrameState() const
Definition: entityStateComponent.h:255
UInt32 myIsBackgroundEntityColumn
Definition: entityStateComponent.h:98
DtUUID mySuperior
Definition: entityStateComponent.h:163
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:282
tbb::spin_rw_mutex myAttachmentsMutex
Definition: entityStateComponent.h:238
const DtEntityType entityType() const
Definition: entityStateComponent.h:134
This class holds the state data that represents each simulation object in the system.
Definition: stateDataManager.h:71