62 lines
1.2 KiB
C++
62 lines
1.2 KiB
C++
#ifndef _BSPTREE_TREEITERATORINORDER_HPP_
|
|
#define _BSPTREE_TREEITERATORINORDER_HPP_
|
|
#ifndef _BSPTREE_BINARYTREE_HPP_
|
|
#include <bsptree/bintree.hpp>
|
|
#endif
|
|
#ifndef _BSPTREE_INORDERSTACK_HPP_
|
|
#include <bsptree/inorder.hpp>
|
|
#endif
|
|
|
|
template <class T>
|
|
class TreeIteratorInorder
|
|
{
|
|
public:
|
|
TreeIteratorInorder(void);
|
|
TreeIteratorInorder(BinaryTree<T> &binaryTree);
|
|
virtual ~TreeIteratorInorder();
|
|
T *operator++(void);
|
|
T *operator++(int postFixDummy);
|
|
TreeIteratorInorder<T> &operator=(BinaryTree<T> &binaryTree);
|
|
void reset(void);
|
|
private:
|
|
void createInorderStack(BinaryTree<T> &binaryTree);
|
|
InorderStack<T> mInorderStack;
|
|
};
|
|
|
|
template <class T>
|
|
inline
|
|
TreeIteratorInorder<T>::TreeIteratorInorder(void)
|
|
{
|
|
}
|
|
|
|
template <class T>
|
|
inline
|
|
TreeIteratorInorder<T>::TreeIteratorInorder(BinaryTree<T> &binaryTree)
|
|
{
|
|
createInorderStack(binaryTree);
|
|
}
|
|
|
|
template <class T>
|
|
inline
|
|
TreeIteratorInorder<T>::~TreeIteratorInorder()
|
|
{
|
|
}
|
|
|
|
template <class T>
|
|
inline
|
|
T *TreeIteratorInorder<T>::operator++(int /*postFixDummy*/)
|
|
{
|
|
return operator++();
|
|
}
|
|
|
|
template <class T>
|
|
inline
|
|
void TreeIteratorInorder<T>::reset(void)
|
|
{
|
|
mInorderStack.clear();
|
|
}
|
|
#if defined(_MSC_VER)
|
|
#include <bsptree/iteratei.tpp>
|
|
#endif
|
|
#endif
|