Dune Core Modules (2.9.0)

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
11namespace Dune
12{
13
14 // SuperEntityIterator
15 // -------------------
16
17 template< class Grid, template< class > class SuperEntityIteratorImp >
18 class SuperEntityIterator
19 : public EntityIterator< 0, Grid, SuperEntityIteratorImp< Grid > >
20 {
21 typedef SuperEntityIterator< Grid, SuperEntityIteratorImp > This;
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 >
45 inline SuperEntityIterator< Grid, SuperEntityIteratorImp >
46 ::SuperEntityIterator ( const Implementation &implementation )
47 : Base( implementation )
48 {}
49
50
51 template< class Grid, template< class > class SuperEntityIteratorImp >
52 inline const typename SuperEntityIterator< Grid, SuperEntityIteratorImp >::This &
53 SuperEntityIterator< Grid, SuperEntityIteratorImp >::operator++ ()
54 {
55 ++static_cast< Base & >( *this );
56 return *this;
57 }
58
59
60 template< class Grid, template< class > class SuperEntityIteratorImp >
61 inline int SuperEntityIterator< Grid, SuperEntityIteratorImp >::index () const
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 {
90 static const bool v = SuperEntityIterator< Grid, codim >::v;
91 };
92
93 }
94
95}
96
97#endif // #ifndef DUNE_GRID_EXTENSIONS_SUPERENTITYITERATOR_HH
Grid abstract base class.
Definition: grid.hh:375
Dune namespace.
Definition: alignedallocator.hh:13
Does a grid support superentity iterators of a codimension?
Definition: superentityiterator.hh:82
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)