2 #ifndef _MADARA_TREE_ITERATOR_IMPL_H_
3 #define _MADARA_TREE_ITERATOR_IMPL_H_
23 class ExpressionTreeIterator;
Implementation of the ExpressionTreeIterator pattern that is used to define the various iterations al...
virtual ExpressionTreeIteratorImpl * clone(void)=0
Method for cloning an impl. Necessary for post increments.
virtual ~ExpressionTreeIteratorImpl(void)
Dtor.
virtual const ExpressionTree operator*(void) const =0
Returns a const reference to the item contained at the current position.
ExpressionTreeIteratorImpl(const ExpressionTree &tree)
Construct an ExpressionTreeIteratorImpl to iterate over a tree.
virtual void operator++(void)=0
Increment operator (used for both pre- and post-increment).
madara::knowledge::KnowledgeRecord value_type
virtual bool operator==(const ExpressionTreeIteratorImpl &rhs) const =0
Equality operator.
virtual bool operator!=(const ExpressionTreeIteratorImpl &rhs) const =0
Nonequality operator.
const ExpressionTree & tree_
The tree we are iterating over.
virtual ExpressionTree operator*(void)=0
Dereference operator returns a reference to the item contained at the current position.
::std::forward_iterator_tag iterator_category
= Necessary traits
Non-const iterator for traversing an expression tree.
Encapsulates a MADARA KaRL expression into an evaluatable tree.
Iterates through an ExpressionTree in in-order.
virtual bool operator==(const ExpressionTreeIteratorImpl &rhs) const
Equality operator.
InOrderIteratorImpl(const ExpressionTree &tree, bool end_iter=false)
Construct an InOrderIteratorImpl.
virtual bool operator!=(const ExpressionTreeIteratorImpl &lhs) const
Nonequality operator.
madara::utility::LStack< ExpressionTree > stack_
Our current position in the iteration.
virtual void operator++(void)
Increment operator (used for both pre- and post-increment).
virtual ExpressionTree operator*(void)
Dereference operator returns a reference to the item contained at the current position.
virtual ~InOrderIteratorImpl(void)
Dtor.
::std::forward_iterator_tag iterator_category
virtual ExpressionTreeIteratorImpl * clone(void)
Method for cloning an impl. Necessary for post increments.
madara::knowledge::KnowledgeRecord value_type
Iterates through an ExpressionTree in level-order.
virtual bool operator!=(const ExpressionTreeIteratorImpl &lhs) const
Nonequality operator.
virtual bool operator==(const ExpressionTreeIteratorImpl &rhs) const
Equality operator.
virtual ExpressionTree operator*(void)
Dereference operator returns a reference to the item contained at the current position.
virtual ExpressionTreeIteratorImpl * clone(void)
Method for cloning an impl. Necessary for post increments.
::std::forward_iterator_tag iterator_category
madara::utility::LQueue< ExpressionTree > queue_
Our current position in the iteration.
virtual void operator++(void)
Increment operator (used for both pre- and post-increment).
madara::knowledge::KnowledgeRecord value_type
LevelOrderExpressionTreeIteratorImpl(const ExpressionTree &tree, bool end_iter=false)
Construct an LevelOrderExpressionTreeIterator.
virtual ~LevelOrderExpressionTreeIteratorImpl()
Dtor.
Iterates through an ExpressionTree in post-order.
virtual ~PostOrderIteratorImpl(void)
Dtor.
PostOrderIteratorImpl(const ExpressionTree &tree, bool end_iter=false)
Construct an PostOrderIteratorImpl.
madara::knowledge::KnowledgeRecord value_type
virtual void operator++(void)
Increment operator (used for both pre- and post-increment).
virtual bool operator!=(const ExpressionTreeIteratorImpl &lhs) const
Nonequality operator.
madara::utility::LStack< ExpressionTree > stack_
Our current position in the iteration.
virtual ExpressionTreeIteratorImpl * clone(void)
Method for cloning an impl. Necessary for post increments.
virtual bool operator==(const ExpressionTreeIteratorImpl &rhs) const
Equality operator.
virtual ExpressionTree operator*(void)
Dereference operator returns a reference to the item contained at the current position.
::std::forward_iterator_tag iterator_category
Iterates through an ExpressionTree in level-order.
virtual bool operator!=(const ExpressionTreeIteratorImpl &lhs) const
Nonequality operator.
madara::utility::LStack< ExpressionTree > stack_
Our current position in the iteration.
madara::knowledge::KnowledgeRecord value_type
virtual ~PreOrderIteratorImpl()
Dtor.
virtual ExpressionTree operator*(void)
Dereference operator returns a reference to the item contained at the current position.
::std::forward_iterator_tag iterator_category
virtual ExpressionTreeIteratorImpl * clone(void)
Method for cloning an impl. Necessary for post increments.
virtual bool operator==(const ExpressionTreeIteratorImpl &rhs) const
Equality operator.
virtual void operator++(void)
Increment operator (used for both pre- and post-increment).
PreOrderIteratorImpl(const ExpressionTree &tree, bool end_iter=false)
Construct an LevelOrderExpressionTreeIterator.
This class encapsulates an entry in a KnowledgeBase.
Defines a generic "first-in/first-out" (FIFO) Abstract Data Type (ADT) using a circular linked list.
Defines a generic "last-in/first-out" (LIFO) Abstract Data Type (ADT) using a stack that's implemente...
This template class provides transparent reference counting of its template parameter T.
Provides utility functions and classes for common tasks and needs.
Copyright(c) 2020 Galois.