#ifndef _BSPTREE_INORDERSTACK_HPP_ #define _BSPTREE_INORDERSTACK_HPP_ #ifndef _BSPTREE_TREENODE_HPP_ #include #endif #ifndef _COMMON_BLOCK_HPP_ #include #endif #ifndef _COMMON_SMARTPOINTER_HPP_ #include #endif template class InorderStack : protected Block > > { public: InorderStack(void); virtual ~InorderStack(); void push(SmartPointer > &ptrNode); BOOL pop(SmartPointer > &ptrNode); void clear(void); DWORD size(void)const; private: InorderStack(const InorderStack &inorderStack); InorderStack &operator=(const InorderStack &inorderStack); }; template inline InorderStack::InorderStack(void) { } template inline InorderStack::InorderStack(const InorderStack &inorderStack) { // private implementation *this=inorderStack; } template inline InorderStack::~InorderStack() { } template inline InorderStack &InorderStack::operator=(const InorderStack &/*inorderStack*/) { // private implementation return *this; } template inline void InorderStack::push(SmartPointer > &ptrNode) { insert(&SmartPointer >(ptrNode)); } template inline BOOL InorderStack::pop(SmartPointer > &ptrNode) { int items; if(!(items=size()))return FALSE; ptrNode=operator[](items-1); Block > >::remove(items-1); return TRUE; } template inline void InorderStack::clear(void) { remove(); } template inline DWORD InorderStack::size(void)const { return Block > >::size(); } #endif