21 : mySubordinates(orig.mySubordinates)
37 mySubordinates.push_back(uuid);
41 if (index >= mySubordinates.size())
43 mySubordinates.resize(index + 1);
46 mySubordinates[index] = uuid;
51 std::vector<DtUUID>::iterator iter = mySubordinates.begin();
52 std::vector<DtUUID>::iterator end = mySubordinates.end();
58 mySubordinates.erase(iter);
71 std::vector<DtUUID>::const_iterator iter = mySubordinates.begin();
72 std::vector<DtUUID>::const_iterator end = mySubordinates.end();
89 if (mySubordinates.size())
91 return mySubordinates[0];
99 if (mySubordinates.size())
101 return mySubordinates[mySubordinates.size() - 1];
129 virtual
int numSubordinates()
const {
throw DtUnimplementedMethod(
"The int numSubordinates() const is undefined for this class."); };
130 virtual bool hasSubordinate(
const DtUUID&)
const {
throw DtUnimplementedMethod(
"The bool hasSubordinate(const DtUUID&) const is undefined for this class."); };
132 mutable boost::signals2::signal<void (const DtFrameStateInterface*, const std::vector<DtUUID>& oldSubordinates,
const std::vector<DtUUID>& newSubordinates)> signal_subordinatesChanged;
145 int numSubordinates()
const;
146 const DtUUID& firstSubordinate()
const;
147 const DtUUID& lastSubordinate()
const;
148 const std::vector<DtUUID>& subordinates()
const;
149 void setSubordinates(
const std::vector<DtUUID>&);
150 void addSubordinate(
const DtUUID&,
int index = -1);
151 bool removeSubordinate(
const DtUUID&);
152 bool hasSubordinate(
const DtUUID&)
const;
153 void removeAllSubordinates();
159 virtual void makeReadOnly() {};
174 const DtUUID& firstSubordinate()
const;
175 const DtUUID& lastSubordinate()
const;
176 int numSubordinates()
const;
177 const std::vector<DtUUID>& subordinates()
const;
178 bool hasSubordinate(
const DtUUID&)
const;
203 void updateDataStorage();
207 myCurrentFrameState.updateStateData(sd);
208 myNextFrameState.updateStateData(sd);
214 myCurrentFrameState.aboutToBeDeleted();
215 myNextFrameState.aboutToBeDeleted();
UUID is a unique ID wrapper class.
Definition: rwUUID.h:226
Definition: stateDataTypes.h:23
DtSubordinateManagerStateComponentCurrentFrame myCurrentFrameState
Definition: subordinateManagerStateComponent.h:219
bool hasSubordinate(const DtUUID &uuid) const
Definition: subordinateManagerStateComponent.h:69
#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:136
DtSubordinateManagerStateComponentData myData
Definition: subordinateManagerStateComponent.h:188
virtual const DtFrameStateInterface * nextFrameState() const
Definition: subordinateManagerStateComponent.h:201
DtSubordinateManagerStateComponentData & operator=(const DtSubordinateManagerStateComponentData &rhs)
Definition: subordinateManagerStateComponent.h:25
Definition: stateComponent.h:257
const DtSubordinateManagerStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: subordinateManagerStateComponent.h:172
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:142
std::vector< DtUUID > mySubordinates
Definition: subordinateManagerStateComponent.h:221
const DtFrameStateInterface * currentFrameState() const
Definition: subordinateManagerStateComponent.h:199
virtual DtFrameStateInterface * nextFrameState()
Definition: subordinateManagerStateComponent.h:200
Contains the DtUUID class declaration.
#define UNDEFINED_RETURNREF_ACCESSOR(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:34
void advanceFrame(const DtSubordinateManagerStateComponentData &data)
Definition: subordinateManagerStateComponent.h:182
const DtUUID & lastSubordinate() const
Definition: subordinateManagerStateComponent.h:97
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:205
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:336
Definition: subordinateManagerStateComponent.h:15
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:219
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:365
DtSubordinateManagerStateComponentData(const DtSubordinateManagerStateComponentData &orig)
Definition: subordinateManagerStateComponent.h:20
virtual void aboutToBeDeleted()
bool isDoubleBuffered()
Definition: subordinateManagerStateComponent.h:198
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: subordinateManagerStateComponent.h:193
#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:74
const DtUUID & firstSubordinate() const
Definition: subordinateManagerStateComponent.h:87
3) Define the current frame class. This will be used for read access.
Definition: subordinateManagerStateComponent.h:166
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:113
#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:220
DtSubordinateManagerStateComponentData & frameState()
Definition: subordinateManagerStateComponent.h:143
virtual void aboutToBeDeleted() override
Definition: subordinateManagerStateComponent.h:211
Contains the DtStateComponent class declaration.
virtual void makeWritable()
Override to make component writable.
Definition: subordinateManagerStateComponent.h:156
bool removeSubordinate(const DtUUID &uuid)
Definition: subordinateManagerStateComponent.h:49
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:282
DtStateComponentCreator< DtSubordinateManagerStateComponentImplementation > DtSubordinateManagerStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: subordinateManagerStateComponent.h:226
std::vector< DtUUID > mySubordinates
Definition: subordinateManagerStateComponent.h:108
void removeAllSubordinates()
Definition: subordinateManagerStateComponent.h:68