Template class for tree items that maintain sort order. More...
#include <TreeItem.h>
Public Member Functions | |
| SortedTreeItem (PAYLOAD val, SortedTreeItem< PAYLOAD > *parentItem=0) | |
| virtual | ~SortedTreeItem () |
| void | insertChildSorted (SortedTreeItem< PAYLOAD > *newChild) |
| SortedTreeItem< PAYLOAD > * | parent () const |
| SortedTreeItem< PAYLOAD > * | next () const |
| SortedTreeItem< PAYLOAD > * | firstChild () const |
Private Member Functions | |
| SortedTreeItem (const SortedTreeItem< PAYLOAD > &) | |
| SortedTreeItem< PAYLOAD > & | operator= (const SortedTreeItem< PAYLOAD > &) |
Template class for tree items that maintain sort order.
Class 'PAYLOAD' to provide operator<() in addition to what template 'TreeItem' requires.
| SortedTreeItem< PAYLOAD >::SortedTreeItem | ( | PAYLOAD | val, | |
| SortedTreeItem< PAYLOAD > * | parentItem = 0 | |||
| ) | [inline] |
Constructor. Creates a new tree item with value "val" and inserts it in ascending sort order into the children list of "parent".
| virtual SortedTreeItem< PAYLOAD >::~SortedTreeItem | ( | ) | [inline, virtual] |
Destructor.
| SortedTreeItem< PAYLOAD >::SortedTreeItem | ( | const SortedTreeItem< PAYLOAD > & | ) | [inline, private] |
Private (i.e. disabled) copy constructor and operator=()
| SortedTreeItem<PAYLOAD>* SortedTreeItem< PAYLOAD >::firstChild | ( | ) | const [inline] |
Returns this item's first child or 0 if there is none.
Reimplemented from TreeItem< PAYLOAD >.
References TreeItem< PAYLOAD >::_firstChild.
Referenced by SortedTreeItem< PAYLOAD >::insertChildSorted().
| void SortedTreeItem< PAYLOAD >::insertChildSorted | ( | SortedTreeItem< PAYLOAD > * | newChild | ) | [inline] |
Insert a child into the internal children list in ascending sort order. Called from the new child's constructor, thus 'public'.
References SortedTreeItem< PAYLOAD >::firstChild(), TreeItem< PAYLOAD >::next(), TreeItem< PAYLOAD >::setFirstChild(), TreeItem< PAYLOAD >::setNext(), and TreeItem< PAYLOAD >::value().
| SortedTreeItem<PAYLOAD>* SortedTreeItem< PAYLOAD >::next | ( | ) | const [inline] |
Returns this item's next sibling or 0 if there is none.
Reimplemented from TreeItem< PAYLOAD >.
References TreeItem< PAYLOAD >::_next.
| SortedTreeItem<PAYLOAD>& SortedTreeItem< PAYLOAD >::operator= | ( | const SortedTreeItem< PAYLOAD > & | ) | [inline, private] |
| SortedTreeItem<PAYLOAD>* SortedTreeItem< PAYLOAD >::parent | ( | ) | const [inline] |
Returns this item's parent or 0 if there is none.
Reimplemented from TreeItem< PAYLOAD >.
References TreeItem< PAYLOAD >::_parent.
1.6.3