Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

TreeNode< T > Class Template Reference

#include <tree.h>

Inheritance diagram for TreeNode< T >:

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

Collaboration graph
[legend]
List of all members.

Public Methods

 TreeNode (T &a_othis)
T * addChild (T *ch)
T & getLastRecur ()
void setNext (T *ch)
T const * getFirstChild () const
T * getFirstChild ()
T const * getNext () const
T * getNext ()

template<typename T>
class TreeNode< T >


Constructor & Destructor Documentation

template<typename T>
TreeNode< T >::TreeNode T &    a_othis [inline]
 

00078       :
00079    parent(NULL), child(NULL), next(NULL), prev(NULL), othis(a_othis)
00080    {}
   T* addChild(T *ch)


Member Function Documentation

template<typename T>
T* TreeNode< T >::addChild T *    ch [inline]
 

00082    {
00083       if (ch==NULL) return ch;
00084       if (child==NULL)
00085       {
00086     child=ch;
00087     ch->parent=&othis;
00088       }
00089       else child->getLastRecur().setNext(ch);
00090       return ch;
00091    }

template<typename T>
T& TreeNode< T >::getLastRecur   [inline]
 

00094    {
00095       if (next!=NULL) return next->getLastRecur();
00096       else return othis;
00097    }

template<typename T>
void TreeNode< T >::setNext T *    ch [inline]
 

00100    {
00101       for (T *cur=ch; cur!=NULL; cur=cur->next)
00102       {
00103     cur->parent=parent;
00104       }
00105       next=ch;
00106       next->prev=&othis;
00107    }

template<typename T>
T const* TreeNode< T >::getFirstChild   const [inline]
 

00109    {
00110       return child;
00111    }

template<typename T>
T* TreeNode< T >::getFirstChild   [inline]
 

00113    {
00114       return child;
00115    }

template<typename T>
T const* TreeNode< T >::getNext   const [inline]
 

00117    {
00118       return next;
00119    }

template<typename T>
T* TreeNode< T >::getNext   [inline]
 

00121    {
00122       return next;
00123    }


The documentation for this class was generated from the following file:
Generated on Mon Apr 7 19:43:50 2003 for DuTree by doxygen1.2.18