MADARA  3.2.3
madara::expression::PostOrderIteratorImpl Class Reference

Iterates through an ExpressionTree in post-order. More...

#include <IteratorImpl.h>

Inheritance diagram for madara::expression::PostOrderIteratorImpl:
madara::expression::ExpressionTreeIteratorImpl

Public Types

typedef int difference_type
 
typedef ::std::forward_iterator_tag iterator_category
 
typedef int * pointer
 
typedef int & reference
 
typedef madara::knowledge::KnowledgeRecord value_type
 

Public Member Functions

 PostOrderIteratorImpl (const ExpressionTree &tree, bool end_iter=false)
 Construct an PostOrderIteratorImpl. More...
 
virtual ~PostOrderIteratorImpl (void)
 Dtor. More...
 
virtual ExpressionTreeIteratorImplclone (void)
 Method for cloning an impl. Necessary for post increments. More...
 
virtual bool operator!= (const ExpressionTreeIteratorImpl &lhs) const
 Nonequality operator. More...
 
virtual ExpressionTree operator* (void)
 Dereference operator returns a reference to the item contained at the current position. More...
 
virtual const ExpressionTree operator* (void) const
 Returns a const reference to the item contained at the current position. More...
 
virtual void operator++ (void)
 Increment operator (used for both pre- and post-increment). More...
 
virtual bool operator== (const ExpressionTreeIteratorImpl &rhs) const
 Equality operator. More...
 

Protected Attributes

const ExpressionTreetree_
 The tree we are iterating over. More...
 

Private Attributes

madara::utility::LStack< ExpressionTreestack_
 Our current position in the iteration. More...
 

Friends

class ExpressionTreeIterator
 
class utility::Refcounter< ExpressionTreeIteratorImpl >
 

Detailed Description

Iterates through an ExpressionTree in post-order.

Plays the role of the "implementor" class in the Bridge pattern that defines the post-order iteration algorithm.

Definition at line 204 of file IteratorImpl.h.

Member Typedef Documentation

Definition at line 242 of file IteratorImpl.h.

Definition at line 244 of file IteratorImpl.h.

Constructor & Destructor Documentation

madara::expression::PostOrderIteratorImpl::PostOrderIteratorImpl ( const ExpressionTree tree,
bool  end_iter = false 
)

Construct an PostOrderIteratorImpl.

Construct an PostOrderExpressionTreeIterator.

If end_iter is set to true, the iterator points to the end of the tree. Otherwise, the iterator starts with a free tree.

If end_iter is set to true, the iterator points to the end of the tree

Definition at line 300 of file IteratorImpl.cpp.

madara::expression::PostOrderIteratorImpl::~PostOrderIteratorImpl ( void  )
virtual

Dtor.

destructor - nothing to do

Definition at line 337 of file IteratorImpl.cpp.

Member Function Documentation

madara::expression::ExpressionTreeIteratorImpl * madara::expression::PostOrderIteratorImpl::clone ( void  )
virtual

Method for cloning an impl. Necessary for post increments.

Method for cloning an impl.

Necessary for post increments (bridge)

See also
ExpressionTreeIterator

Implements madara::expression::ExpressionTreeIteratorImpl.

Definition at line 466 of file IteratorImpl.cpp.

bool madara::expression::PostOrderIteratorImpl::operator!= ( const ExpressionTreeIteratorImpl lhs) const
virtual

Nonequality operator.

checks two iterators for inequality

Implements madara::expression::ExpressionTreeIteratorImpl.

Definition at line 456 of file IteratorImpl.cpp.

madara::expression::ExpressionTree madara::expression::PostOrderIteratorImpl::operator* ( void  )
virtual

Dereference operator returns a reference to the item contained at the current position.

Returns the Node that the iterator is pointing to (non-const version)

Implements madara::expression::ExpressionTreeIteratorImpl.

Definition at line 345 of file IteratorImpl.cpp.

const madara::expression::ExpressionTree madara::expression::PostOrderIteratorImpl::operator* ( void  ) const
virtual

Returns a const reference to the item contained at the current position.

Returns the Node that the iterator is pointing to (const version)

Implements madara::expression::ExpressionTreeIteratorImpl.

Definition at line 353 of file IteratorImpl.cpp.

void madara::expression::PostOrderIteratorImpl::operator++ ( void  )
virtual

Increment operator (used for both pre- and post-increment).

moves the iterator to the next node (pre-increment)

Implements madara::expression::ExpressionTreeIteratorImpl.

Definition at line 361 of file IteratorImpl.cpp.

bool madara::expression::PostOrderIteratorImpl::operator== ( const ExpressionTreeIteratorImpl rhs) const
virtual

Equality operator.

checks two iterators for equality

Implements madara::expression::ExpressionTreeIteratorImpl.

Definition at line 407 of file IteratorImpl.cpp.

Friends And Related Function Documentation

friend class ExpressionTreeIterator
friend

Definition at line 206 of file IteratorImpl.h.

Definition at line 207 of file IteratorImpl.h.

Member Data Documentation

madara::utility::LStack<ExpressionTree> madara::expression::PostOrderIteratorImpl::stack_
private

Our current position in the iteration.

Definition at line 250 of file IteratorImpl.h.

const ExpressionTree& madara::expression::ExpressionTreeIteratorImpl::tree_
protectedinherited

The tree we are iterating over.

Definition at line 83 of file IteratorImpl.h.


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