![]() |
VR-Forces 5.0.2 Developer's Guide
|
Objects may contain a collection of other objects, such as overlays or pseudo-aggregate entities. This class defines an interface for maintaining a collection of these subObjects. What's actually stored is a DtSimObjectReferenceList of the object DtUUIDs.
This class accesses Next Frame State only and is not thread safe. Use only from within the DtLocalObject tick or other sections where multiple threads are not running on this data.
Public Attributes | |
| boost::signals2::signal< void(const DtUUID &)> | signal_subordinateRemoved |
| boost::signals2::signal< void(const DtUUID &)> | signal_subordinateAdded |
| boost::signals2::signal< void()> | signal_designatorOrderChanged |
Protected Member Functions | |
| virtual bool | findSubordinateItem (const DtUUID &id) const |
| virtual void | subordinateDeleted (const DtUUID &) |
Protected Attributes | |
| const DtSimulationServices * | mySimulationServices |
| std::map< DtUUID, int > | myDesignatorsByUUID |
| std::map< int, DtUUID > | myUnitsByDesignator |
| std::set< int > | myAvailableDesignators |
| tbb::spin_rw_mutex | myMutex |
| bool | myNeedsReorderToDesignatorOrder |
| DtSimObjectReferenceList | mySubordinates |
| DtLocalObject * | myOwner |
| boost::signals2::scoped_connection | myLocalObjectDeletedConnection |
| boost::signals2::scoped_connection | mySubordinateDeletedConnection |
Private Member Functions | |
| DtSubordinateManager (const DtSubordinateManager &orig) | |
| const DtSubordinateManager & | operator= (const DtSubordinateManager &orig) |
|
private |
Copy Constructor.
| DtSubordinateManager::DtSubordinateManager | ( | const DtSimulationServices * | , |
| DtLocalObject * | owner | ||
| ) |
Constructor.
|
virtual |
Destructor.
|
private |
Assignment Operator.
|
virtual |
All adding subordinate calls will fail if the specified designator is already in use. 0 is the only designator which is allowed for multiple subordinates. (0 implies no designator).
Adds an object as a subordinate.
|
virtual |
If designator is 0 will call resetDesignatorsToSubordinateOrder as a side effect.
|
virtual |
note that if the afterObject is not found, the object is added to the end of the list. If designator is 0 will call resetDesignatorsToSubordinateOrder as a side effect
Removes given object as a subordinate.
|
virtual |
note that if the beforeObject is not found, the object is added to the end of the list
|
virtual |
Returns the number of subrodinates managed by this object.
|
virtual |
Given the current subordinate order, reset all designators given the order.
|
virtual |
useful to be able to get the first or last in the list without needed to spawn an iterator.
|
virtual |
|
virtual |
Returns true if this object is listed in this subordinate manager.
Returns the designator number for a subordinate in the list. Note that 0 is the only designator more than one entity can have.
|
virtual |
Returns the subordinate with a particular designator. Does not work for designator = 0.
Sets the designator of a subordinate to the specified value. This call will fail (and return false) if the specified designator is already in use. 0 is the only designator that can be used by more that one subordinate.
|
virtual |
Returns the highest used designator. (there may be holes in the sequence)
|
virtual |
Causes the order of the subordinate list to be in ascending designator order. Any with no designator (designator = 0) will appear in an undefined order at the end of the list.
|
virtual |
Returns list of DtUUIDs, ordered from lowest to highest designator.
|
virtual |
Removes all subordinates from the subordinate manager and then adds new subordinates in the order given by orderedList.
Returns the highest next designator based on the designator table and the current designator assigned.
|
inline |
| const DtSimObjectReferenceList& DtSubordinateManager::subordinates | ( | ) | const |
Provides a list of subordinates. Note that this list is not necessarily in designator order; for that, use designatorOrderedList().
| DtSimObjectReferenceList& DtSubordinateManager::nextFrameSubordinates | ( | ) |
|
virtual |
Returns true if this designator is in use.
|
protectedvirtual |
|
mutable |
|
mutable |
| boost::signals2::signal<void ()> DtSubordinateManager::signal_designatorOrderChanged |
|
protected |
The table of entity id's and designators is used to associate a designator with each entity. Mutator functions in this class ensure that an entity appears in both lists.
|
mutableprotected |
|
protected |
|
protected |
|
protected |
This is a list of the subordinates in order that they were added to the manager – which may not be the designator order.
|
protected |
|
protected |
|
protected |