dune-fem  2.8-git
idgridpart/intersectioniterator.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_GRIDPART_IDGRIDPART_INTERSECTIONITERATOR_HH
2 #define DUNE_FEM_GRIDPART_IDGRIDPART_INTERSECTIONITERATOR_HH
3 
4 #include <type_traits>
5 #include <utility>
6 
7 #include <dune/grid/common/intersectioniterator.hh>
8 
10 
11 namespace Dune
12 {
13 
14  namespace Fem
15  {
16 
17  // IdIntersectionIterator
18  // ----------------------
19 
20  template< class GridFamily >
22  {
24 
25  typedef typename std::remove_const< GridFamily >::type::Traits Traits;
26 
27  typedef typename Traits::HostGridPartType::IntersectionIteratorType HostIntersectionIteratorType;
28 
30 
31  public:
32  typedef Dune::Intersection< const GridFamily, IntersectionImplType > Intersection;
33  typedef typename Traits::ExtraData ExtraData;
34 
35  IdIntersectionIterator () = default;
36 
37  IdIntersectionIterator ( ExtraData data, HostIntersectionIteratorType hostIterator )
38  : data_( std::move( data ) ),
39  hostIterator_( std::move( hostIterator ) )
40  {}
41 
42  bool equals ( const ThisType &other ) const
43  {
44  return hostIterator_ == other.hostIterator_;
45  }
46 
47  void increment ()
48  {
49  ++hostIterator_;
50  }
51 
53  {
55  }
56 
57  const ExtraData &data () const { return data_; }
58 
59  protected:
61  HostIntersectionIteratorType hostIterator_;
62  };
63 
64  } // namespace Fem
65 
66 } // namespace Dune
67 
68 #endif // #ifndef DUNE_FEM_GRIDPART_IDGRIDPART_INTERSECTIONITERATOR_HH
Definition: bindguard.hh:11
Definition: idgridpart/intersection.hh:20
Definition: idgridpart/intersectioniterator.hh:22
void increment()
Definition: idgridpart/intersectioniterator.hh:47
Dune::Intersection< const GridFamily, IntersectionImplType > Intersection
Definition: idgridpart/intersectioniterator.hh:32
HostIntersectionIteratorType hostIterator_
Definition: idgridpart/intersectioniterator.hh:61
Intersection dereference() const
Definition: idgridpart/intersectioniterator.hh:52
const ExtraData & data() const
Definition: idgridpart/intersectioniterator.hh:57
bool equals(const ThisType &other) const
Definition: idgridpart/intersectioniterator.hh:42
Traits::ExtraData ExtraData
Definition: idgridpart/intersectioniterator.hh:33
IdIntersectionIterator(ExtraData data, HostIntersectionIteratorType hostIterator)
Definition: idgridpart/intersectioniterator.hh:37
ExtraData data_
Definition: idgridpart/intersectioniterator.hh:60