pgTree< T > Class Template Reference
[pgGen -- General purpose module]

A tree container which can have a parent and children. More...

#include <pg_tree.h>

List of all members.

Public Member Functions

 pgDefineException (ExceptionInvalidArgument)
 pgDefineException (ExceptionInvalidCall)
 pgDefineException (ExceptionNotInitialized)
 pgTree ()
 Constructs a pgTree.
 ~pgTree ()
 Destructs this pgTree.
void init (T *self)
 Initializes this pgTree to have the specified value.
T * getSelf () const
 Returns the value of this pgTree.
bool hasParent () const
 Returns whether this pgTree has a parent pgTree.
pgTree< T > * getParentN () const
 Returns the parent pgTree of this pgTree.
pgTree< T > * getPrevAllN () const
 Returns the previous pgTree of this pgTree.
pgTree< T > * getNextAllN () const
 Returns the next pgTree of this pgTree.
pgTree< T > * getPrevSiblingN () const
 Returns the previous sibling pgTree of this pgTree.
pgTree< T > * getNextSiblingN () const
 Returns the next sibling pgTree of this pgTree.
void joinBefore (pgTree< T > *tree)
 Insertes this pgTree before the specified pgTree.
void joinAfter (pgTree< T > *tree)
 Insertes this pgTree after the specified pgTree.
void leave ()
 Removes this pgTree from the parent pgTree.
bool hasChild () const
 Returns Whether this pgTree has any child pgTree.
pgTree< T > * getFirstChildN () const
 Returns the first child pgTree of this pgTree.
pgTree< T > * getLastChildN () const
 Returns the last child pgTree of this pgTree.
pgTree< T > * getLastDesc () const
 Returns the last descendant of this pgTree.
void addFirst (pgTree< T > *child)
 Adds the specified pgTree to this pgTree as the first child pgTree.
void addLast (pgTree< T > *child)
 Adds the specified pgTree to this pgTree as the last child pgTree.
void clear ()
 Removes all child pgTrees from this pgTree.


Detailed Description

template<class T>
class pgTree< T >

A tree container which can have a parent and children.

Template Parameters:
T The type which is stored in the pgTree.

Member Function Documentation

template<class T>
void pgTree< T >::addFirst ( pgTree< T > *  child  )  [inline]

Adds the specified pgTree to this pgTree as the first child pgTree.

Parameters:
[in] child A pgTree.

template<class T>
void pgTree< T >::addLast ( pgTree< T > *  child  )  [inline]

Adds the specified pgTree to this pgTree as the last child pgTree.

Parameters:
[in] child A pgTree.

template<class T>
pgTree<T>* pgTree< T >::getFirstChildN (  )  const [inline]

Returns the first child pgTree of this pgTree.

If this pgTree has no child pgTree, returns NULL.

Returns:
The first child pgTree of this pgTree.

template<class T>
pgTree<T>* pgTree< T >::getLastChildN (  )  const [inline]

Returns the last child pgTree of this pgTree.

If this pgTree has no child pgTree, returns NULL.

Returns:
The last child pgTree of this pgTree.

template<class T>
pgTree<T>* pgTree< T >::getLastDesc (  )  const [inline]

Returns the last descendant of this pgTree.

If this pgTree has no child, returns itself.

Returns:
The last descendant of this pgTree.

template<class T>
pgTree<T>* pgTree< T >::getNextAllN (  )  const [inline]

Returns the next pgTree of this pgTree.

If this pgTree has no next pgTree, returns NULL. This method is used to follow the whole tree as list structure.

Returns:
The next pgTree of this pgTree.

template<class T>
pgTree<T>* pgTree< T >::getNextSiblingN (  )  const [inline]

Returns the next sibling pgTree of this pgTree.

If this pgTree has no next sibling pgTree, returns NULL.

Returns:
The next sibling pgTree of this pgTree.

template<class T>
pgTree<T>* pgTree< T >::getParentN (  )  const [inline]

Returns the parent pgTree of this pgTree.

If this pgTree has no parent pgTree, returns NULL.

Returns:
The parent pgTree of this pgTree.

template<class T>
pgTree<T>* pgTree< T >::getPrevAllN (  )  const [inline]

Returns the previous pgTree of this pgTree.

If this pgTree has no previous pgTree, returns NULL. This method is used to follow the whole tree as list structure.

Returns:
The previous pgTree of this pgTree.

template<class T>
pgTree<T>* pgTree< T >::getPrevSiblingN (  )  const [inline]

Returns the previous sibling pgTree of this pgTree.

If this pgTree has no previous sibling pgTree, returns NULL.

Returns:
The previous sibling pgTree of this pgTree.

template<class T>
T* pgTree< T >::getSelf (  )  const [inline]

Returns the value of this pgTree.

Returns:
The value of this pgTree.

template<class T>
bool pgTree< T >::hasChild (  )  const [inline]

Returns Whether this pgTree has any child pgTree.

Returns:
Whether this pgTree has any child pgTree.

template<class T>
bool pgTree< T >::hasParent (  )  const [inline]

Returns whether this pgTree has a parent pgTree.

Returns:
Whether this pgTree has a parent pgTree.

template<class T>
void pgTree< T >::init ( T *  self  )  [inline]

Initializes this pgTree to have the specified value.

This method can be called more than once.

Parameters:
[in] self The pointer to a value.

template<class T>
void pgTree< T >::joinAfter ( pgTree< T > *  tree  )  [inline]

Insertes this pgTree after the specified pgTree.

Parameters:
[in] tree A pgTree.

template<class T>
void pgTree< T >::joinBefore ( pgTree< T > *  tree  )  [inline]

Insertes this pgTree before the specified pgTree.

Parameters:
[in] tree A pgTree.


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

Generated on Sat Aug 15 11:24:38 2009 for Pogolyn by  doxygen 1.5.8