Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/genstruct/Tree.h>
Classes | |
class | Iterator |
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 Iterator &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. |
elm::genstruct::Tree< T >::Tree | ( | const T & | value | ) |
Build a new empty tree storing the given value.
value | Value to store in the tree. |
void elm::genstruct::Tree< T >::add | ( | Tree< T > * | child | ) |
References elm::inhstruct::Tree::add().
References elm::inhstruct::Tree::addAll().
void elm::genstruct::Tree< T >::addSibling | ( | Tree< T > * | newSibling | ) |
References elm::inhstruct::Tree::addSibling().
void elm::genstruct::Tree< T >::appendChild | ( | Tree< T > * | child | ) |
References elm::inhstruct::Tree::appendChild().
const Tree< T > * elm::genstruct::Tree< T >::children | ( | void | ) | const |
Get list of children of the tree, that is, the first child.
References elm::inhstruct::Tree::children().
Tree< T > * elm::genstruct::Tree< T >::children | ( | void | ) |
Get list of children of the tree, that is, the first child.
References elm::inhstruct::Tree::children().
void elm::genstruct::Tree< T >::clear | ( | void | ) |
References elm::inhstruct::Tree::clear().
bool elm::genstruct::Tree< T >::contains | ( | Tree< T > * | tree | ) | const |
References elm::genstruct::Tree< T >::hasChild().
int elm::genstruct::Tree< T >::count | ( | void | ) | const |
References elm::inhstruct::Tree::count().
const T & elm::genstruct::Tree< T >::data | ( | void | ) | const |
Get the value stored in the tree.
T & elm::genstruct::Tree< T >::data | ( | void | ) |
Get assignable reference on the value stored in the tree.
bool elm::genstruct::Tree< T >::hasChild | ( | Tree< T > * | tree | ) | const |
References elm::inhstruct::Tree::hasChild().
Referenced by elm::genstruct::Tree< T >::contains().
bool elm::genstruct::Tree< T >::isEmpty | ( | void | ) | const |
References elm::inhstruct::Tree::isEmpty().
elm::genstruct::Tree< T >::operator bool | ( | void | ) | const |
References elm::inhstruct::Tree::isEmpty().
void elm::genstruct::Tree< T >::prependChild | ( | Tree< T > * | child | ) |
References elm::inhstruct::Tree::prependChild().
void elm::genstruct::Tree< T >::remove | ( | Tree< T > * | child | ) |
References elm::inhstruct::Tree::remove().
void elm::genstruct::Tree< T >::remove | ( | const Iterator & | iter | ) |
References elm::genstruct::Tree< T >::removeChild().
References elm::inhstruct::Tree::removeAll().
void elm::genstruct::Tree< T >::removeChild | ( | Tree< T > * | child | ) |
References elm::inhstruct::Tree::removeChild().
Referenced by elm::genstruct::Tree< T >::remove().
const Tree< T > * elm::genstruct::Tree< T >::sibling | ( | void | ) | const |
Get the next sibling of the current tree.
References elm::inhstruct::Tree::sibling().
Tree< T > * elm::genstruct::Tree< T >::sibling | ( | void | ) |
Get the next sibling of the current tree.
References elm::inhstruct::Tree::sibling().