#include <SgNode.h>
Definition at line 491 of file SgNode.h.
Public Member Functions | |
SgNodeIterator (SgNode *rootOfSubtree, bool postOrder=false) | |
Create an iterator for iterating through all nodes in the subtree of 'rootOfSubtree', including the node itself. | |
void | Abort () |
Abort the iteration. | |
void | operator++ () |
SgNode * | operator * () const |
operator bool () const | |
Private Member Functions | |
bool | Next () |
Find next node in the tree. | |
SgNodeIterator (const SgNodeIterator &) | |
Not implemented. | |
SgNodeIterator & | operator= (const SgNodeIterator &) |
Not implemented. | |
Private Attributes | |
bool | m_postOrder |
SgNode *const | m_rootOfSubtree |
SgNode * | m_nextNode |
SgNodeIterator::SgNodeIterator | ( | SgNode * | rootOfSubtree, | |
bool | postOrder = false | |||
) |
Create an iterator for iterating through all nodes in the subtree of 'rootOfSubtree', including the node itself.
If 'preOrder' (default), return internal nodes before their sons; if 'postOrder', then return the leaves before the internal nodes.
Definition at line 774 of file SgNode.cpp.
References SgNode::HasSon(), SgNode::LeftMostSon(), m_nextNode, m_postOrder, and m_rootOfSubtree.
SgNodeIterator::SgNodeIterator | ( | const SgNodeIterator & | ) | [private] |
Not implemented.
void SgNodeIterator::Abort | ( | ) |
Abort the iteration.
The next call to operator bool will return false.
Definition at line 504 of file SgNode.h.
References m_nextNode.
bool SgNodeIterator::Next | ( | ) | [private] |
Find next node in the tree.
Return false when done with all nodes.
Definition at line 799 of file SgNode.cpp.
References SgNode::Father(), SgNode::HasFather(), SgNode::HasRightBrother(), SgNode::HasSon(), SgNode::LeftMostSon(), m_nextNode, m_postOrder, m_rootOfSubtree, SgNode::NextDepthFirst(), SgNode::RightBrother(), and SG_ASSERT.
Referenced by operator++().
SgNode* SgNodeIterator::operator * | ( | ) | const |
SgNodeIterator::operator bool | ( | ) | const |
void SgNodeIterator::operator++ | ( | ) |
SgNodeIterator& SgNodeIterator::operator= | ( | const SgNodeIterator & | ) | [private] |
Not implemented.
SgNode* SgNodeIterator::m_nextNode [private] |
Definition at line 534 of file SgNode.h.
Referenced by Abort(), Next(), operator *(), operator bool(), operator++(), and SgNodeIterator().
bool SgNodeIterator::m_postOrder [private] |
SgNode* const SgNodeIterator::m_rootOfSubtree [private] |