dune-spgrid  2.7
extensions/superentityiterator.hh
Go to the documentation of this file.
1 #ifndef DUNE_GRID_SUPERENTITYITERATOR_HH
2 #define DUNE_GRID_SUPERENTITYITERATOR_HH
3 
4 #include <dune/grid/common/entityiterator.hh>
5 
11 namespace Dune
12 {
13 
14  // SuperEntityIterator
15  // -------------------
16 
17  template< class Grid, template< class > class SuperEntityIteratorImp >
19  : public EntityIterator< 0, Grid, SuperEntityIteratorImp< Grid > >
20  {
22  typedef EntityIterator< 0, Grid, SuperEntityIteratorImp< Grid > > Base;
23 
24  typedef SuperEntityIteratorImp< Grid > Implementation;
25 
26  public:
27  typedef typename Grid::template Codim< 0 >::Entity Entity;
28 
29  SuperEntityIterator ( const Implementation &implementation );
30 
31  const This &operator++ ();
32 
33  int index () const;
34 
35  protected:
36  using Base::realIterator;
37  };
38 
39 
40 
41  // Implementation of SuperEntityIterator
42  // -------------------------------------
43 
44  template< class Grid, template< class > class SuperEntityIteratorImp >
46  ::SuperEntityIterator ( const Implementation &implementation )
47  : Base( implementation )
48  {}
49 
50 
51  template< class Grid, template< class > class SuperEntityIteratorImp >
54  {
55  ++static_cast< Base & >( *this );
56  return *this;
57  }
58 
59 
60  template< class Grid, template< class > class SuperEntityIteratorImp >
62  {
63  return realIterator.index();
64  }
65 
66 
67 
68  // Extensions
69  // ----------
70 
72  namespace Extensions
73  {
74 
80  template< class Grid, int codim >
82  {
84  static const bool v = false;
85  };
86 
87  template< class Grid, int codim >
88  struct SuperEntityIterator< const Grid, codim >
89  {
91  };
92 
93  }
94 
95 }
96 
97 #endif // #ifndef DUNE_GRID_EXTENSIONS_SUPERENTITYITERATOR_HH
Definition: iostream.hh:7
Definition: extensions/superentityiterator.hh:20
Grid::template Codim< 0 >::Entity Entity
Definition: extensions/superentityiterator.hh:27
int index() const
Definition: extensions/superentityiterator.hh:61
SuperEntityIterator(const Implementation &implementation)
Definition: extensions/superentityiterator.hh:46
const This & operator++()
Definition: extensions/superentityiterator.hh:53
Does a grid support superentity iterators of a codimension?
Definition: extensions/superentityiterator.hh:82
static const bool v
by default, a grid does not support superentity iterators
Definition: extensions/superentityiterator.hh:84