MADARA  3.4.1
madara::expression::ExpressionTreeIteratorFactory Class Reference

Implementation of a factory pattern that dynamically allocates the appropriate ExpressionTreeIteratorImpl object. More...

Public Member Functions

 ExpressionTreeIteratorFactory (void)
 Constructor. More...
 
ExpressionTreeIteratorImplmake_tree_iterator (ExpressionTree &tree, const std::string &traversal_order, bool end_iter)
 Dynamically allocate a new ExpressionTreeIteratorImpl object based on the designated traversal_order and end_iter. More...
 

Private Types

typedef ::std::map< std::string, TRAVERSAL_PTMFTRAVERSAL_MAP
 
typedef ExpressionTreeIteratorImpl *(ExpressionTreeIteratorFactory::* TRAVERSAL_PTMF) (ExpressionTree &tree, bool end_iter)
 

Private Member Functions

ExpressionTreeIteratorImplmake_in_order_tree_iterator (ExpressionTree &tree, bool end_iter)
 Dynamically allocate a new ExpressionTreeLevelOrderIteratorImpl object based on the designated end_iter. More...
 
ExpressionTreeIteratorImplmake_level_order_tree_iterator (ExpressionTree &tree, bool end_iter)
 Dynamically allocate a new ExpressionTreeLevelOrderIteratorImpl object based on the designated end_iter. More...
 
ExpressionTreeIteratorImplmake_post_order_tree_iterator (ExpressionTree &tree, bool end_iter)
 Dynamically allocate a new ExpressionTreePostOrderIteratorImpl object based on the designated end_iter. More...
 
ExpressionTreeIteratorImplmake_pre_order_tree_iterator (ExpressionTree &tree, bool end_iter)
 Dynamically allocate a new ExpressionTreePreOrderIteratorImpl object based on the designated end_iter. More...
 

Private Attributes

TRAVERSAL_MAP traversal_map_
 

Detailed Description

Implementation of a factory pattern that dynamically allocates the appropriate ExpressionTreeIteratorImpl object.

This is a variant of the Abstract Factory pattern that has a set of related factory methods but which doesn't use inheritance.

See also
ExpressionTreeLevelOrderIteratorImpl, ExpressionTreeInOrderIteratorImpl, ExpressionTreePreOrderIteratorImpl, and ExpressionTreePostOrderIteratorImpl.

Definition at line 48 of file ExpressionTree.cpp.

Member Typedef Documentation

◆ TRAVERSAL_MAP

Definition at line 83 of file ExpressionTree.cpp.

◆ TRAVERSAL_PTMF

typedef ExpressionTreeIteratorImpl*( ExpressionTreeIteratorFactory::* madara::expression::ExpressionTreeIteratorFactory::TRAVERSAL_PTMF) (ExpressionTree &tree, bool end_iter)
private

Definition at line 80 of file ExpressionTree.cpp.

Constructor & Destructor Documentation

◆ ExpressionTreeIteratorFactory()

madara::expression::ExpressionTreeIteratorFactory::ExpressionTreeIteratorFactory ( void  )

Constructor.

Definition at line 90 of file ExpressionTree.cpp.

Member Function Documentation

◆ make_in_order_tree_iterator()

madara::expression::ExpressionTreeIteratorImpl * madara::expression::ExpressionTreeIteratorFactory::make_in_order_tree_iterator ( ExpressionTree tree,
bool  end_iter 
)
private

Dynamically allocate a new ExpressionTreeLevelOrderIteratorImpl object based on the designated end_iter.

Definition at line 111 of file ExpressionTree.cpp.

◆ make_level_order_tree_iterator()

madara::expression::ExpressionTreeIteratorImpl * madara::expression::ExpressionTreeIteratorFactory::make_level_order_tree_iterator ( ExpressionTree tree,
bool  end_iter 
)
private

Dynamically allocate a new ExpressionTreeLevelOrderIteratorImpl object based on the designated end_iter.

Definition at line 103 of file ExpressionTree.cpp.

◆ make_post_order_tree_iterator()

madara::expression::ExpressionTreeIteratorImpl * madara::expression::ExpressionTreeIteratorFactory::make_post_order_tree_iterator ( ExpressionTree tree,
bool  end_iter 
)
private

Dynamically allocate a new ExpressionTreePostOrderIteratorImpl object based on the designated end_iter.

Definition at line 124 of file ExpressionTree.cpp.

◆ make_pre_order_tree_iterator()

madara::expression::ExpressionTreeIteratorImpl * madara::expression::ExpressionTreeIteratorFactory::make_pre_order_tree_iterator ( ExpressionTree tree,
bool  end_iter 
)
private

Dynamically allocate a new ExpressionTreePreOrderIteratorImpl object based on the designated end_iter.

Definition at line 118 of file ExpressionTree.cpp.

◆ make_tree_iterator()

madara::expression::ExpressionTreeIteratorImpl * madara::expression::ExpressionTreeIteratorFactory::make_tree_iterator ( ExpressionTree tree,
const std::string &  traversal_order,
bool  end_iter 
)

Dynamically allocate a new ExpressionTreeIteratorImpl object based on the designated traversal_order and end_iter.

Definition at line 132 of file ExpressionTree.cpp.

Member Data Documentation

◆ traversal_map_

TRAVERSAL_MAP madara::expression::ExpressionTreeIteratorFactory::traversal_map_
private

Definition at line 85 of file ExpressionTree.cpp.


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