sps::BitTree::Iterator Class Reference

Implementation of the sps::Iterator interface for a sps::BitTree. More...

#include <BitTree.h>

List of all members.

Public Member Functions

 Iterator (const BitTree &rBitTree)
 Constructs an iterator for rBitTree.
virtual bool HasMoreElements () const
 Checks if there are elements left.
virtual void Begin ()
 Sets the iterator on the first bit in the sps::BitTree.
virtual void Next ()
 Sets the iterator to the next bit in the sps::BitTree.
virtual size_t operator * () const
 Returns the current value(bit) the iterator points to.
Iteratoroperator= (const Iterator &rOther)
 Overwrites this instance of Iterator with a copy of rOther.


Detailed Description

Implementation of the sps::Iterator interface for a sps::BitTree.

Example:

                        sps::BitTree set;
                        sps::BitTree::Iterator it = set.GetIterator();
                        for ( it.Begin(); it.HasMoreElement(); it.Next() )
                        {
                                cout << *it << ", ";
                        }


Member Function Documentation

bool sps::BitTree::Iterator::HasMoreElements (  )  const [inline, virtual]

Checks if there are elements left.

If this method returns true it's save to call operator*() and Next(). The runtime of this method is in O(1).

void sps::BitTree::Iterator::Begin (  )  [inline, virtual]

Sets the iterator on the first bit in the sps::BitTree.

This method should be called before any other method of the Iterator is called. The runtime of Begin() is in O(lg(n)).

void sps::BitTree::Iterator::Next (  )  [inline, virtual]

Sets the iterator to the next bit in the sps::BitTree.

Don't call this method if HasMoreElements() returned false. The runtime of Next() is in O(lg(n)).

size_t sps::BitTree::Iterator::operator * (  )  const [inline, virtual]

Returns the current value(bit) the iterator points to.

Don't call this method if HasMoreElements() returned false. The runtime of operator*() is in O(1).

BitTree::Iterator & sps::BitTree::Iterator::operator= ( const Iterator rOther  )  [inline]

Overwrites this instance of Iterator with a copy of rOther.

The runtime of this method is in O(lg(n)).


The documentation for this class was generated from the following file:
Generated on Wed Jun 20 21:20:43 2007 for SparseSet by  doxygen 1.5.2