21 : mySubordinates(orig.mySubordinates)
37 mySubordinates.push_back(uuid);
41 if (index >= mySubordinates.size())
43 while (mySubordinates.size() <= index)
49 mySubordinates[index] = uuid;
54 std::vector<DtUUID>::iterator iter = mySubordinates.begin();
55 std::vector<DtUUID>::iterator end = mySubordinates.end();
61 mySubordinates.erase(iter);
74 std::vector<DtUUID>::const_iterator iter = mySubordinates.begin();
75 std::vector<DtUUID>::const_iterator end = mySubordinates.end();
92 if (mySubordinates.size())
94 return mySubordinates[0];
102 if (mySubordinates.size())
104 return mySubordinates[mySubordinates.size() - 1];
132 virtual
int numSubordinates()
const {
throw DtUnimplementedMethod(
"The int numSubordinates() const is undefined for this class."); };
133 virtual bool hasSubordinate(
const DtUUID&)
const {
throw DtUnimplementedMethod(
"The bool hasSubordinate(const DtUUID&) const is undefined for this class."); };
135 mutable boost::signals2::signal<void (const DtFrameStateInterface*, const std::vector<DtUUID>& oldSubordinates,
const std::vector<DtUUID>& newSubordinates)> signal_subordinatesChanged;
148 int numSubordinates()
const;
149 const DtUUID& firstSubordinate()
const;
150 const DtUUID& lastSubordinate()
const;
151 const std::vector<DtUUID>& subordinates()
const;
152 void setSubordinates(
const std::vector<DtUUID>&);
153 void addSubordinate(
const DtUUID&,
int index = -1);
154 bool removeSubordinate(
const DtUUID&);
155 bool hasSubordinate(
const DtUUID&)
const;
156 void removeAllSubordinates();
162 virtual void makeReadOnly() {};
177 const DtUUID& firstSubordinate()
const;
178 const DtUUID& lastSubordinate()
const;
179 int numSubordinates()
const;
180 const std::vector<DtUUID>& subordinates()
const;
181 bool hasSubordinate(
const DtUUID&)
const;
206 void updateDataStorage();
210 myCurrentFrameState.updateStateData(sd);
211 myNextFrameState.updateStateData(sd);
217 myCurrentFrameState.aboutToBeDeleted();
218 myNextFrameState.aboutToBeDeleted();
UUID is a unique ID wrapper class.
Definition: uuid.h:59
Definition: stateDataTypes.h:23
DtSubordinateManagerStateComponentCurrentFrame myCurrentFrameState
Definition: subordinateManagerStateComponent.h:222
bool hasSubordinate(const DtUUID &uuid) const
Definition: subordinateManagerStateComponent.h:72
#define UNDEFINED_METHOD(Type, Method,...)
Definition: doubleBufferedDataStorage.h:68
2) Define the next frame class. This will be used for write access.
Definition: subordinateManagerStateComponent.h:139
DtSubordinateManagerStateComponentData myData
Definition: subordinateManagerStateComponent.h:191
virtual const DtFrameStateInterface * nextFrameState() const
Definition: subordinateManagerStateComponent.h:204
DtSubordinateManagerStateComponentData & operator=(const DtSubordinateManagerStateComponentData &rhs)
Definition: subordinateManagerStateComponent.h:25
Definition: stateComponent.h:266
const DtSubordinateManagerStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: subordinateManagerStateComponent.h:175
const DtSubordinateManagerStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: subordinateManagerStateComponent.h:145
std::vector< DtUUID > mySubordinates
Definition: subordinateManagerStateComponent.h:224
const DtFrameStateInterface * currentFrameState() const
Definition: subordinateManagerStateComponent.h:202
virtual DtFrameStateInterface * nextFrameState()
Definition: subordinateManagerStateComponent.h:203
Contains the DtUUID class declaration.
#define UNDEFINED_RETURNREF_ACCESSOR(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:34
void advanceFrame(const DtSubordinateManagerStateComponentData &data)
Definition: subordinateManagerStateComponent.h:185
const DtUUID & lastSubordinate() const
Definition: subordinateManagerStateComponent.h:100
void addSubordinate(const DtUUID &uuid, int index=-1)
Definition: subordinateManagerStateComponent.h:33
static const DtUUID & nullUUID()
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: subordinateManagerStateComponent.h:208
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:339
Definition: subordinateManagerStateComponent.h:15
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:228
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:379
DtSubordinateManagerStateComponentData(const DtSubordinateManagerStateComponentData &orig)
Definition: subordinateManagerStateComponent.h:20
virtual void aboutToBeDeleted()
bool isDoubleBuffered()
Definition: subordinateManagerStateComponent.h:201
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: subordinateManagerStateComponent.h:196
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
Definition: stateComponent.h:76
const DtUUID & firstSubordinate() const
Definition: subordinateManagerStateComponent.h:90
3) Define the current frame class. This will be used for read access.
Definition: subordinateManagerStateComponent.h:169
DtSubordinateManagerStateComponentData()
Definition: subordinateManagerStateComponent.h:17
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: subordinateManagerStateComponent.h:116
#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
DtSubordinateManagerStateComponentNextFrame myNextFrameState
Definition: subordinateManagerStateComponent.h:223
DtSubordinateManagerStateComponentData & frameState()
Definition: subordinateManagerStateComponent.h:146
virtual void aboutToBeDeleted() override
Definition: subordinateManagerStateComponent.h:214
Contains the DtStateComponent class declaration.
virtual void makeWritable()
Override to make component writable.
Definition: subordinateManagerStateComponent.h:159
bool removeSubordinate(const DtUUID &uuid)
Definition: subordinateManagerStateComponent.h:52
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:291
DtStateComponentCreator< DtSubordinateManagerStateComponentImplementation > DtSubordinateManagerStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: subordinateManagerStateComponent.h:229
std::vector< DtUUID > mySubordinates
Definition: subordinateManagerStateComponent.h:111
void removeAllSubordinates()
Definition: subordinateManagerStateComponent.h:71