20#ifndef INCLUDED_SVX_SOURCE_INC_TREEVISITOR_HXX
21#define INCLUDED_SVX_SOURCE_INC_TREEVISITOR_HXX
25template<
class ELEMENT,
class NODEINFO,
class PROCESSOR >
37 void process(
const ELEMENT& _root, PROCESSOR& _processor )
59template<
class ELEMENT,
class NODEINFO,
class PROCESSOR >
70 size_t childCount = m_nodeInfo.childCount( m_current );
73 m_currentAncestors.push( m_current );
74 m_current = m_nodeInfo.getChild( m_current, 0 );
75 m_pathToCurrent.push( 0 );
80 while ( !m_pathToCurrent.empty() )
82 const ELEMENT& currentParent = m_currentAncestors.top();
83 childCount = m_nodeInfo.childCount( currentParent );
85 size_t currentChildPos = m_pathToCurrent.top();
86 if ( ++currentChildPos < childCount )
89 m_pathToCurrent.top() = currentChildPos;
90 m_current = m_nodeInfo.getChild( currentParent, currentChildPos );
95 m_currentAncestors.pop();
96 m_pathToCurrent.pop();
TreeVisitor(NODEINFO _nodeInfo)
void process(const ELEMENT &_root, PROCESSOR &_processor)
const NODEINFO m_nodeInfo
::std::stack< size_t > m_pathToCurrent
::std::stack< ELEMENT > m_currentAncestors