PolyBoRi
CCuddFirstIter.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
54 //*****************************************************************************
55 
56 // include basic definitions
57 #include "CCuddNavigator.h"
58 
59 // include boost's interator facade
60 #include <boost/iterator/iterator_facade.hpp>
61 
62 #ifndef CCuddFirstIter_h_
63 #define CCuddFirstIter_h_
64 
66 
74  public boost::iterator_facade<
75  CCuddFirstIter,
76  CCuddNavigator::value_type,
77  std::forward_iterator_tag,
78  CCuddNavigator::reference
79  > {
80 
81 public:
82 
84  typedef std::forward_iterator_tag iterator_category;
85 
87  typedef CCuddFirstIter self;
88 
91 
94 
97 
99  CCuddFirstIter(): m_navi() {}
100 
102  CCuddFirstIter(navigator rhs): m_navi(rhs) { terminateConstant(); }
103 
106 
108  void increment() {
109  m_navi.incrementThen();
110  terminateConstant();
111  }
112 
114  bool_type equal (const self& rhs) const { return (m_navi == rhs.m_navi); }
115 
117  navigator::reference dereference() const { return *m_navi; }
118 
120  bool_type isEnd() const { return !m_navi.isValid(); }
121 
122 protected:
125  if (m_navi.isConstant())
126  *this = self(); // mark end of path reached
127 
128  }
129 
132 };
133 
135 
136 #endif