MADARA  3.2.3
Iterator.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 #ifndef _MADARA_TREE_ITERATOR_H_
3 #define _MADARA_TREE_ITERATOR_H_
4 
5 #include <string>
6 
9 
10 namespace madara
11 {
12  namespace expression
13  {
14 
15  // Forward declarations.
16  class ExpressionTreeCommandFactory;
17  class ComponentNode;
18 
27  {
28  public:
31 
34 
37  // @@ ExpressionTree operator* (void);
39 
41  // @@ ExpressionTree operator* (void);
42  const ExpressionTree operator* (void) const;
43 
46 
49 
51  bool operator== (const ExpressionTreeIterator &rhs);
52 
54  bool operator!= (const ExpressionTreeIterator &rhs);
55 
56  // = Necessary traits
57  typedef std::forward_iterator_tag iterator_category;
58  typedef long value_type;
59  typedef int *pointer;
60  typedef int &reference;
61  typedef int difference_type;
62 
63  private:
65  };
66 
77  {
78  public:
81 
84 
86  const ExpressionTree operator* (void) const;
87 
90 
93 
96 
99 
100  // = Necessary traits
101  typedef std::forward_iterator_tag iterator_category;
102  typedef long value_type;
103  typedef int *pointer;
104  typedef int &reference;
105  typedef int difference_type;
106 
107  private:
111  };
112 }
113 }
114 #endif /* _MADARA_TREE_ITERATOR_H_ */
std::forward_iterator_tag iterator_category
Definition: Iterator.h:57
Encapsulates a MADARA KaRL expression into an evaluatable tree.
bool operator!=(const ExpressionTreeIterator &rhs)
In-equality operator.
Definition: Iterator.cpp:84
Constant iterator over an expression tree.
Definition: Iterator.h:76
Non-const iterator for traversing an expression tree.
Definition: Iterator.h:26
ExpressionTreeIterator & operator++(void)
Preincrement operator.
Definition: Iterator.cpp:53
bool operator==(const ExpressionTreeIterator &rhs)
Equality operator.
Definition: Iterator.cpp:74
ExpressionTree operator*(void)
Dereference operator returns a reference to the item contained at the current position.
Definition: Iterator.cpp:35
ExpressionTreeIterator(const ExpressionTreeIterator &ts)
Copy ctor - needed for reference counting.
Definition: Iterator.cpp:16
madara::utility::Refcounter< ExpressionTreeIteratorImpl > impl_
Definition: Iterator.h:64
madara::utility::Refcounter< ExpressionTreeIteratorImpl > impl_
Pointer to actual implementation, i.e., the "bridge", which is reference counted to automate memory m...
Definition: Iterator.h:110
Copyright (c) 2015 Carnegie Mellon University.
Implementation of the ExpressionTreeIterator pattern that is used to define the various iterations al...
Definition: IteratorImpl.h:41
std::forward_iterator_tag iterator_category
Definition: Iterator.h:101
This template class provides transparent reference counting of its template parameter T...
Definition: IteratorImpl.h:17