#include <BitTree.h>
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. | |
Iterator & | operator= (const Iterator &rOther) |
Overwrites this instance of Iterator with a copy of rOther . |
Example:
sps::BitTree set; sps::BitTree::Iterator it = set.GetIterator(); for ( it.Begin(); it.HasMoreElement(); it.Next() ) { cout << *it << ", "; }
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)).