dune-fem 2.12-git
Loading...
Searching...
No Matches
idgridpart/iterator.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_GRIDPART_IDGRIDPART_ITERATOR_HH
2#define DUNE_FEM_GRIDPART_IDGRIDPART_ITERATOR_HH
3
4#include <type_traits>
5#include <utility>
6
9
10namespace Dune
11{
12
13 namespace Fem
14 {
15
16 // IdIterator
17 // ----------
18
19 template< int codim, PartitionIteratorType pitype, class GridFamily >
21 {
23
24 typedef typename Traits::HostGridPartType HostGridPartType;
25
26 public:
27 typedef typename Traits::ExtraData ExtraData;
28 typedef typename HostGridPartType::template Codim< codim >::template Partition< pitype >::IteratorType HostIteratorType;
29
30 typedef typename Traits::template Codim< codim >::Entity Entity;
31
32 IdIterator () = default;
33
34 IdIterator ( ExtraData data, HostIteratorType hostIterator )
35 : data_( std::move( data ) ),
36 hostIterator_( std::move( hostIterator ) )
37 {}
38
39 void increment ()
40 {
41 ++hostIterator_;
42 }
43
45 {
46 return typename Entity::Implementation( data_, *hostIterator_ );
47 }
48
49 bool equals ( const IdIterator &rhs ) const
50 {
51 return hostIterator_ == rhs.hostIterator_;
52 }
53
54 int level () const
55 {
56 return hostIterator_.level();
57 }
58
59 private:
60 ExtraData data_;
61 HostIteratorType hostIterator_;
62 };
63
64 } // namespace Fem
65
66} // namespace Dune
67
68#endif // #ifndef DUNE_FEM_GRIDPART_IDGRIDPART_ITERATOR_HH
Y & rhs()
STL namespace.
Definition idgridpart/iterator.hh:21
HostGridPartType::template Codim< codim >::template Partition< pitype >::IteratorType HostIteratorType
Definition idgridpart/iterator.hh:28
bool equals(const IdIterator &rhs) const
Definition idgridpart/iterator.hh:49
void increment()
Definition idgridpart/iterator.hh:39
Entity dereference() const
Definition idgridpart/iterator.hh:44
Traits::template Codim< codim >::Entity Entity
Definition idgridpart/iterator.hh:30
Traits::ExtraData ExtraData
Definition idgridpart/iterator.hh:27
int level() const
Definition idgridpart/iterator.hh:54
IdIterator(ExtraData data, HostIteratorType hostIterator)
Definition idgridpart/iterator.hh:34