libyui
 
Loading...
Searching...
No Matches
YChildrenManager< T > Class Template Reference

#include <YChildrenManager.h>

Inheritance diagram for YChildrenManager< T >:

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::iterator begin ()
 
ChildrenList::iterator end ()
 
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

◆ YChildrenManager()

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

Constructor.

'containerParent' is the class whose children are managed.

◆ ~YChildrenManager()

template<class T>
virtual YChildrenManager< T >::~YChildrenManager ( )
inlinevirtual

Destructor.

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

◆ begin() [1/2]

template<class T>
ChildrenList::iterator YChildrenManager< T >::begin ( )
inline

Return an iterator that points to the first child.

◆ begin() [2/2]

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

Return an iterator that points to the first child.

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

◆ container()

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

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

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

◆ count()

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

Returns the number of children.

◆ empty()

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

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

◆ end() [1/2]

template<class T>
ChildrenList::iterator YChildrenManager< T >::end ( )
inline

Return an iterator that points after the last child.

◆ end() [2/2]

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

Return an iterator that points after the last child.

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

◆ hasChildren()

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

Check if there are any children.

◆ lastChild()

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

Returns the last child or 0 if there is none.

◆ rbegin()

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

Return a reverse iterator that points to the last child.

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

◆ rend()

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: