libyui  3.3.2
YChildrenManager< T > Class Template Reference

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

#include <YChildrenManager.h>

Inheritance diagram for YChildrenManager< T >:
Collaboration diagram for YChildrenManager< T >:

Public Types

typedef std::list< T * > ChildrenList
 

Public Member Functions

 YChildrenManager (T *containerParent)
 Constructor. More...
 
virtual ~YChildrenManager ()
 Destructor.
 
bool hasChildren () const
 Check if there are any children.
 
bool empty () const
 Check if the children list is empty, i.e. More...
 
int count () const
 Returns the number of children.
 
ChildrenList::iterator begin ()
 Return an iterator that points to the first child.
 
ChildrenList::iterator end ()
 Return an iterator that points after the last child.
 
ChildrenList::const_iterator begin () const
 Return an iterator that points to the first child.
 
ChildrenList::const_iterator end () const
 Return an iterator that points after the last child.
 
ChildrenList::const_reverse_iterator rbegin () const
 Return a reverse iterator that points to the last child.
 
ChildrenList::const_reverse_iterator rend () const
 Return a reverse iterator that points before the first child.
 
T * firstChild ()
 Returns the first child or 0 if there is none. More...
 
T * lastChild ()
 Returns the last child or 0 if there is none.
 
virtual void add (T *child)
 Add a new child. More...
 
virtual void remove (T *child)
 Remove a child. More...
 
virtual void clear ()
 Remove all children. More...
 
bool contains (T *child) const
 Check if the children list contains the specified child. More...
 
T * container () const
 Returns the associated container, i.e. More...
 

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.

Definition at line 37 of file YChildrenManager.h.

Constructor & Destructor Documentation

◆ YChildrenManager()

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

Constructor.

'containerParent' is the class whose children are managed.

Definition at line 46 of file YChildrenManager.h.

Member Function Documentation

◆ add()

template<class T >
virtual void YChildrenManager< T >::add ( T *  child)
inlinevirtual

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 YChildrenRejector< T >, and YSingleChildManager< T >.

Definition at line 128 of file YChildrenManager.h.

◆ clear()

template<class T >
virtual void YChildrenManager< T >::clear ( )
inlinevirtual

Remove all children.

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

Definition at line 142 of file YChildrenManager.h.

◆ container()

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

Returns the associated container, i.e.

the object whose children are handled here.

Definition at line 160 of file YChildrenManager.h.

◆ contains()

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.

Definition at line 150 of file YChildrenManager.h.

◆ empty()

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

Check if the children list is empty, i.e.

if there are no children.

Definition at line 66 of file YChildrenManager.h.

◆ firstChild()

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.

Definition at line 113 of file YChildrenManager.h.

◆ remove()

template<class T >
virtual void YChildrenManager< T >::remove ( T *  child)
inlinevirtual

Remove a child.

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

Definition at line 135 of file YChildrenManager.h.


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