BALL::VIEW::CompositeManager Class Reference
[Other classes]

CompositeManager class. More...

#include <compositeManager.h>

List of all members.


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 ()
Default Constructor.
CompositeManager (const CompositeManager &cm)
Copy Constructor.
virtual ~CompositeManager ()
Destructor.
virtual void clear ()
Explicit default initialization.
Predicates
bool has (const Composite *composite) const
Test if the CompositeManager has the Composite itself or one of its ancestors.
bool hasRoot (const Composite *composite) const
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)
Insert a Composite.
void remove (Composite &composite, bool to_delete=true)
Remove a Composite.
Size getNumberOfComposites () const
Return the number of inserted Composites.
STL Iterator compliance
CompositeIterator begin ()
CompositeIterator end ()
CompositeConstIterator begin () const
CompositeConstIterator end () const
HashSet< Composite * > & getComposites ()
const HashSet< Composite * > & getComposites () const
virtual void dump (std::ostream &s=std::cout, Size depth=0) const
Internal value dump.

Detailed Description

CompositeManager class.

Management of Composites. 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.


Member Function Documentation

virtual void BALL::VIEW::CompositeManager::dump ( std::ostream & s = std::cout,
Size depth = 0
) const [virtual]

Internal value dump.

Dumps the current state to a output ostream s with dumping depth depth.

Parameters:
s output stream where to output the state
depth the dumping depth

bool BALL::VIEW::CompositeManager::has ( const Composite * composite ) const

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 !

bool BALL::VIEW::CompositeManager::hasRoot ( const Composite * composite ) const

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).

bool BALL::VIEW::CompositeManager::insert ( Composite & composite )

Insert a Composite.

Composites which are descendents of already inserted Composites can not be inserted.

Returns:
true, if the Composite could be inserted

void BALL::VIEW::CompositeManager::remove ( Composite & composite,
bool to_delete = true
)

Remove a Composite.

The Composite and its descendents will be destroyed if to_delete is true


Generated on Thu Aug 6 18:30:54 2009 for BALL by doxygen 1.5.8