MADARA  3.1.8
madara::expression::ExpressionTreeIteratorImpl Class Referenceabstract

Implementation of the ExpressionTreeIterator pattern that is used to define the various iterations algorithms that can be performed to traverse the expression tree. More...

#include <IteratorImpl.h>

Inheritance diagram for madara::expression::ExpressionTreeIteratorImpl:
Collaboration diagram for madara::expression::ExpressionTreeIteratorImpl:

Public Types

typedef int difference_type
 
typedef ::std::forward_iterator_tag iterator_category
 = Necessary traits More...
 
typedef int * pointer
 
typedef int & reference
 
typedef madara::knowledge::KnowledgeRecord value_type
 

Public Member Functions

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

Protected Attributes

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

Friends

class ExpressionTreeIterator
 

Detailed Description

Implementation of the ExpressionTreeIterator pattern that is used to define the various iterations algorithms that can be performed to traverse the expression tree.

Plays the role of the "implementor" base class in the Bridge pattern that is used as the basis for the subclasses that actually define the various iteration algorithms.

See also
ExpressionTreeLevelOrderIteratorImpl, ExpressionTreeInOrderIteratorImpl, ExpressionTreePreOrderIteratorImpl, ExpressionTreePostOrderIteratorImpl

Definition at line 41 of file IteratorImpl.h.

Member Typedef Documentation

= Necessary traits

Definition at line 75 of file IteratorImpl.h.

Constructor & Destructor Documentation

madara::expression::ExpressionTreeIteratorImpl::ExpressionTreeIteratorImpl ( const ExpressionTree tree)

Construct an ExpressionTreeIteratorImpl to iterate over a tree.

Definition at line 17 of file IteratorImpl.cpp.

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

Dtor.

Definition at line 25 of file IteratorImpl.cpp.

Member Function Documentation

virtual ExpressionTreeIteratorImpl* madara::expression::ExpressionTreeIteratorImpl::clone ( void  )
pure virtual
virtual bool madara::expression::ExpressionTreeIteratorImpl::operator!= ( const ExpressionTreeIteratorImpl rhs) const
pure virtual
virtual ExpressionTree madara::expression::ExpressionTreeIteratorImpl::operator* ( void  )
pure virtual
virtual const ExpressionTree madara::expression::ExpressionTreeIteratorImpl::operator* ( void  ) const
pure virtual
virtual void madara::expression::ExpressionTreeIteratorImpl::operator++ ( void  )
pure virtual
virtual bool madara::expression::ExpressionTreeIteratorImpl::operator== ( const ExpressionTreeIteratorImpl rhs) const
pure virtual

Friends And Related Function Documentation

friend class ExpressionTreeIterator
friend

Definition at line 43 of file IteratorImpl.h.

Member Data Documentation

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

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: