VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtSubordinateManager Class Reference

Description: Objects may contain a collection of other objects, such as overlays or pseudo-aggregate entities. More...

Inheritance diagram for DtSubordinateManager:
Inheritance graph
[legend]

Public Member Functions

 DtSubordinateManager (DtSimManager *simObjectManager)
 Constructor.
 DtSubordinateManager (const DtSubordinateManager &orig)
 Copy Constructor.
const DtSubordinateManageroperator= (const DtSubordinateManager &orig)
 Assignment Operator.
virtual ~DtSubordinateManager ()
 Destructor.
virtual DtSubordinateManagerclone () const
 Creates a new manager calling the copy constructor and returns the result.
virtual bool addSubordinate (DtVrfObject *subordinate, int designator=0)
 All adding subordinate calls will fail if the specified designator is already in use.
virtual bool addSubordinateBefore (DtVrfObject *subordinate, DtVrfObject *beforeObject, int designator=0)
virtual bool addSubordinateAfter (DtVrfObject *subordinate, DtVrfObject *afterObject, int designator=0)
 note that if the afterObject is not found, the object is added to the end of the list
virtual void removeSubordinate (DtVrfObject *subordinate)
 Removes given object as a subordinate.
virtual void removeAllSubordinates ()
 note that if the beforeObject is not found, the object is added to the end of the list
virtual int numSubordinates () const
 Returns the number of subrodinates managed by this object.
virtual DtVrfObjectfirstSubordinate () const
 useful to be able to get the first or last in the list without needed to spawn an iterator.
virtual DtVrfObjectlastSubordinate () const
virtual bool isSubordinate (const DtEntityIdentifier &id) const
 Returns true if this object is listed in this subordinate manager.
virtual bool isSubordinate (DtVrfObject *simObj) const
const DtKeyedVrfObjectIteratoriterator () const
 allocates and returns an iterator to iterate over this subObject list.
virtual int designatorForSubordinate (DtVrfObject *subordinate) const
 Returns the designator number for a subordinate in the list.
virtual int designatorForSubordinate (const DtEntityIdentifier &id) const
virtual DtVrfObjectsubordinateForDesignator (int designator) const
 Returns the subordinate with a particular designator.
virtual bool setDesignator (const DtEntityIdentifier &id, int designator)
 Sets the designator of a subordinate to the specified value.
virtual bool setDesignator (DtVrfObject *subordinate, int designator)
virtual int firstAvailableDesignator (int start=1) const
 Returns the lowest unused designator.
virtual int maxUsedDesignator () const
 Returns the highest used designator.
virtual void reorderToDesignatorOrder ()
 Causes the order of the subordinate list to be in ascending designator order.
virtual void designatorOrderedList (std::vector< DtEntityIdentifier > &designatorOrderedList) const
 Returns list of DtEntityIdentifiers, ordered from lowest to highest designator.
virtual void setSubordinateOrder (const std::vector< DtEntityIdentifier > &orderedList)
 Removes all subordinates from the subordinate manager and then adds new subordinates in the order given by orderedList.
virtual void addSubordinatesChangedCallback (DtSubordinateManagerCallbackFcn fcn, void *userData)
 Registers callback for notification of any change to the subordinates (addition, removal, reordering).
virtual void removeSubordinatesChangedCallback (DtSubordinateManagerCallbackFcn fcn, void *userData)
 Removes callback for notification of any change to the subordinates (addition, removal, reordering).
virtual int nextAvailableDesignator (int cur=0) const
 Returns the highest next designator based on the designator table and the current designator assigned.

Protected Member Functions

void copySubordinateList (const DtList &list)
void emptySubordinateList ()
DtListItem * findSubordinateItem (const DtEntityIdentifier &id) const
 Searches the list for a given entity id.
virtual void invokeSubordinatesChangedCallbacks () const

Protected Attributes

DtSimManagermySimObjectManager
DtKeyedVrfObjectIteratormyIterator
DtList mySubordinateList
 The list of entity id's is kept since order is important.
DtEntityIdIntAssociationList myDesignatorTable
 The table of entity id's and designators is used to associate a designator with each entity.
std::vector
< DtSubordinateManagerCallbackInfo
mySubordinatesChangedCallbackList
 List of DtSubordinateCallbackFcn*s.

Private Member Functions

 DtSubordinateManager ()
 Default Constructor. Not implemented.

Detailed Description

Description: 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 DtList of the object DtEntityIdentifiers. The iterator that can be spawned will iterate through DtEntityIdentifiers, look up the objects in the object mgr. and return pointers to them.

Constructor & Destructor Documentation

DtSubordinateManager::DtSubordinateManager ( )
private

Default Constructor. Not implemented.

DtSubordinateManager::DtSubordinateManager ( DtSimManager simObjectManager)

Constructor.

DtSubordinateManager::DtSubordinateManager ( const DtSubordinateManager orig)

Copy Constructor.

virtual DtSubordinateManager::~DtSubordinateManager ( )
virtual

Destructor.

Member Function Documentation

const DtSubordinateManager& DtSubordinateManager::operator= ( const DtSubordinateManager orig)

