libyui  3.4.2
YSingleChildManager< T > Class Template Reference

Children manager that can handle one single child (rejecting any more). More...

#include <YChildrenManager.h>

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

Public Member Functions

 YSingleChildManager (T *containerParent)
 
virtual void add (T *child)
 Add a new child. More...
 
void replace (T *newChild)
 Replace the previous child (if any) with a new one.
 
- Public Member Functions inherited from YChildrenManager< T >
 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 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...
 

Additional Inherited Members

- Public Types inherited from YChildrenManager< T >
typedef std::list< T * > ChildrenList
 
- Protected Attributes inherited from YChildrenManager< T >
T * _container
 
ChildrenList _children
 

Detailed Description

template<class T>
class YSingleChildManager< T >

Children manager that can handle one single child (rejecting any more).

Useful for YAlignment, YFrame etc.

Definition at line 173 of file YChildrenManager.h.

Member Function Documentation

◆ add()

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

Add a new child.

Reimplemented from YChildrenManager.

This will throw a YUITooManyChildrenException if there already is a child.

Reimplemented from YChildrenManager< T >.

Definition at line 189 of file YChildrenManager.h.


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