Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

tree< T > Class Template Reference

#include <tree.h>

Inheritance diagram for tree< T >:

Inheritance graph
[legend]
Collaboration diagram for tree< T >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef preorder_iterator iterator

Public Member Functions

 tree ()
 constructor: empty tree doesn't exist, it's a one-node tree with no info. Be careful
 tree (const T &)
 constructor: one-node tree
 tree (const tree< T > &)
 copy constructor
 tree (const preorder_iterator &)
 ~tree ()
 destructor
tree< T > & operator= (const tree< T > &)
 assignment
unsigned int num_children () const
 number of children
sibling_iterator nth_child (unsigned int) const
 access nth child
void append_child (const tree< T > &)
 append child to a tree
void hang_child (tree< T > &)
 hang a tree as child of another (no copying!!)
void clear ()
bool empty () const
 detect empty tree
sibling_iterator sibling_begin ()
 begin/end sibling iterator
sibling_iterator sibling_end () const
preorder_iterator begin ()
 begin/end preorder iterator
preorder_iterator end () const

Public Attributes

info

Private Member Functions

void clone (const tree< T > &)
 clone an entire tree

Private Attributes

bool isempty
treeparent
treefirst
treelast
treeprev
treenext

Classes

class  generic_iterator
class  preorder_iterator
 traverse the tree in preorder (parent first, then children) More...
class  sibling_iterator
 traverse all children of the same node More...

template<class T>
class tree< T >


Member Typedef Documentation

template<class T>
typedef preorder_iterator tree< T >::iterator
 


Constructor & Destructor Documentation

template<class T>
tree< T >::tree  ) 
 

constructor: empty tree doesn't exist, it's a one-node tree with no info. Be careful

template<class T>
tree< T >::tree const T &   ) 
 

constructor: one-node tree

template<class T>
tree< T >::tree const tree< T > &   ) 
 

copy constructor

template<class T>
tree< T >::tree const preorder_iterator  ) 
 

template<class T>
tree< T >::~tree  ) 
 

destructor


Member Function Documentation

template<class T>
void tree< T >::append_child const tree< T > &   ) 
 

append child to a tree

template<class T>
tree< T >::preorder_iterator tree< T >::begin  ) 
 

begin/end preorder iterator

template<class T>
void tree< T >::clear  ) 
 

template<class T>
void tree< T >::clone const tree< T > &   )  [private]
 

clone an entire tree

template<class T>
bool tree< T >::empty  )  const
 

detect empty tree

template<class T>
tree< T >::preorder_iterator tree< T >::end  )  const
 

template<class T>
void tree< T >::hang_child tree< T > &   ) 
 

hang a tree as child of another (no copying!!)

template<class T>
tree< T >::sibling_iterator tree< T >::nth_child unsigned  int  )  const
 

access nth child

template<class T>
unsigned int tree< T >::num_children  )  const
 

number of children

template<class T>
tree< T > & tree< T >::operator= const tree< T > &   ) 
 

assignment

template<class T>
tree< T >::sibling_iterator tree< T >::sibling_begin  ) 
 

begin/end sibling iterator

template<class T>
tree< T >::sibling_iterator tree< T >::sibling_end  )  const
 


Member Data Documentation

template<class T>
tree* tree< T >::first [private]
 

template<class T>
T tree< T >::info
 

template<class T>
bool tree< T >::isempty [private]
 

template<class T>
tree * tree< T >::last [private]
 

template<class T>
tree * tree< T >::next [private]
 

template<class T>
tree* tree< T >::parent [private]
 

template<class T>
tree* tree< T >::prev [private]
 


The documentation for this class was generated from the following file:
Generated on Wed Apr 26 12:59:16 2006 for FreeLing by  doxygen 1.4.4