dune-grid  2.3beta2
common/intersectioniterator.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_GRID_INTERSECTIONITERATOR_HH
4 #define DUNE_GRID_INTERSECTIONITERATOR_HH
5 
6 #include <dune/common/iteratorfacades.hh>
7 
9 
10 namespace Dune
11 {
12 
81  template< class GridImp, class IntersectionIteratorImp, class IntersectionImp >
83  {
84 #if DUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS
85  public:
86 #else
87  protected:
88  // give the GridDefaultImplementation class access to the realImp
89  friend class GridDefaultImplementation<
90  GridImp::dimension, GridImp::dimensionworld,
91  typename GridImp::ctype,
92  typename GridImp::GridFamily> ;
93 #endif
94  // type of underlying implementation, for internal use only
95  typedef IntersectionIteratorImp Implementation;
96 
100  const Implementation &impl () const { return realIterator; }
101 
102  protected:
104 
105  public:
108 
109  //===========================================================
113  //===========================================================
114 
116  const Intersection & operator*() const
117  {
118  return this->realIterator.dereference();
119  }
120 
122  const Intersection * operator->() const
123  {
124  return & this->realIterator.dereference();
125  }
127 
128 
129  //===========================================================
133  //===========================================================
134 
140  bool operator==(const IntersectionIterator& rhs) const
141  {
142  return rhs.equals(*this);
143  }
144 
150  bool operator!=(const IntersectionIterator& rhs) const
151  {
152  return ! rhs.equals(*this);
153  }
155 
158  {
159  this->realIterator.increment();
160  return *this;
161  }
162 
163  //===========================================================
167  //===========================================================
168 
170  bool equals(const IntersectionIterator& rhs) const
171  {
172  return this->realIterator.equals(rhs.realIterator);
173  }
174 
177  : realIterator( impl )
178  {}
179 
184  };
185 
186 } // namespace Dune
187 
188 #include "intersection.hh"
189 
190 #endif // DUNE_GRID_INTERSECTIONITERATOR_HH