MADARA  3.4.1
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 // Forward declarations.
15 class ExpressionTreeCommandFactory;
16 class ComponentNode;
17 
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 
95  bool operator==(const ExpressionTreeConstIterator& rhs);
96 
98  bool operator!=(const ExpressionTreeConstIterator& rhs);
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_ */
Constant iterator over an expression tree.
Definition: Iterator.h:77
bool operator==(const ExpressionTreeConstIterator &rhs)
Equality operator.
Definition: Iterator.cpp:132
bool operator!=(const ExpressionTreeConstIterator &rhs)
Nonequality operator.
Definition: Iterator.cpp:140
ExpressionTreeConstIterator & operator++(void)
Preincrement operator.
Definition: Iterator.cpp:114
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
std::forward_iterator_tag iterator_category
Definition: Iterator.h:101
const ExpressionTree operator*(void) const
Returns a const reference to the item contained at the current position.
Definition: Iterator.cpp:106
ExpressionTreeConstIterator(const ExpressionTreeConstIterator &ts)
Copy ctor - needed for reference counting.
Definition: Iterator.cpp:89
Implementation of the ExpressionTreeIterator pattern that is used to define the various iterations al...
Definition: IteratorImpl.h:42
Non-const iterator for traversing an expression tree.
Definition: Iterator.h:27
bool operator==(const ExpressionTreeIterator &rhs)
Equality operator.
Definition: Iterator.cpp:72
madara::utility::Refcounter< ExpressionTreeIteratorImpl > impl_
Definition: Iterator.h:64
ExpressionTreeIterator & operator++(void)
Preincrement operator.
Definition: Iterator.cpp:52
std::forward_iterator_tag iterator_category
Definition: Iterator.h:57
bool operator!=(const ExpressionTreeIterator &rhs)
In-equality operator.
Definition: Iterator.cpp:81
ExpressionTree operator*(void)
Dereference operator returns a reference to the item contained at the current position.
Definition: Iterator.cpp:34
ExpressionTreeIterator(const ExpressionTreeIterator &ts)
Copy ctor - needed for reference counting.
Definition: Iterator.cpp:16
Encapsulates a MADARA KaRL expression into an evaluatable tree.
This template class provides transparent reference counting of its template parameter T.
Definition: Refcounter.h:22
Copyright(c) 2020 Galois.