26 : myRangeItems(orig.myRangeItems)
51 myRangeItems.myRangeItems.push_back(i);
58 if ((index > -1) && (index < (
int)myRangeItems.myRangeItems.size()))
60 myRangeItems.myRangeItems.erase(myRangeItems.myRangeItems.begin() + index);
67 myRangeItems.myRangeItems.clear();
87 : DtFrameStateInterface(storage)
112 virtual void setRangeItems(
const DtRangeItems& i)
override;
115 virtual void addRangeItem(
const DtRangeItem& i)
override;
118 virtual void removeRangeItem(
int index)
override;
120 virtual const DtRangeItems& rangeItems()
const override;
125 virtual void clearRangeItems()
override;
131 virtual void makeReadOnly()
override {};
150 virtual const DtRangeItems& rangeItems()
const override;
185 virtual void updateDataStorage()
override;
191 myCurrentFrameState.updateStateData(sd);
192 myNextFrameState.updateStateData(sd);
199 myCurrentFrameState.aboutToBeDeleted();
200 myNextFrameState.aboutToBeDeleted();
bool isDoubleBuffered()
Definition: rangeItemsStateComponent.h:176
#define UNDEFINED_METHOD(Type, Method,...)
Defines a virtual non-const method with variadic parameters that throws DtUnimplementedMethod, requiring an override in a derived class.
Definition: doubleBufferedDataStorage.h:138
const DtRangeItemsStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: rangeItemsStateComponent.h:147
2) Define the next frame class. This will be used for write access.
Definition: rangeItemsStateComponent.h:99
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
virtual void aboutToBeDeleted() override
Notifies both frame states that the component is about to be deleted.
Definition: rangeItemsStateComponent.h:196
#define UNDEFINED_RETURNREF_ACCESSORS(ReturnType, Member)
Defines both const and non-const virtual reference accessors that throw DtUnimplementedMethod, requiring overrides in a derived class.
Definition: doubleBufferedDataStorage.h:74
DtRangeItemsStateComponentData & frameState()
Definition: rangeItemsStateComponent.h:108
const DtRangeItemsStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: rangeItemsStateComponent.h:107
DtRangeItemsStateComponentCurrentFrame myCurrentFrameState
The read-only current-frame state object.
Definition: rangeItemsStateComponent.h:205
DtRangeItems myRangeItems
The collection of range threat and target items used for training score evaluation.
Definition: rangeItemsStateComponent.h:74
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: rangeItemsStateComponent.h:79
Definition: rangeItem.h:149
virtual void updateStateData(DtStateData *sd) override
Updates the state data pointer for both frame state objects.
Definition: rangeItemsStateComponent.h:189
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Macro to define all required static and virtual state component type methods. Place in the public sec...
Definition: stateComponent.h:272
void clearRangeItems()
Removes all range items from the collection.
Definition: rangeItemsStateComponent.h:65
DtRangeItemsStateComponentData & operator=(const DtRangeItemsStateComponentData &rhs)
Assignment operator.
Definition: rangeItemsStateComponent.h:33
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: rangeItemsStateComponent.h:168
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:489
void removeRangeItem(int index)
Removes the range item at the given zero-based index. No-op if the index is out of range...
Definition: rangeItemsStateComponent.h:56
Data container storing the range training items associated with an entity.
Definition: rangeItemsStateComponent.h:16
virtual void aboutToBeDeleted()
Called when the component is about to be deleted; emits signal_stateComponentAboutToBeDeleted.
DtRangeItemsStateComponentData(const DtRangeItemsStateComponentData &orig)
Copy constructor.
Definition: rangeItemsStateComponent.h:25
Definition: rangeItem.h:206
void addRangeItem(const DtRangeItem &i)
Appends a range item to the collection.
Definition: rangeItemsStateComponent.h:49
virtual const DtFrameStateInterface * nextFrameState() const override
Definition: rangeItemsStateComponent.h:182
virtual const DtFrameStateInterface * currentFrameState() const override
Definition: rangeItemsStateComponent.h:178
#define DEFINE_REF_ACCESSORS(ReturnType, Method, Member)
Defines const and non-const reference accessors for a member variable.
Definition: doubleBufferedDataStorage.h:17
3) Define the current frame class. This will be used for read access.
Definition: rangeItemsStateComponent.h:139
virtual void makeWritable() override
Override to make component writable.
Definition: rangeItemsStateComponent.h:128
DtRangeItemsStateComponentNextFrame myNextFrameState
The writable next-frame state object.
Definition: rangeItemsStateComponent.h:207
Definition: stateComponent.h:80
#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
DtRangeItemsStateComponentData myData
The buffered range items state data for the current simulation frame.
Definition: rangeItemsStateComponent.h:163
void setRangeItems(const DtRangeItems &r)
Replaces the entire range items collection.
Definition: rangeItemsStateComponent.h:42
DtRangeItemsStateComponentData()
Default constructor.
Definition: rangeItemsStateComponent.h:19
virtual DtFrameStateInterface * nextFrameState() override
Definition: rangeItemsStateComponent.h:180
Contains the DtStateComponent class declaration.
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
DtStateComponentCreator< DtRangeItemsStateComponentImplementation > DtRangeItemsStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: rangeItemsStateComponent.h:212
void advanceFrame(const DtRangeItemsStateComponentData &data)
Advances the frame by copying next-frame state data into the current-frame buffer.
Definition: rangeItemsStateComponent.h:156
#define UNDEFINED_MUTATOR(Type, Set)
Defines a virtual setter that throws DtUnimplementedMethod, requiring an override in a derived class...
Definition: doubleBufferedDataStorage.h:81