libyui
3.3.2
|
Template class for tree items that maintain sort order. More...
#include <TreeItem.h>
Public Member Functions | |
SortedTreeItem (PAYLOAD val, SortedTreeItem< PAYLOAD > *parentItem=0) | |
Constructor. More... | |
virtual | ~SortedTreeItem () |
Destructor. | |
void | insertChildSorted (SortedTreeItem< PAYLOAD > *newChild) |
Insert a child into the internal children list in ascending sort order. More... | |
SortedTreeItem< PAYLOAD > * | parent () const |
Returns this item's parent or 0 if there is none. | |
SortedTreeItem< PAYLOAD > * | next () const |
Returns this item's next sibling or 0 if there is none. | |
SortedTreeItem< PAYLOAD > * | firstChild () const |
Returns this item's first child or 0 if there is none. | |
![]() | |
TreeItem (const PAYLOAD &val, TreeItem< PAYLOAD > *parent=0) | |
Constructor. More... | |
virtual | ~TreeItem () |
Destructor. More... | |
const PAYLOAD & | value () const |
Returns this item's value, the "payload". | |
void | setValue (PAYLOAD newValue) |
Set this item's value, the "payload". More... | |
TreeItem< PAYLOAD > * | parent () const |
Returns this item's parent or 0 if there is none. | |
TreeItem< PAYLOAD > * | next () const |
Returns this item's next sibling or 0 if there is none. | |
TreeItem< PAYLOAD > * | firstChild () const |
Returns this item's first child or 0 if there is none. | |
void | setParent (TreeItem< PAYLOAD > *newParent) |
Sets this item's parent. | |
void | setNext (TreeItem< PAYLOAD > *newNext) |
Sets this item's next sibling. | |
void | setFirstChild (TreeItem< PAYLOAD > *newFirstChild) |
Sets this item's first child. | |
void | addChild (TreeItem< PAYLOAD > *newChild) |
Add a child to the internal children list - usually called from within the child's default constructor. More... | |
Additional Inherited Members | |
![]() | |
TreeItem (PAYLOAD val, bool autoAddChild, TreeItem< PAYLOAD > *parent=0) | |
Constructor to be called for derived classes: Decide whether or not to automatically insert this item into the parent's children list. More... | |
![]() | |
PAYLOAD | _value |
TreeItem< PAYLOAD > * | _parent |
TreeItem< PAYLOAD > * | _next |
TreeItem< PAYLOAD > * | _firstChild |
Template class for tree items that maintain sort order.
Class 'PAYLOAD' to provide operator<() in addition to what template 'TreeItem' requires.
Definition at line 191 of file TreeItem.h.
|
inline |
Constructor.
Creates a new tree item with value "val" and inserts it in ascending sort order into the children list of "parent".
Definition at line 199 of file TreeItem.h.
|
inline |
Insert a child into the internal children list in ascending sort order.
Called from the new child's constructor, thus 'public'.
Definition at line 227 of file TreeItem.h.