#include <compositeManager.h>
Public Types | |
Typedefs for STL compliance | |
typedef Composite * | value_type |
typedef Composite *& | reference |
typedef Composite ** | pointer |
typedef const Composite *& | const_reference |
typedef const Composite ** | const_pointer |
typedef Index | difference_type |
typedef Size | size_type |
typedef HashSet< Composite * >::Iterator | iterator |
typedef HashSet< Composite * >::Iterator | CompositeIterator |
typedef HashSet< Composite * >::ConstIterator | CompositeConstIterator |
Public Member Functions | |
Constructors and Destructors | |
CompositeManager () throw () | |
Default Constructor. | |
CompositeManager (const CompositeManager &cm) throw () | |
Copy Constructor. | |
virtual | ~CompositeManager () throw () |
Destructor. | |
virtual void | clear () throw () |
Explicit default initialization. | |
Predicates | |
bool | has (const Composite *composite) const throw () |
Test if the CompositeManager has the Composite itself or one of its ancestors. | |
bool | hasRoot (const Composite *composite) const throw () |
Test if the CompositeManager has the Composite itself as root entry (no search for childs or descendents). | |
Accessors: inspectors and mutators | |
bool | insert (Composite &composite) throw () |
Insert a Composite. | |
void | remove (Composite &composite, bool to_delete=true) throw () |
Remove a Composite. | |
Size | getNumberOfComposites () const throw () |
Return the number of inserted Composites. | |
STL Iterator compliance | |
CompositeIterator | begin () throw () |
CompositeIterator | end () throw () |
CompositeConstIterator | begin () const throw () |
CompositeConstIterator | end () const throw () |
HashSet< Composite * > & | getComposites () throw () |
const HashSet< Composite * > & | getComposites () const throw () |
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const throw () |
Internal value dump. |
This class is a container for all Composite objects, which are used in an application. When the CompositeManager is destroyed, all inserted Composites are deleted.
|
Default Constructor.
|
|
Destructor.
|
|
Explicit default initialization.
|
|
Internal value dump. Dumps the current state to a output ostream s with dumping depth depth.
|
|
Test if the CompositeManager has the Composite itself or one of its ancestors. This method also works if the Composite might have been deleted, but it is quite slow O(n) with n = number of all Composites ! |
|
Test if the CompositeManager has the Composite itself as root entry (no search for childs or descendents). Quite Fast with O(log n) with n = number of roots (Systems). |
|
Insert a Composite. Composites which are descendents of already inserted Composites can not be inserted.
|
|
Remove a Composite. The Composite and its descendents will be destroyed if to_delete is true |