26 #include <legionDataStore/simulationDatabase.h>
27 #include <legionDataStore/writeStateInstance.h>
28 #include <legionDataStore/readStateInstance.h>
29 #include "legionDataStore/view.h"
31 #include <vlutil/vlString.h>
32 #include <vlpi/disEnums.h>
33 #include <tbb/spin_rw_mutex.h>
34 #include <tbb/spin_mutex.h>
35 #include <tbb/mutex.h>
37 #include <boost/signals2.hpp>
41 class WriteEntityRepository;
42 class ReadEntityRepository;
47 class SimulationDatabase;
48 class WriteStateInstance;
56 class DtStateDataManager;
57 class DtLaserDesignatorStateComponent;
58 class DtIffStateComponent;
59 class DtActiveSonarStateComponent;
60 class DtTaskVisualizationStateComponent;
61 class DtRadioTransmitterStateComponent;
62 class DtNavAidRadioTransmitterStateComponent;
63 class DtUnderwaterAcousticsStateComponent;
64 class DtEmitterSystemStateComponent;
65 class DtRadioReceiverStateComponent;
66 class DtSimulatedObjectStateComponent;
67 class DtLocationStateComponent;
68 class DtAisDataStateComponent;
69 class DtAircraftLightingStateComponent;
70 class DtGroundVehicleLightingStateComponent;
71 class DtSimpleSimulatedObjectStateComponent;
92 template <
typename T_Component>
95 if (hasStateComponentType(T_Component::ComponentType()))
97 return (dynamic_cast<const T_Component*>(getStateComponent(T_Component::ComponentType())) !=
nullptr);
106 template <
typename T_Component>
109 return dynamic_cast<const T_Component*
>(getStateComponent(T_Component::ComponentType()));
119 template <
typename T_Component>
123 std::vector<const T_Component*> results;
124 int iLimit = numComponents(scType);
126 for (i = 0; i < iLimit; i++)
128 const T_Component* component =
dynamic_cast<const T_Component*
>(getStateComponent(scType, i));
130 if (!component->markedForRemoval())
132 results.push_back(dynamic_cast<const T_Component*>(component));
148 virtual void aboutToBeDeleted();
151 unsigned long long legionGlobalId()
const;
203 template <
typename T_Component>
204 T_Component* addStateComponent(
bool checkWritable =
false,
bool isRemote =
false);
207 std::set<int> modifiedStateComponentTypes()
const;
209 bool isModified()
const;
216 template <
typename T_Component>
217 void removeStateComponents();
221 if (scType < myFrameState.size())
223 return myFrameState[scType].size();
234 template <
typename T_Component>
239 const T_Component* comp =
dynamic_cast<const T_Component*
>(getStateComponent(scType, index));
252 template <
typename T_Component>
256 std::vector<T_Component*> results;
258 if (scType < myFrameState.size())
260 std::vector<DtFrameStateInterface*>::const_iterator iter = myFrameState[scType].begin();
261 std::vector<DtFrameStateInterface*>::const_iterator end = myFrameState[scType].end();
264 T_Component* component =
dynamic_cast<T_Component*
>(*iter);
266 if (!component->markedForRemoval())
268 results.push_back(dynamic_cast<T_Component*>(component));
283 if (scType < myFrameState.size())
285 if (index < myFrameState[scType].
size())
287 return myFrameState[scType][index];
300 if (scType < myFrameState.size())
302 if (index < myFrameState[scType].
size())
304 return myFrameState[scType][index];
318 template <
typename T_Component>
321 T_Component* comp = getStateComponent<T_Component>(0,
false);
323 return (comp && comp->isWritable());
333 template <
typename T_Component>
338 if (scType < myFrameState.size())
340 if (index < myFrameState[scType].
size())
346 T_Component* comp =
dynamic_cast<T_Component*
>(sc);
348 if (comp && (!checkWritable || comp->isWritable()))
368 virtual const DtString& markingText()
const override;
373 return myFrameState.size();
386 std::vector<std::vector<DtFrameStateInterface*> > myFrameState{};
404 bool isValid()
const;
406 bool isModified()
const;
412 template <
typename T_Component>
413 const T_Component* getStateComponent(
int index = 0)
const;
416 std::set<int> modifiedStateComponentTypes()
const;
429 if (scType < myFrameState.size())
431 return myFrameState[scType].size();
440 template <
typename T_Component>
444 std::vector<const T_Component*> results;
446 if (scType < myFrameState.size())
448 std::vector<const DtFrameStateInterface*>::const_iterator iter = myFrameState[scType].begin();
449 std::vector<const DtFrameStateInterface*>::const_iterator end = myFrameState[scType].end();
452 results.push_back(dynamic_cast<const T_Component*>(*iter));
468 virtual const DtString& markingText()
const override;
473 return myFrameState.size();
478 const std::vector<std::vector<const DtFrameStateInterface*> >&
frameStates()
const
484 bool advancedFrame()
const;
496 std::vector<std::vector<const DtFrameStateInterface*> > myFrameState{};
523 PublishComponentsOnly
553 virtual void invalidate();
557 virtual bool checkValidity()
const;
559 #if defined(WIN32) || defined(_WIN32)
560 __declspec(deprecated(
"Method is deprecated. If this is a DtSimObjectReference use the ref.isValid() check instead or if this is a DtStateData reference is checkValidity().")) virtual
bool isValid()
const {
return checkValidity(); };
564 virtual bool isWritable()
const;
566 virtual void clearStateDataManager();
570 virtual void setAddToSimObjectManager(
bool b);
574 return myAddToSimObjectManager;
581 template <
typename T_Component>
584 if (myWriteStateInstance.isValid())
586 return myWriteStateInstance.typeExtensionCount<T_Component>();
590 return getCurrentFrameNumberOfLegionComponents<T_Component>();
597 template <
typename T_Component>
600 if (myReadStateInstance && myReadStateInstance->isValid())
602 return myReadStateInstance->typeExtensionCount<T_Component>();
612 return myOwnsComponents;
619 template <
typename T_Component>
622 if (myWriteStateInstance.isValid())
624 return myWriteStateInstance.typeExtensionCount<T_Component>();
626 else if (myReadStateInstance && myReadStateInstance->isValid())
628 return myReadStateInstance->typeExtensionCount<T_Component>();
639 template <
typename T_Component>
642 if (myWriteStateInstance.isValid())
644 return myWriteStateInstance.findTypeExtension<T_Component>(std::max(0, index));
648 return findCurrentFrameLegionComponent<T_Component>(index);
656 template <
typename T_Component>
659 if (myReadStateInstance && myReadStateInstance->isValid())
661 if (T_Component::isType(myReadStateInstance->instanceHandle()))
663 return T_Component(myReadStateInstance->instanceHandle());
666 return myReadStateInstance->findTypeExtension<T_Component>(std::max(0, index));
670 return T_Component();
675 virtual void markModified();
677 virtual void clearModified();
687 bool isModified()
const;
692 return myAdvancedFrame;
698 return myAdvancingFrame;
704 return &myNextFrameState;
710 return &myCurrentFrameState;
719 template <
typename T_Component>
722 return myNextFrameState.addStateComponent<T_Component>(checkWritable, isRemote);
727 template <
typename T_Component>
730 return myNextFrameState.isWritable<T_Component>();
736 if (myDatabase && myWriteStateInstance.isValid())
738 destroyInstance(myWriteStateInstance);
739 myWriteStateInstance = Legion::WriteStateInstance();
740 delete myReadStateInstance;
741 myReadStateInstance =
nullptr;
749 tbb::mutex::scoped_lock lock(theCreateInstanceMutex);
750 database()->destroyInstance(wsi);
754 virtual void createAndInitializeMainInstance();
759 template <
typename T_Component>
762 tbb::mutex::scoped_lock lock(theCreateInstanceMutex);
763 myWriteStateInstance = myDatabase->createInstance<T_Component>();
766 return T_Component(myWriteStateInstance.instanceHandle());
773 template <
typename T_Component>
776 if (!myWriteStateInstance.isValid())
782 tbb::mutex::scoped_lock lock(theCreateInstanceMutex);
783 T_Component comp = myDatabase->createInstance<T_Component>();
789 return T_Component();
800 template <
typename T_Component>
803 if (!myWriteStateInstance.isValid())
809 tbb::mutex::scoped_lock lock(theCreateInstanceMutex);
810 T_Component comp = myDatabase->createInstance<T_Component>();
813 myWriteStateInstance.addExtension(comp);
818 return T_Component();
825 template <
typename T_Component>
828 if (T_Component::ComponentType() < myStateComponents.size())
830 if (index < myStateComponents[T_Component::ComponentType()].size())
832 return myStateComponents[T_Component::ComponentType()][index];
843 template <
typename T_Component>
846 if (T_Component::ComponentType() < myStateComponents.size())
848 if (index < myStateComponents[T_Component::ComponentType()].size())
850 return myStateComponents[T_Component::ComponentType()][index];
859 template <
typename T_Component>
862 return myNextFrameState.getStateComponentList<T_Component>();
867 template <
typename T_Component>
870 return myCurrentFrameState.getStateComponentList<T_Component>();
878 template <
typename T_Component>
883 if (nextFrameState()->hasStateComponent<T_Component>())
887 return (nextFrameStateComponent<T_Component>()->isWritable());
894 return currentFrameState()->hasStateComponent<T_Component>();
908 template <
typename T_Component>
911 if (currentFrameState()->hasStateComponent<T_Component>())
913 return (dynamic_cast<const T_Component*>(currentFrameState()->getStateComponent<T_Component>()) !=
nullptr);
923 template <
typename T_Component>
926 T_Component* comp = nextFrameState()->getStateComponent<T_Component>(0);
927 if (comp && comp->isWritable())
940 template <
typename T_Component>
943 return currentFrameState()->getStateComponent<T_Component>(0);
952 void removeComponent(Legion::WriteStateInstance& set);
965 void setUserData(
unsigned long long value);
967 unsigned long long userData()
const;
970 const DtUUID& uuid()
const;
973 void setUUID(
const DtUUID& u);
977 void setCheckForNameReservation(
bool);
979 bool checkForNameReservation()
const;
983 void setGlobalId(
const DtString& s);
989 void setMarkingText(
const DtString& name);
991 const DtString& markingText()
const;
999 void setAppearance(
const DtAppearance& a);
1001 DtAppearance appearance()
const;
1005 void setForceType(DtForceType force);
1007 DtForceType forceType()
const;
1010 const DtString parentGlobalId()
const;
1026 const DtUUID& nextFrameHostId()
const;
1028 const DtUUID& currentFrameHostId()
const;
1031 bool isClutterEntity()
const;
1035 void setEntityType(
const DtEntityType& type);
1040 DtEntityType entityType()
const;
1046 void setEntityId(
const DtEntityIdentifier& s);
1048 const DtEntityIdentifier& entityId()
const;
1051 virtual void setAwaitingTransfer(
bool b);
1055 return myAwaitingTransfer;
1067 virtual bool createPublicData(
const DtVrfObjectParameters* params,
bool isReflectedObject,
const DtEntityType& et);
1073 return mySimStateID;
1080 template <
typename T_Class>
1081 void removeInstanceUpdatedCallback(Legion::InstanceHandle instanceHandle,
unsigned int callbackHandle);
1088 template <
typename T_Class>
1090 const std::vector<Legion::AttributeIndex>& attributeIndexFilter = std::vector<Legion::AttributeIndex>());
1095 virtual void advanceFrame();
1107 void setIsLocal(
bool b);
1109 bool isLocal()
const;
1114 return myPublishFlag;
1120 return ((myPublishFlag == PublishAll) || (myPublishFlag == PublishComponentsOnly));
1126 return myStateDataManager;
1132 return myStateDataManager;
1136 double absRealTime()
const;
1141 return myCoordinateSystem;
1147 return myWriteStateInstance;
1153 return myReadStateInstance;
1159 return myConvertedToLocal;
1163 UInt64 legionGlobalId()
const;
1166 virtual void clearComponents();
1232 virtual void removeIffSystem();
1237 virtual void removeUnderwaterAcousticsSystem();
1252 virtual void convertToRemote(
bool onAdvanceFrame =
true);
1255 virtual void convertToLocal();
1265 virtual void shuttingDown();
1274 return myParameters;
1285 static void addDefaultPublicDataFor(
const std::string& type,
const std::string& componentCreator);
1289 static void removeDefaultPublicDataFor(
const std::string& type,
const std::string& componentCreator);
1295 static std::set<std::string> defaultPublicDataFor(DtEntityType defaultEntityType,
const std::string& dislpayName,
const std::string& parameterType);
1302 static void addPublicDataFor(
const std::string& type,
const std::string& componentCreator);
1306 static void removePublicDataFor(
const std::string& type,
const std::string& componentCreator);
1312 static std::set<std::string> additionalPublicDataFor(DtEntityType defaultEntityType,
const std::string& dislpayName,
const std::string& parameterType);
1321 static void setDefaultMainComponentFor(
const std::string& type,
const std::string& defaultPublicData);
1327 static std::string defaultMainComponentFor(DtEntityType defaultEntityType,
const std::string& dislpayName,
const std::string& type);
1332 virtual void aboutToBeDeleted();
1337 virtual void setPublishingOnLegionNetwork(
bool b);
1341 return myPublishingOnLegionNetwork;
1355 virtual DtStateData* currentFrameHostStateData()
const;
1363 virtual void hostChanged(
const DtUUID& oldUUID,
const DtUUID& newUUID);
1371 virtual void subordinatesChanged(
const std::vector<DtUUID>& oldSubordinates,
const std::vector<DtUUID>& newSubordinates);
1385 virtual std::string defaultParameterTypeForEntityType(
const DtEntityType& et)
const;
1389 virtual void completeRemoteConversion();
1392 virtual void hostWasDeleted();
1403 virtual void uuidChanged(
const DtUUID& oldUUID,
const DtUUID& newUUID);
1407 virtual void markingTextChanged(
const DtString& oldText,
const DtString& newText);
1421 boost::signals2::signal<void (const DtStateData*, const DtUUID& oldUUID, const DtUUID& newUUID)>
signal_hostChanged;
1458 boost::signals2::signal<void (const DtStateData*, const std::vector<DtUUID>& added,
const std::vector<DtUUID>& removed)> signal_subordinatesChanged;
1480 bool myIsModified =
true;
1523 typedef std::map<std::string, std::set<std::string> >
PublicData;
1559 bool myAdvancingFrame =
false;
1561 bool myConvertedToLocal =
false;
1563 bool myAddToSimObjectManager =
true;
1565 bool myOwnsComponents =
false;
1574 #include <vrfStateData/stateData.inl>
unsigned int StateComponentType
Definition: stateComponent.h:56
bool isWritable()
Definition: stateData.h:319
DtEntityType myEntityType
The entity type of this entity, used to select default parameter types.
Definition: stateData.h:1570
UUID is a unique ID wrapper class.
Definition: uuid.h:59
bool myAdvancedFrame
True after the first call to advanceFrame().
Definition: stateData.h:1498
Instances of DtVrfObjectParameters are the readable/writeable objects that contain the information ne...
Definition: vrfObjectParameters.h:64
boost::signals2::scoped_connection myMarkingTextChangedConnection
Connection tracking marking text changes on this entity.
Definition: stateData.h:1516
T_Component * nextFrameStateComponent()
Returns a writable pointer to the next-frame state component of the given type. Throws DtUnknownState...
Definition: stateData.h:924
std::vector< T_Component * > getNextFrameStateComponentList() const
Definition: stateData.h:860
const DtSimulatedObjectStateComponent * myCurrentFrameSimulatedObjectStateComponent
Cached pointer to the current-frame simulated object state component for fast access.
Definition: stateData.h:1544
const T_Component * getStateComponent() const
Returns a const pointer to the state component of the requested type.
Definition: stateData.h:107
bool advancingFrame() const
Definition: stateData.h:696
DtExternalCurrentFrameState(DtStateData *sd)
Constructs the current-frame state view for the given state data.
Definition: stateData.h:396
Exception thrown when a required method has not been implemented.
Definition: stateDataTypes.h:30
unsigned long long SimStateID
Unique identifier for a simulation state instance.
Definition: stateDataTypes.h:17
std::vector< const T_Component * > getStateComponentList() const
Returns a vector of const pointers to all current-frame components of the given type.
Definition: stateData.h:441
SimStateID stateId() const
Definition: stateData.h:1071
const bool hasStateComponent() const
Returns true if the current-frame contains a state component of the given type that can be cast to it...
Definition: stateData.h:909
boost::signals2::scoped_connection mySubordinatesChangedConnection
Connection tracking changes to the subordinate entity list.
Definition: stateData.h:1510
boost::signals2::signal< void(SimStateID)> signal_preFrameAdvanced
Signal emitted at the beginning of frame advance, before component data is swapped. Listeners receive the state ID.
Definition: stateData.h:1428
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: radioTransmitterStateComponent.h:160
T_Component * getStateComponent(int index=0, bool checkWritable=true)
Returns a writable pointer to the next-frame state component of the given type. Throws DtUnknownState...
Definition: stateData.h:334
int mySessionId
Session identifier for the current simulation session.
Definition: stateData.h:1488
The DtLocationStateComponent interface contains the interface that all DtLocationStateComponents can ...
Definition: locationStateComponent.h:25
int getCurrentFrameNumberOfLegionComponents() const
Returns the count of Legion extension components of the given type for the current frame...
Definition: stateData.h:598
bool convertedToLocal() const
Definition: stateData.h:1157
const Coordinate_System * myCoordinateSystem
The coordinate system used when converting position data for this entity.
Definition: stateData.h:1485
std::vector< std::vector< DtStateComponent * > > myStateComponents
Two-dimensional array of state components indexed by StateComponentType and component index...
Definition: stateData.h:1491
bool cleared() const
Definition: stateData.h:955
int numberOfFrameStates() const
Definition: stateData.h:471
boost::signals2::signal< void(const DtStateData *)> signal_modified
Signal sent if this state had modified components.
Definition: stateData.h:1434
PublishFlag myPublishFlag
Simulated locally vs. remote representation.
Definition: stateData.h:1482
The DtSimulatedObjectStateComponent is an interface that all main components (those that are consider...
Definition: simulatedObjectStateComponent.h:21
T_Component createUnattachedInstance()
Creates a new Legion instance of the given type without attaching it as an extension to the main inst...
Definition: stateData.h:774
boost::signals2::signal< void(const DtString &, const DtString &, const DtUUID &, SimStateID)> signal_markingTextChanged
Signal emitted when this state data's marking text changes. Listeners receive the old text...
Definition: stateData.h:1418
static tbb::mutex theCreateInstanceMutex
Mutex used to serialize concurrent calls to createInstance() across all state data instances...
Definition: stateData.h:1556
static PublicData theDefaultPublicData
Default public data keyed by parameter type, shared across all instances.
Definition: stateData.h:1525
State is not published.
Definition: stateData.h:521
DtEntityType objectType() const
Definition: stateData.h:1042
Legion::SimulationDatabase * database()
Definition: stateData.h:1245
PublishFlag publishFlag() const
Definition: stateData.h:1112
static DefaultMainComponentMap theDefaultMainComponentMap
Shared map of default main component assignments, keyed by type string.
Definition: stateData.h:1532
voidpf void uLong size
Definition: ioapi.h:39
const DtStateDataManager * stateDataManager() const
Definition: stateData.h:1130
DtFrameStateInterface * getStateComponent(DtStateComponent::StateComponentType scType, int index=0)
Returns a writable pointer to the next-frame state component of the given type at the specified index...
Definition: stateData.h:298
void setPublishFlag(PublishFlag b)
Only called during construction.
Definition: stateData.h:1376
Legion::SimulationDatabase * myDatabase
Pointer to the Legion simulation database used to publish and receive updates.
Definition: stateData.h:1469
bool addToSimObjectManager() const
Definition: stateData.h:572
bool hasStateComponent(bool checkWritable=false)
Returns true if a state component of the given type exists on this object. First checks the next fram...
Definition: stateData.h:879
Write-access view of the next-frame state components within a DtStateData. Only the simulation (contr...
Definition: stateData.h:180
boost::signals2::signal< void(const DtStateData *)> signal_frameAdvanced
Signal sent regardless of whether or not this state had any modified components.
Definition: stateData.h:1431
virtual int numComponents(DtStateComponent::StateComponentType scType) const override
Definition: stateData.h:427
Contains the DtUUID class declaration.
unsigned long long UInt64
64-bit unsigned integer type.
Definition: stateDataTypes.h:19
DT_DLL_vrfmodel makVrf::DtDynamicTerrainStateComponent * createStateComponent(DtLocalObject *localObject)
Creates a new state component on the localObject and returns a pointer to it. Note that the state com...
boost::signals2::signal< void(const DtUUID &, const DtUUID &, SimStateID)> signal_uuidChanged
Signal emitted when this state data's UUID changes. Listeners receive the old UUID, the new UUID, and the state ID.
Definition: stateData.h:1415
PublishFlag
Controls whether and how this object's state is published on the Legion network.
Definition: stateData.h:519
Legion::ReadStateInstance * myReadStateInstance
Pointer to the Legion read-state instance for receiving remote updates; may be nullptr for local enti...
Definition: stateData.h:1474
boost::signals2::signal< void(DtStateData *)> signal_convertedToLocal
Signal emitted when conversion to a locally simulated representation is complete. Listeners receive t...
Definition: stateData.h:1448
unsigned int componentCount() const
Returns the total count of Legion extension components of the given type across next and current fram...
Definition: stateData.h:620
std::vector< std::vector< DtStateComponent * > > myCreatedStateComponents
Two-dimensional array tracking components created (owned) by this state data.
Definition: stateData.h:1493
T_Component findNextFrameLegionComponent(int index=0)
Finds and returns a writable Legion extension component of the given type for the next frame...
Definition: stateData.h:640
const DtVrfObjectParameters * myParameters
Object parameters used during initialization; not owned by this class.
Definition: stateData.h:1537
T_Component createInstance()
Creates a new Legion extension component of the given type and attaches it to the main write instance...
Definition: stateData.h:801
unsigned long long SimStateID
Opaque integer type used to identify and index state data objects.
Definition: stateData.h:517
All state is published.
Definition: stateData.h:522
virtual int numComponents(DtStateComponent::StateComponentType scType) const override
Definition: stateData.h:219
T_Component findCurrentFrameLegionComponent(int index=0) const
Finds and returns a read-only Legion extension component of the given type for the current frame...
Definition: stateData.h:657
void destroyInstance(const Legion::WriteStateInstance &wsi)
Destroys a Legion instance and removes it from the simulation database.
Definition: stateData.h:747
const DtStateComponent * getStateComponent(int index=0) const
Returns a const pointer to the internal DtStateComponent of the given type at the specified index...
Definition: stateData.h:844
int getNextFrameNumberOfLegionComponents()
Returns the count of Legion extension components of the given type for the next frame. Falls back to the current frame count if no writable instance exists.
Definition: stateData.h:582
std::vector< const T_Component * > getCurrentFrameStateComponentList() const
Definition: stateData.h:868
static PublicData theAdditionalPublicData
Additional public data (beyond the default) keyed by parameter type, shared across all instances...
Definition: stateData.h:1527
boost::signals2::scoped_connection myHostChangedConnection
Connection tracking host UUID changes.
Definition: stateData.h:1512
std::vector< T_Component * > getStateComponentList() const
Returns a vector of writable pointers to all next-frame components of the given type.
Definition: stateData.h:253
boost::signals2::signal< void(const DtExternalFrameStateInterface *)> signal_externalFrameStateToBeDestroyed
Signal emitted immediately before this interface is destroyed.
Definition: stateData.h:153
DtStateComponent * getStateComponent(int index=0)
Returns a writable pointer to the internal DtStateComponent of the given type at the specified index...
Definition: stateData.h:826
DtStateData * myCurrentFrameHostStateData
Mutable cache of the current-frame host state data pointer; updated lazily.
Definition: stateData.h:1552
Definition: coordSystem.h:54
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
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: laserDesignatorStateComponent.h:64
bool ownsComponents() const
Definition: stateData.h:610
bool myPublishingOnLegionNetwork
True if state for this entity is being published on the Legion network.
Definition: stateData.h:1539
Abstract interface class for the active sonar state component, representing either the next or curren...
Definition: activeSonarStateComponent.h:396
boost::signals2::signal< void(DtStateData *)> signal_convertedToRemote
Signal emitted when conversion to a remote representation is complete. Listeners receive the state da...
Definition: stateData.h:1441
DtExternalNextFrameState * nextFrameState()
Definition: stateData.h:702
Legion::WriteStateInstance myWriteStateInstance
The basic data. This is what all components are hung off of if they are STE compliant.
Definition: stateData.h:1472
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque
std::atomic< unsigned int > myComponentNumber
Monotonically increasing counter used to assign unique indices to newly created components.
Definition: stateData.h:1507
boost::signals2::signal< void(const DtStateData *, const DtUUID &oldUUID, const DtUUID &newUUID)> signal_hostChanged
Signal sent when the host has changed.
Definition: stateData.h:1421
std::map< std::string, std::string > DefaultMainComponentMap
Maps parameter / entity type strings to the name of their default main component creator.
Definition: stateData.h:1530
const Coordinate_System * coordinateSystem() const
Definition: stateData.h:1139
DtExternalCurrentFrameState myCurrentFrameState
Read-only view of state components from the last completed frame.
Definition: stateData.h:1464
void setObjectType(const DtEntityType &type)
Definition: stateData.h:1037
bool isWritable()
Definition: stateData.h:728
std::map< std::string, std::set< std::string > > PublicData
This is added for systems that might not have updated the ope files to the new format to get public d...
Definition: stateData.h:1523
void destroyMainInstance()
Destroys the main Legion write instance and frees the associated read instance.
Definition: stateData.h:734
Legion::ReadStateInstance * readStateInstance() const
Definition: stateData.h:1151
DtStateDataManager * myStateDataManager
The state data manager that owns and manages this state data, or nullptr.
Definition: stateData.h:1467
bool myMainComponentOnLegion
True if the main (primary) component for this entity resides on the Legion network.
Definition: stateData.h:1541
std::vector< const T_Component * > getStateComponentList() const
Returns a vector of const pointers to all components of the given type.
Definition: stateData.h:120
Read-only view of the current (committed) frame state components within a DtStateData. Safe to access from any thread once the frame has been advanced.
Definition: stateData.h:391
UInt64 myLegionGlobalId
The Legion global identifier for this entity.
Definition: stateData.h:1505
boost::signals2::signal< void(DtStateComponent *)> signal_stateComponentRemoved
Signal emitted whenever a state component is removed from this state data. Listeners receive a pointe...
Definition: stateData.h:1454
DtExternalNextFrameState(DtStateData *sd)
Constructs the next-frame state view for the given state data.
Definition: stateData.h:185
Legion::WriteStateInstance writeStateInstance()
Definition: stateData.h:1145
virtual const DtFrameStateInterface * getStateComponent(DtStateComponent::StateComponentType scType, int index=0) const override
Returns a const pointer to the next-frame state component of the given type at the specified index...
Definition: stateData.h:281
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: emitterSystemStateComponent.h:498
bool advancedFrame() const
Definition: stateData.h:690
Exception-like value type thrown when an unrecognized state component is encountered.
Definition: stateDataTypes.h:38
DtString myMarkingText
The current marking text (callsign / label) for this entity.
Definition: stateData.h:1568
Definition: stateComponent.h:52
boost::function< void(const std::vector< UInt32 > &)> DtInstanceUpdatedCallback
Callback invoked when one or more state component instances are updated.
Definition: stateDataTypes.h:27
boost::signals2::scoped_connection myUUIDChangedConnection
Connection tracking UUID changes on this entity.
Definition: stateData.h:1514
Abstract interface for the radio receiver state component, representing common accessors for both the...
Definition: radioReceiverStateComponent.h:83
const DtLocationStateComponent * myCurrentFrameLocationStateComponent
Cached pointer to the current-frame location state component for fast access.
Definition: stateData.h:1546
const DtExternalCurrentFrameState * currentFrameState() const
Definition: stateData.h:708
boost::signals2::signal< void(DtStateComponent *)> signal_stateComponentAdded
Signal emitted whenever a state component is added to this state data. Listeners receive a pointer to...
Definition: stateData.h:1451
std::set< DtFrameStateInterface * > myRemoveStateComponents
Set of frame state interfaces queued for removal on the next frame advance.
Definition: stateData.h:1495
boost::signals2::scoped_connection myHostWasDeletedConnection
Connection tracking host entity deletion.
Definition: stateData.h:1518
Interface class representing the nav aid radio transmitter state component. Concrete subclasses provi...
Definition: navAidRadioTransmitterStateComponent.h:21
bool myCleared
True after aboutToBeDeleted() has been called.
Definition: stateData.h:175
Abstract base class that provides access to a set of state components within a DtStateData, representing either the next frame (read/write) or the current frame (read-only) view. Both DtExternalNextFrameState and DtExternalCurrentFrameState derive from this class.
Definition: stateData.h:76
boost::signals2::signal< void(const DtStateData *)> signal_stateDataToBeDestroyed
Signal emitted just before this state data object is destroyed. Listeners receive the state data poin...
Definition: stateData.h:1425
boost::signals2::signal< void(DtStateData *)> signal_convertingToRemote
Signal emitted when conversion from local to remote is about to begin. Listeners receive the state da...
Definition: stateData.h:1438
bool myConvertToRemote
True if this state data is pending conversion to a remote representation.
Definition: stateData.h:1500
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: underwaterAcousticsStateComponent.h:114
bool publishingOnLegionNetwork() const
Definition: stateData.h:1339
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:29
bool awaitingTransfer() const
Definition: stateData.h:1053
bool myAwaitingTransfer
True if this entity is awaiting an ownership transfer.
Definition: stateData.h:1502
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: iffStateComponent.h:102
DtStateDataManager * stateDataManager()
Definition: stateData.h:1124
const T_Component * getStateComponent(int index=0) const
Returns a const pointer to the next-frame state component of the given type. Throws DtUnknownStateCom...
Definition: stateData.h:235
bool myCleared
True if this state data has been cleared (all components invalidated and removed).
Definition: stateData.h:1534
tbb::spin_rw_mutex myCurrentFrameHostStateDataMutex
Reader-writer mutex protecting myCurrentFrameHostStateData during concurrent access.
Definition: stateData.h:1554
const DtVrfObjectParameters * parameters()
Definition: stateData.h:1272
DtExternalNextFrameState myNextFrameState
Write-access view of state components for the upcoming frame.
Definition: stateData.h:1462
1) Define the interface class that will be used to represent the next and current frames...
Definition: taskVisualizationStateComponent.h:300
Contains the DtStateComponent class declaration.
virtual void addStateComponent(DtFrameStateInterface *)
Adds a writable state component to this frame-state view. Throws DtUnimplementedMethod by default...
Definition: stateData.h:166
DtSimulatedObjectStateComponent * myNextFrameSimulatedObjectStateComponent
Cached pointer to the next-frame writable simulated object state component.
Definition: stateData.h:1550
T_Component createMainInstance()
Creates a new main Legion write instance of the given type and stores it as the primary instance...
Definition: stateData.h:760
boost::signals2::signal< void(DtStateData *)> signal_convertingToLocal
Signal emitted when conversion from remote to local is about to begin. Listeners receive the state da...
Definition: stateData.h:1445
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
T_Component * addStateComponent(bool checkWritable=false, bool isRemote=false)
Using the global state component factory, creates and adds a new state of the given type...
Definition: stateData.h:720
bool hasStateComponent() const
Returns true if a state component of the given type is present and can be cast to T_Component...
Definition: stateData.h:93
bool isPublishedOnNetwork() const
Definition: stateData.h:1118
SimStateID mySimStateID
Unique simulation state identifier assigned to this state data.
Definition: stateData.h:1477
const std::vector< std::vector< const DtFrameStateInterface * > > & frameStates() const
Definition: stateData.h:478
const T_Component * currentFrameStateComponent() const
Returns a const pointer to the current-frame state component of the given type.
Definition: stateData.h:941
This class holds the state data that represents each simulation object in the system.
Definition: stateDataManager.h:76
int numberOfFrameStates() const
Definition: stateData.h:371
boost::signals2::signal< void(const DtStateData *)> signal_firstFrameAdvance
Signal sent on the first frame advance.
Definition: stateData.h:1411