seal::BinTreeBreadthFirstIterator< T > Class Template Reference

#include <bintree.h>

Inheritance diagram for seal::BinTreeBreadthFirstIterator< T >:

seal::AbstractIterator< T >

List of all members.

Public Member Functions

 BinTreeBreadthFirstIterator (BinTreeNode< T > *rootNode)
virtual ~BinTreeBreadthFirstIterator ()
virtual bool hasNext (void)
virtual T next (void) throw (OutOfBoundsException)
virtual void reset (void)


Detailed Description

template<typename T>
class seal::BinTreeBreadthFirstIterator< T >

This class encapsulates a breadth firt iterator for any binary tree whose nodes are of type BinTreeNode. One should keep in mind that the behaviour of this iterator is unknown when a binary tree is being resized while the iterator is iterating over the tree. It is best to reset the iterator (with a call to the function BinTreeBreadthFirstIterator::reset) with every resize operation of the binary tree.

Constructor & Destructor Documentation

template<typename T>
seal::BinTreeBreadthFirstIterator< T >::BinTreeBreadthFirstIterator ( BinTreeNode< T > *  rootNode  )  [inline]

Constructor.

Parameters:
rootNode The root node of the binary tree which the iterator should iterate over.

template<typename T>
virtual seal::BinTreeBreadthFirstIterator< T >::~BinTreeBreadthFirstIterator (  )  [inline, virtual]

Destructor.


Member Function Documentation

template<typename T>
bool seal::BinTreeBreadthFirstIterator< T >::hasNext ( void   )  [inline, virtual]

Returns true if there is a next element in the tree to which the iterator can iterate to; False otherwise.

Implements seal::AbstractIterator< T >.

template<typename T>
T seal::BinTreeBreadthFirstIterator< T >::next ( void   )  throw (OutOfBoundsException) [inline, virtual]

Returns the next element in the tree if it exists; Else throws an OutOfBoundsException.

Implements seal::AbstractIterator< T >.

template<typename T>
void seal::BinTreeBreadthFirstIterator< T >::reset ( void   )  [inline, virtual]

Resets the iterator to the first element, that is to the root node of tree. After a call to this function, the iterator can iterate over the entire tree.

Implements seal::AbstractIterator< T >.


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

Generated on Sat May 16 21:35:20 2009 for SEAL by  doxygen 1.5.5