#include <YChildrenManager.h>
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 |
Abstract base template class for children management, such as child widgets.
|
inline |
Constructor.
'containerParent' is the class whose children are managed.
|
inlinevirtual |
Destructor.
|
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 >.
|
inline |
Return an iterator that points to the first child.
|
inline |
Return an iterator that points to the first child.
|
inlinevirtual |
Remove all children. This only removes the children from the children manager's list; it does not delete them.
|
inline |
Returns the associated container, i.e. the object whose children are handled here.
|
inline |
Check if the children list contains the specified child. Returns 'true' if the children list contains the child, 'false' otherwise.
|
inline |
Returns the number of children.
|
inline |
Check if the children list is empty, i.e. if there are no children.
|
inline |
Return an iterator that points after the last child.
|
inline |
Return an iterator that points after the last child.
|
inline |
Returns the first child or 0 if there is none. Useful mostly for children managers that handle only one child.
|
inline |
Check if there are any children.
|
inline |
Returns the last child or 0 if there is none.
|
inline |
Return a reverse iterator that points to the last child.
|
inlinevirtual |
Remove a child. This only removes the child from the children manager's list; it does not delete it.
|
inline |
Return a reverse iterator that points before the first child.