Glossygloss  0.2
Glossygloss is set of classes to use several data structure as Tree or hash table.
 All Classes Files Functions Variables Macros Pages
Public Member Functions | Private Attributes | List of all members
Tree< T > Class Template Reference

Tree is a recursive structure using nodes. More...

#include <tree.hpp>

Public Member Functions

 Tree ()
 
 Tree (const Tree< T > &other)
 
 Tree (T element)
 
 ~Tree ()
 
bool contains (T element)
 
int height ()
 
void put (T element)
 
void remove (T element)
 
string toString ()
 

Private Attributes

Node< T > _root
 

Detailed Description

template<typename T = string>
class Tree< T >

Tree is a recursive structure using nodes.

A root value and subtrees of children, represented as a set of linked nodes.

Constructor & Destructor Documentation

template<typename T = string>
Tree< T >::Tree ( )

First node of the tree Default constructor

template<typename T = string>
Tree< T >::Tree ( const Tree< T > &  other)

Copy constructor

template<typename T = string>
Tree< T >::Tree ( element)

Common constructor, create an tree

Parameters
[in]elementRoot of the tree
template<typename T = string>
Tree< T >::~Tree ( )

Destructor, destroy the whole tree

Member Function Documentation

template<typename T = string>
bool Tree< T >::contains ( element)

Is the element in the tree ?

Parameters
[in]elementSearch the element in the Tree
[out]boolTrue if element is here, else false.
template<typename T = string>
int Tree< T >::height ( )

The height of the tree

Parameters
[out]hgtHeight of the tree
template<typename T = string>
void Tree< T >::put ( element)

Put an element in the tree

Parameters
[in]elementNew element to put into the tree
template<typename T = string>
void Tree< T >::remove ( element)

Remove an element from the tree

Parameters
[in]dataElement to remove
template<typename T = string>
string Tree< T >::toString ( )

Get a string representation of the Tree Each node tags is separated with a comma

Parameters
[out]descString representation of the tree

Member Data Documentation

template<typename T = string>
Node<T> Tree< T >::_root
private

The documentation for this class was generated from the following file: