libyui
Public Types | Public Member Functions | Protected Attributes

YChildrenManager< T > Class Template Reference

#include <YChildrenManager.h>

Inheritance diagram for YChildrenManager< T >:
YChildrenRejector< T > YSingleChildManager< T >

List of all members.

Public Types

typedef std::list< T * > ChildrenList

Public Member Functions

 YChildrenManager (T *containerParent)
virtual ~YChildrenManager ()
bool hasChildren () const
bool empty () const
int count () const
ChildrenList::const_iterator begin () const
ChildrenList::const_iterator end () const
ChildrenList::const_reverse_iterator rbegin () const
ChildrenList::const_reverse_iterator rend () const
T * firstChild ()
T * lastChild ()
virtual void add (T *child)
virtual void remove (T *child)
virtual void clear ()
bool contains (T *child) const
T * container () const

Protected Attributes

T * _container
ChildrenList _children

Detailed Description

template<class T>
class YChildrenManager< T >

Abstract base template class for children management, such as child widgets.


Constructor & Destructor Documentation

template<class T >
YChildrenManager< T >::YChildrenManager ( T *  containerParent) [inline]

Constructor.

'containerParent' is the class whose children are managed.

template<class T >
virtual YChildrenManager< T >::~YChildrenManager ( ) [inline, virtual]

Destructor.


Member Function Documentation

template<class T >
virtual void YChildrenManager< T >::add ( T *  child) [inline, virtual]

Add a new child.

This may throw exceptions if more children are added than the class whose children are handled (the associated widget) can handle.

Reimplemented in YSingleChildManager< T >, and YChildrenRejector< T >.

template<class T >
ChildrenList::const_iterator YChildrenManager< T >::begin ( ) const [inline]

Return an iterator that points to the first child.

template<class T >
virtual void YChildrenManager< T >::clear ( ) [inline, virtual]

Remove all children. This only removes the children from the children manager's list; it does not delete them.

template<class T >
T* YChildrenManager< T >::container ( ) const [inline]

Returns the associated container, i.e. the object whose children are handled here.

template<class T >
bool YChildrenManager< T >::contains ( T *  child) const [inline]

Check if the children list contains the specified child. Returns 'true' if the children list contains the child, 'false' otherwise.

template<class T >
int YChildrenManager< T >::count ( ) const [inline]

Returns the number of children.

template<class T >
bool YChildrenManager< T >::empty ( ) const [inline]

Check if the children list is empty, i.e. if there are no children.

template<class T >
ChildrenList::const_iterator YChildrenManager< T >::end ( ) const [inline]

Return an iterator that points after the last child.

template<class T >
T* YChildrenManager< T >::firstChild ( ) [inline]

Returns the first child or 0 if there is none. Useful mostly for children managers that handle only one child.

template<class T >
bool YChildrenManager< T >::hasChildren ( ) const [inline]

Check if there are any children.

template<class T >
T* YChildrenManager< T >::lastChild ( ) [inline]

Returns the last child or 0 if there is none.

template<class T >
ChildrenList::const_reverse_iterator YChildrenManager< T >::rbegin ( ) const [inline]

Return a reverse iterator that points to the last child.

template<class T >
virtual void YChildrenManager< T >::remove ( T *  child) [inline, virtual]

Remove a child. This only removes the child from the children manager's list; it does not delete it.

template<class T >
ChildrenList::const_reverse_iterator YChildrenManager< T >::rend ( ) const [inline]

Return a reverse iterator that points before the first child.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Enumerations Friends