![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/data/Tree.h>
Inheritance diagram for Tree< T >:Classes | |
| class | Iter |
Public Member Functions | |
| Tree (const T &value) | |
| const T & | data (void) const |
| T & | data (void) |
| const Tree * | children (void) const |
| Tree * | children (void) |
| const Tree * | sibling (void) const |
| Tree * | sibling (void) |
| bool | hasChild (Tree *tree) const |
| bool | contains (Tree *tree) const |
| int | count (void) const |
| bool | isEmpty (void) const |
| operator bool (void) const | |
| void | prependChild (Tree *child) |
| void | appendChild (Tree *child) |
| void | addSibling (Tree *newSibling) |
| void | add (Tree *child) |
| template<class TT > | |
| void | addAll (const TT &coll) |
| void | removeChild (Tree *child) |
| void | remove (Tree *child) |
| void | remove (const Iter &iter) |
| template<class TT > | |
| void | removeAll (const TT &coll) |
| void | clear (void) |
This class implements a minimal tree whose children are linked with a simple link list. It provides facilities to store a value on the tree and to access either children, or closer sibling.
| T | Type of stored values. |
|
inline |
Build a new empty tree storing the given value.
| value | Value to store in the tree. |
References Tree::add().
|
inline |
References Tree::addAll().
References Tree::addSibling().
References Tree::appendChild().
Get list of children of the tree, that is, the first child.
References Tree::children().
Get list of children of the tree, that is, the first child.
References Tree::children().
References Tree::clear().
References Tree< T >::hasChild().
|
inline |
References Tree::count().
|
inline |
Get assignable reference on the value stored in the tree.
|
inline |
Get the value stored in the tree.
References Tree::hasChild().
Referenced by Tree< T >::contains().
References Tree::isEmpty().
References Tree::isEmpty().
References Tree::prependChild().
References Tree< T >::removeChild().
References Tree::remove().
|
inline |
References Tree::removeAll().
References Tree::removeChild().
Referenced by Tree< T >::remove().