Loading...
Searching...
No Matches
BALL::VIEW::CompositeManager Class Reference
Visualisation » Kernel » Other classes

`#include <BALL/VIEW/KERNEL/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 ()
| CompositeManager (const CompositeManager &cm)
virtual | ~CompositeManager ()
virtual void | clear ()
Predicates
bool | has (const Composite *composite) const
bool | hasRoot (const Composite *composite) const
Accessors: inspectors and mutators
bool | insert (Composite &composite)
void | remove (Composite &composite, bool to_delete=true)
Size | getNumberOfComposites () const

## 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

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

Definition at line 26 of file compositeManager.h.

## Member Typedef Documentation

## CompositeConstIterator

typedef HashSet<Composite*>::ConstIterator BALL::VIEW::CompositeManager::CompositeConstIterator

Definition at line 45 of file compositeManager.h.

## CompositeIterator

typedef HashSet<Composite*>::Iterator BALL::VIEW::CompositeManager::CompositeIterator

Definition at line 42 of file compositeManager.h.

## const_pointer

typedef const Composite** BALL::VIEW::CompositeManager::const_pointer

Definition at line 36 of file compositeManager.h.

## const_reference

typedef const Composite*& BALL::VIEW::CompositeManager::const_reference

Definition at line 35 of file compositeManager.h.

## difference_type

typedef Index BALL::VIEW::CompositeManager::difference_type

Definition at line 37 of file compositeManager.h.

## iterator

typedef HashSet<Composite*>::Iterator BALL::VIEW::CompositeManager::iterator

Definition at line 39 of file compositeManager.h.

## pointer

typedef Composite** BALL::VIEW::CompositeManager::pointer

Definition at line 34 of file compositeManager.h.

## reference

typedef Composite*& BALL::VIEW::CompositeManager::reference

Definition at line 33 of file compositeManager.h.

## size_type

typedef Size BALL::VIEW::CompositeManager::size_type

Definition at line 38 of file compositeManager.h.

## value_type

typedef Composite* BALL::VIEW::CompositeManager::value_type

Definition at line 32 of file compositeManager.h.

## Constructor & Destructor Documentation

## CompositeManager() [1/2]

BALL::VIEW::CompositeManager::CompositeManager | ( |  | ) |

Default Constructor.

## CompositeManager() [2/2]

BALL::VIEW::CompositeManager::CompositeManager | ( | const CompositeManager & | cm | ) |

Copy Constructor

## ~CompositeManager()

virtual BALL::VIEW::CompositeManager::~CompositeManager | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## begin() [1/2]

CompositeIterator BALL::VIEW::CompositeManager::begin | ( |  | ) |

inline

Definition at line 110 of file compositeManager.h.

## begin() [2/2]

CompositeConstIterator BALL::VIEW::CompositeManager::begin | ( |  | ) | const

inline

Definition at line 118 of file compositeManager.h.

## clear()

virtual void BALL::VIEW::CompositeManager::clear | ( |  | ) |

virtual

Explicit default initialization.

## dump()

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

## end() [1/2]

CompositeIterator BALL::VIEW::CompositeManager::end | ( |  | ) |

inline

Definition at line 114 of file compositeManager.h.

## end() [2/2]

CompositeConstIterator BALL::VIEW::CompositeManager::end | ( |  | ) | const

inline

Definition at line 122 of file compositeManager.h.

## getComposites() [1/2]

HashSet< Composite * > & BALL::VIEW::CompositeManager::getComposites | ( |  | ) |

inline

Definition at line 126 of file compositeManager.h.

## getComposites() [2/2]

const HashSet< Composite * > & BALL::VIEW::CompositeManager::getComposites | ( |  | ) | const

inline

Definition at line 130 of file compositeManager.h.

## getNumberOfComposites()

Size BALL::VIEW::CompositeManager::getNumberOfComposites | ( |  | ) | const

inline

Return the number of inserted Composites

Definition at line 101 of file compositeManager.h.

## has()

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 !

## hasRoot()

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

## insert()

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

## remove()

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