dune-grid  2.3.1
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
EntityIterator & operator++()
prefix increment operator
Definition: entityiterator.hh:47
Grid::template Codim< codim >::Entity Entity
Definition: entityiterator.hh:44
Wrapper class for pointers to entities.
Definition: common/entitypointer.hh:91
interface class for an iterator over grid entitiesAn entity iterator is an iterator over a subset of ...
Definition: entityiterator.hh:35
Implementation realIterator
Definition: common/entitypointer.hh:116
EntityIterator(const IteratorImp &imp)
copy constructor from implementaton
Definition: entityiterator.hh:58
Wrapper and interface classe for a static iterator (EntityPointer)
forward_iterator_tag iterator_category
Definition: entityiterator.hh:77
const Dune::EntityIterator< codim, Grid, IteratorImp >::Entity value_type
Definition: entityiterator.hh:74