Assignment Operator.

virtual DtSubordinateManager* DtSubordinateManager::clone ( ) const
virtual

Creates a new manager calling the copy constructor and returns the result.

Reimplemented in DtVrfSubordinateManager.

virtual bool DtSubordinateManager::addSubordinate ( DtVrfObject subordinate,
int  designator = 0 
)
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 bool DtSubordinateManager::addSubordinateBefore ( DtVrfObject subordinate,
DtVrfObject beforeObject,
int  designator = 0 
)
virtual
virtual bool DtSubordinateManager::addSubordinateAfter ( DtVrfObject subordinate,
DtVrfObject afterObject,
int  designator = 0 
)
virtual

note that if the afterObject is not found, the object is added to the end of the list

virtual void DtSubordinateManager::removeSubordinate ( DtVrfObject subordinate)
virtual

Removes given object as a subordinate.

virtual void DtSubordinateManager::removeAllSubordinates ( )
virtual

note that if the beforeObject is not found, the object is added to the end of the list

virtual int DtSubordinateManager::numSubordinates ( ) const
virtual

Returns the number of subrodinates managed by this object.

virtual DtVrfObject* DtSubordinateManager::firstSubordinate ( ) const
virtual

useful to be able to get the first or last in the list without needed to spawn an iterator.

virtual DtVrfObject* DtSubordinateManager::lastSubordinate ( ) const
virtual
virtual bool DtSubordinateManager::isSubordinate ( const DtEntityIdentifier &  id) const
virtual

Returns true if this object is listed in this subordinate manager.

virtual bool DtSubordinateManager::isSubordinate ( DtVrfObject simObj) const
virtual
const DtKeyedVrfObjectIterator& DtSubordinateManager::iterator ( ) const

allocates and returns an iterator to iterate over this subObject list.

It is the responsibility of the caller to delete this iterator when finished with it.

virtual int DtSubordinateManager::designatorForSubordinate ( DtVrfObject subordinate) const
virtual

Returns the designator number for a subordinate in the list.

Note that 0 is the only designator more than one entity can have.

virtual int DtSubordinateManager::designatorForSubordinate ( const DtEntityIdentifier &  id) const
virtual
virtual DtVrfObject* DtSubordinateManager::subordinateForDesignator ( int  designator) const
virtual

Returns the subordinate with a particular designator.

Does not work for designator = 0

virtual bool DtSubordinateManager::setDesignator ( const DtEntityIdentifier &  id,
int  designator 
)
virtual

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 bool DtSubordinateManager::setDesignator ( DtVrfObject subordinate,
int  designator 
)
virtual
virtual int DtSubordinateManager::firstAvailableDesignator ( int  start = 1) const
virtual

Returns the lowest unused designator.

virtual int DtSubordinateManager::maxUsedDesignator ( ) const
virtual

Returns the highest used designator.

(there may be holes in the sequence)

virtual void DtSubordinateManager::reorderToDesignatorOrder ( )
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 void DtSubordinateManager::designatorOrderedList ( std::vector< DtEntityIdentifier > &  designatorOrderedList) const
virtual

Returns list of DtEntityIdentifiers, ordered from lowest to highest designator.

virtual void DtSubordinateManager::setSubordinateOrder ( const std::vector< DtEntityIdentifier > &  orderedList)
virtual

Removes all subordinates from the subordinate manager and then adds new subordinates in the order given by orderedList.

virtual void DtSubordinateManager::addSubordinatesChangedCallback ( DtSubordinateManagerCallbackFcn  fcn,
void *  userData 
)
virtual

Registers callback for notification of any change to the subordinates (addition, removal, reordering).

virtual void DtSubordinateManager::removeSubordinatesChangedCallback ( DtSubordinateManagerCallbackFcn  fcn,
void *  userData 
)
virtual

Removes callback for notification of any change to the subordinates (addition, removal, reordering).

virtual int DtSubordinateManager::nextAvailableDesignator ( int  cur = 0) const
virtual

Returns the highest next designator based on the designator table and the current designator assigned.

void DtSubordinateManager::copySubordinateList ( const DtList &  list)
protected
void DtSubordinateManager::emptySubordinateList ( )
protected
DtListItem* DtSubordinateManager::findSubordinateItem ( const DtEntityIdentifier &  id) const
protected

Searches the list for a given entity id.

virtual void DtSubordinateManager::invokeSubordinatesChangedCallbacks ( ) const
protectedvirtual

Member Data Documentation

DtSimManager* DtSubordinateManager::mySimObjectManager
protected
DtKeyedVrfObjectIterator* DtSubordinateManager::myIterator
protected
DtList DtSubordinateManager::mySubordinateList
protected

The list of entity id's is kept since order is important.

DtEntityIdIntAssociationList DtSubordinateManager::myDesignatorTable
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.

std::vector<DtSubordinateManagerCallbackInfo> DtSubordinateManager::mySubordinatesChangedCallbackList
protected

List of DtSubordinateCallbackFcn*s.

Clients register callback functions on this list for notification when the list of subordinates changed for some reason (addition, removal, list ordering).


The documentation for this class was generated from the following file:

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)