83 InitTraversal(torder, _enumType);
90 delete iteratorStackRepr;
106 while (newtop != 0) {
112 iteratorStackRepr->pstack.Push(newtop);
113 if (traversalOrder != PostOrder)
break;
131 if ((traversalOrder == PreOrder) || (traversalOrder == PreAndPostOrder)) {
135 Push(IteratorToPushIfAny(current));
144 while ((Top()->IsValid() ==
false) &&
145 (iteratorStackRepr->pstack.Depth() > 1)) {
151 }
else if (traversalOrder == PostOrder) {
154 Push(IteratorToPushIfAny(current));
165 InitTraversal(torder, _enumType);
176 if (traversalOrder == PostOrder)
183 InitTraversal(torder, _enumType);
198 return (top ? top->
IsValid() :
false);
203 switch(clientTraversalOrder) {
205 case ReversePreOrder:
208 case ReversePostOrder:
211 case PreAndPostOrder: {
216 }
else if (stop != 0) {
230 return clientTraversalOrder;
235 switch(clientTraversalOrder) {
238 case PreAndPostOrder:
240 case ReversePreOrder:
241 case ReversePostOrder:
252 return iteratorStackRepr->pstack.Depth();
269 int depth = iteratorStackRepr->pstack.Depth();
270 while (depth-- > maxDepth)
278 clientTraversalOrder = torder;
279 enumType = _enumType;
281 traversalOrder = PostOrder;
282 else if (torder == ReversePreOrder)
283 traversalOrder = PreOrder;
284 else if (torder == ReversePostOrder)
285 traversalOrder = PostOrder;
289 DIAG_Assert((torder == PreOrder) || (torder == PostOrder) ||
290 (torder == PreAndPostOrder),
"");
291 traversalOrder = torder;
299 int depth = iteratorStackRepr->pstack.Depth();
300 for (; --depth >= 0; ) {
316 : value(singletonValue), done(false), visitType(vtype)
329 return (
void*) retval;
void ReConstruct(TraversalOrder torder, IterStackEnumType enumType=ITER_STACK_ENUM_ALL_NODES)
StackableIterator * Top(void) const
virtual bool IterationIsForward() const
virtual void * CurrentUpCall() const =0
TraversalVisitType VisitType() const
void FreeStack(int maxDepth)
IteratorStack(TraversalOrder torder, IterStackEnumType enumType=ITER_STACK_ENUM_ALL_NODES)
TraversalOrder GetTraversalOrder() const
SingletonIterator(const void *singletonValue, TraversalVisitType vtype)
void InitTraversal(TraversalOrder torder, IterStackEnumType enumType)
void * CurrentUpCall() const
virtual bool IsValid() const
StackableIterator * GetIteratorAtPosition(unsigned int depth) const
virtual TraversalVisitType VisitType() const
void Push(StackableIterator *)
TraversalVisitType visitType
void * CurrentUpCall() const