dune-grid  2.3beta2
entityiterator.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_ENTITYITERATOR_HH
4 #define DUNE_GRID_ENTITYITERATOR_HH
5 
6 #include <cstddef>
7 #include <iterator>
8 
10 
11 namespace Dune
12 {
13 
34  template< int codim, class Grid, class IteratorImp >
36  : public EntityPointer< Grid, IteratorImp >
37  {
39 
40  protected:
41  using Base::realIterator;
42 
43  public:
44  typedef typename Grid::template Codim< codim >::Entity Entity;
45 
48  {
49  realIterator.increment();
50  return *this;
51  }
52 
58  EntityIterator ( const IteratorImp &imp )
59  : Base( imp )
60  {}
61 
63  };
64 
65 } // namespace Dune
66 
67 namespace std
68 {
69 
70  template< int codim, class Grid, class IteratorImp >
71  struct iterator_traits< Dune::EntityIterator< codim, Grid, IteratorImp > >
72  {
73  typedef ptrdiff_t difference_type;
75  typedef value_type *pointer;
77  typedef forward_iterator_tag iterator_category;
78  };
79 
80 } // namespace std
81 
82 #endif // #ifndef DUNE_GRID_ENTITYITERATOR_HH