Claw
1.7.3
|
A tree structure with any number of children. More...
#include <tree.hpp>
Public Types | |
typedef T | value_type |
The type of the value stored in the nodes. | |
typedef tree< T > | self_type |
The type of the current class. | |
typedef child_list::iterator | iterator |
typedef child_list::const_iterator | const_iterator |
Public Member Functions | |
tree () | |
Default constructor. | |
tree (const T &that) | |
Constructor with initialization. | |
bool | operator== (const self_type &that) const |
Equality operator. | |
bool | is_leaf () const |
Tell if this node is a leaf (ie. it has no child). | |
self_type & | add_child (const T &v) |
Add a child to this node. | |
self_type & | add_child (const self_type &v) |
Add a child subtree to this node. | |
iterator | find (const T &v) |
Search the first child having a given value. | |
const_iterator | find (const T &v) const |
Search the first child having a given value. | |
iterator | begin () |
Get an iterator on the begining of the children. | |
iterator | end () |
Get an iterator just past the end of the children. | |
const_iterator | begin () const |
Get a constant iterator on the begining of the children. | |
const_iterator | end () const |
Get a constant iterator just past the end of the children. |
Public Attributes | |
T | value |
The value in this node. |
A tree structure with any number of children.
|
explicit |
claw::tree< T >::self_type & claw::tree< T >::add_child | ( | const T & | v | ) |
claw::tree< T >::self_type & claw::tree< T >::add_child | ( | const self_type & | v | ) |
claw::tree< T >::iterator claw::tree< T >::find | ( | const T & | v | ) |
claw::tree< T >::const_iterator claw::tree< T >::find | ( | const T & | v | ) | const |
bool claw::tree< T >::operator== | ( | const self_type & | that | ) | const |
Equality operator.
that | The tree to compare to. |
Definition at line 60 of file tree.tpp.
References claw::tree< T >::begin(), and claw::tree< T >::value.