Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Public Member Functions | Private Member Functions | Private Attributes

SgNodeConstIterator Class Reference

Iterator for iterating through all nodes in subtree. More...

#include <SgNode.h>

List of all members.

Public Member Functions

 SgNodeConstIterator (const SgNode *rootOfSubtree, bool postOrder=false)
 Create an iterator for iterating through all nodes in the subtree of 'rootOfSubtree', including the node itself.
bool Next ()
 Find next node in the tree.
void Abort ()
 Abort the iteration.
void operator++ ()
const SgNodeoperator* () const
 operator bool () const

Private Member Functions

 SgNodeConstIterator (const SgNodeConstIterator &)
 Not implemented.
SgNodeConstIteratoroperator= (const SgNodeConstIterator &)
 Not implemented.

Private Attributes

bool m_postOrder
const SgNode *const m_rootOfSubtree
const SgNodem_nextNode

Detailed Description

Iterator for iterating through all nodes in subtree.

Definition at line 517 of file SgNode.h.


Constructor & Destructor Documentation

SgNodeConstIterator::SgNodeConstIterator ( const 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 785 of file SgNode.cpp.

References SgNode::HasSon(), SgNode::LeftMostSon(), m_nextNode, m_postOrder, and m_rootOfSubtree.

SgNodeConstIterator::SgNodeConstIterator ( const SgNodeConstIterator  )  [private]

Not implemented.


Member Function Documentation

void SgNodeConstIterator::Abort (  ) 

Abort the iteration.

The next call to operator bool will return false.

Definition at line 531 of file SgNode.h.

References m_nextNode.

bool SgNodeConstIterator::Next (  ) 

Find next node in the tree.

Return false when done with all nodes.

Definition at line 830 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++().

SgNodeConstIterator::operator bool (  )  const

Definition at line 548 of file SgNode.h.

References m_nextNode.

const SgNode* SgNodeConstIterator::operator* (  )  const

Definition at line 542 of file SgNode.h.

References m_nextNode, and SG_ASSERT.

void SgNodeConstIterator::operator++ (  ) 

Definition at line 536 of file SgNode.h.

References m_nextNode, Next(), and SG_ASSERT.

SgNodeConstIterator& SgNodeConstIterator::operator= ( const SgNodeConstIterator  )  [private]

Not implemented.


Member Data Documentation

Definition at line 558 of file SgNode.h.

Referenced by Abort(), Next(), operator bool(), operator*(), operator++(), and SgNodeConstIterator().

Definition at line 554 of file SgNode.h.

Referenced by Next(), and SgNodeConstIterator().

Definition at line 556 of file SgNode.h.

Referenced by Next(), and SgNodeConstIterator().


The documentation for this class was generated from the following files:


Sun Mar 13 2011 Doxygen 1.7.1