mln::util::tree_node< T > Class Template Reference

Class of generic tree_node for tree. More...

#include <tree.hh>

List of all members.

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.


Detailed Description

template<typename T>
class mln::util::tree_node< T >

Class of generic tree_node for tree.


Constructor & Destructor Documentation

template<typename T >
mln::util::tree_node< T >::tree_node (  )  [inline]

Constructor.

template<typename T >
mln::util::tree_node< T >::tree_node ( elt  )  [inline]

Constructor.

Parameters:
[in] elt The element of tree_node.


Member Function Documentation

template<typename T >
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.

Parameters:
[in] tree_node The new child tree_node.
Returns:
The child tree_node.

References mln::util::tree_node< T >::children(), and mln::util::tree_node< T >::parent().

template<typename T >
tree_node< T > * mln::util::tree_node< T >::add_child ( elt  )  [inline]

Create a tree_node with elt which become the child of the current tree_node.

Parameters:
[in] elt The element of the new child to add.
Returns:
The new tree_node created.

template<typename T >
bool mln::util::tree_node< T >::check_consistency (  )  [inline]

Check the consistency of the tree_node.

Returns:
true if no error, else false.

template<typename T >
const std::vector< tree_node< T > * > & mln::util::tree_node< T >::children (  )  const [inline]

The getter of the children.

Returns:
The children of the tree_node in const.

template<typename T >
std::vector< tree_node< T > * > & mln::util::tree_node< T >::children (  )  [inline]

The getter of the children.

Returns:
The children of the tree_node.

Referenced by mln::util::tree_node< T >::add_child(), and mln::util::tree< T >::add_tree_up().

template<typename T >
tree_node< T > * mln::util::tree_node< T >::delete_tree_node (  )  [inline]

Delete the current tree_node.

template<typename T >
const T & mln::util::tree_node< T >::elt (  )  const [inline]

The const getter of the element.

Returns:
The element of the tree_node in const.

template<typename T >
T & mln::util::tree_node< T >::elt (  )  [inline]

The getter of the element.

Returns:
The element of the tree_node.

Referenced by mln::util::tree_node< T >::print().

template<typename T >
tree_node< T > * mln::util::tree_node< T >::parent (  )  [inline]

template<typename T >
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.

Parameters:
[in] ostr The output stream.
[in] level The deep level

References mln::util::tree_node< T >::elt().

template<typename T >
tree_node< T > * mln::util::tree_node< T >::search ( T &  elt  )  [inline]

Search the tree_node with value elt in the arborescence of the current tree_node.

Parameters:
[in] elt The value of the searched tree_node.
Returns:
If not found 0 else the tree_node with elt value.

References mln::util::tree_node< T >::search_rec().

template<typename T >
int mln::util::tree_node< T >::search_rec ( tree_node< T > **  res,
T &  elt 
) [inline]

The using method for method search.

Referenced by mln::util::tree_node< T >::search().

template<typename T >
void mln::util::tree_node< T >::set_parent ( tree_node< T > *  parent  )  [inline]

Bind tree_node to the current tree_node and become its parent.

Parameters:
[in] parent The new parent tree_node.


Generated on Tue Jul 14 16:33:19 2009 for Milena (Olena) by  doxygen 1.5.9