vdk 2.4.0
Public Member Functions | List of all members
AbstractBinaryTree< T, Node >::Iterator Class Reference

Provides a nlog(n) iterator for AbstractBinaryTree. More...

#include <vdkbtrees.h>

Public Member Functions

 Iterator (AbstractBinaryTree< T, Node > &_tree, enum BtreeIteratorMode start=BtMinKey)
 
void StartAt (enum BtreeIteratorMode start)
 
virtual ~Iterator ()
 
virtual void Previous ()
 
virtual void Next ()
 
virtual void Parent ()
 
virtual operator int ()
 
virtual T operator* ()
 
virtual T current ()
 
virtual T * RefObject ()
 
virtual T * Object ()
 
virtual void operator++ ()
 
virtual void operator++ (int)
 
virtual void operator-- ()
 
virtual void operator-- (int)
 

Detailed Description

template<class T, class Node>
class AbstractBinaryTree< T, Node >::Iterator

Provides a nlog(n) iterator for AbstractBinaryTree.

Iterator is implementes as a member of AbstractBinaryTree rather than an external object.

Constructor & Destructor Documentation

◆ Iterator()

template<class T , class Node >
AbstractBinaryTree< T, Node >::Iterator::Iterator ( AbstractBinaryTree< T, Node > &  _tree,
enum BtreeIteratorMode  start = BtMinKey 
)
inline

ructor

Parameters
treetree reference
startwhere the iterator starts, can be:
  • BtMinKey from lowest key
  • BtRootKey from the tree root
  • BtMaxKey from the highest key

◆ ~Iterator()

template<class T , class Node >
virtual AbstractBinaryTree< T, Node >::Iterator::~Iterator ( )
inlinevirtual

Destructor

Member Function Documentation

◆ current()

template<class T , class Node >
virtual T AbstractBinaryTree< T, Node >::Iterator::current ( )
inlinevirtual

Dereferencing operator returns the object of the node currently pointed to by the iterator.

◆ Next()

template<class T , class Node >
virtual void AbstractBinaryTree< T, Node >::Iterator::Next ( )
inlinevirtual

Move iterator to next key

◆ Object()

template<class T , class Node >
virtual T * AbstractBinaryTree< T, Node >::Iterator::Object ( )
inlinevirtual

returns a pointer to the object of the node currently pointed to (as opposed to returning a copy of the node, as the dereferencing operator does).

◆ operator int()

template<class T , class Node >
virtual AbstractBinaryTree< T, Node >::Iterator::operator int ( )
inlinevirtual

Returns o if iterator points a non valid node. ie: was moved behind the lowest/highest key

◆ operator*()

template<class T , class Node >
virtual T AbstractBinaryTree< T, Node >::Iterator::operator* ( )
inlinevirtual

Dereferencing operator returns the object of the node currently pointed to by the iterator.

◆ operator++() [1/2]

template<class T , class Node >
virtual void AbstractBinaryTree< T, Node >::Iterator::operator++ ( )
inlinevirtual

Move iterator to next key

◆ operator++() [2/2]

template<class T , class Node >
virtual void AbstractBinaryTree< T, Node >::Iterator::operator++ ( int  )
inlinevirtual

Move iterator to next key

◆ operator--() [1/2]

template<class T , class Node >
virtual void AbstractBinaryTree< T, Node >::Iterator::operator-- ( )
inlinevirtual

Move iterator to prev key

◆ operator--() [2/2]

template<class T , class Node >
virtual void AbstractBinaryTree< T, Node >::Iterator::operator-- ( int  )
inlinevirtual

Move iterator to prev key

◆ Parent()

template<class T , class Node >
virtual void AbstractBinaryTree< T, Node >::Iterator::Parent ( )
inlinevirtual

Move iterator to parent node

◆ Previous()

template<class T , class Node >
virtual void AbstractBinaryTree< T, Node >::Iterator::Previous ( )
inlinevirtual

Move iterator to prev key

◆ RefObject()

template<class T , class Node >
virtual T * AbstractBinaryTree< T, Node >::Iterator::RefObject ( )
inlinevirtual

returns a pointer to the object of the node currently pointed to (as opposed to returning a copy of the node, as the dereferencing operator does).

◆ StartAt()

template<class T , class Node >
void AbstractBinaryTree< T, Node >::Iterator::StartAt ( enum BtreeIteratorMode  start)
inline

Starts iterator over at the minimum, maximum or root node of the binary tree.


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