#include <tree.hh>
Public Member Functions | |
tree_node< T > * | add_child (tree_node< T > *tree_node) |
Bind tree_node to the current tree_node and become its child. | |
tree_node< T > * | add_child (T elt) |
Create a tree_node with elt which become the child of the current tree_node. | |
bool | check_consistency () |
Check the consistency of the tree_node. | |
const children_t & | children () const |
The getter of the children. | |
children_t & | children () |
The getter of the children. | |
tree_node< T > * | delete_tree_node () |
Delete the current tree_node. | |
const T & | elt () const |
The const getter of the element. | |
T & | elt () |
The getter of the element. | |
tree_node< T > * | parent () |
The getter of the parent. | |
void | print (std::ostream &ostr, int level=0) |
Print on ostr the arborescence with the current tree_node as root. | |
tree_node< T > * | search (T &elt) |
Search the tree_node with value elt in the arborescence of the current tree_node. | |
int | search_rec (tree_node< T > **res, T &elt) |
The using method for method search. | |
void | set_parent (tree_node< T > *parent) |
Bind tree_node to the current tree_node and become its parent. | |
tree_node (T elt) | |
Constructor. | |
tree_node () | |
Constructor. |
mln::util::tree_node< T >::tree_node | ( | ) | [inline] |
Constructor.
mln::util::tree_node< T >::tree_node | ( | T | elt | ) | [inline] |
tree_node< T > * mln::util::tree_node< T >::add_child | ( | tree_node< T > * | tree_node | ) | [inline] |
Bind tree_node
to the current tree_node and become its child.
References mln::util::tree_node< T >::children(), and mln::util::tree_node< T >::parent().
tree_node< T > * mln::util::tree_node< T >::add_child | ( | T | elt | ) | [inline] |
bool mln::util::tree_node< T >::check_consistency | ( | ) | [inline] |
const std::vector< tree_node< T > * > & mln::util::tree_node< T >::children | ( | ) | const [inline] |
std::vector< tree_node< T > * > & mln::util::tree_node< T >::children | ( | ) | [inline] |
The getter of the children.
Referenced by mln::util::tree_node< T >::add_child(), and mln::util::tree< T >::add_tree_up().
tree_node< T > * mln::util::tree_node< T >::delete_tree_node | ( | ) | [inline] |
Delete the current tree_node.
const T & mln::util::tree_node< T >::elt | ( | ) | const [inline] |
T & mln::util::tree_node< T >::elt | ( | ) | [inline] |
The getter of the element.
Referenced by mln::util::tree_node< T >::print().
tree_node< T > * mln::util::tree_node< T >::parent | ( | ) | [inline] |
The getter of the parent.
Referenced by mln::util::tree_node< T >::add_child(), mln::util::branch_iter_ind< T >::deepness(), and mln::util::branch_iter< T >::deepness().
void mln::util::tree_node< T >::print | ( | std::ostream & | ostr, | |
int | level = 0 | |||
) | [inline] |
Print on ostr
the arborescence with the current tree_node as root.
[in] | ostr | The output stream. |
[in] | level | The deep level |
References mln::util::tree_node< T >::elt().
tree_node< T > * mln::util::tree_node< T >::search | ( | T & | elt | ) | [inline] |
int mln::util::tree_node< T >::search_rec | ( | tree_node< T > ** | res, | |
T & | elt | |||
) | [inline] |
void mln::util::tree_node< T >::set_parent | ( | tree_node< T > * | parent | ) | [inline] |