Dune Core Modules (2.5.0)

yaspgridentitypointer.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_YASPGRIDENTITYPOINTER_HH
4#define DUNE_GRID_YASPGRIDENTITYPOINTER_HH
5
10namespace Dune {
11
14 template<int codim, class GridImp>
16 {
18 enum { dim=GridImp::dimension };
20 typedef typename GridImp::ctype ctype;
21
22 public:
23 typedef typename GridImp::template Codim<codim>::Entity Entity;
24 typedef typename GridImp::YGridLevelIterator YGLI;
25 typedef typename GridImp::YGrid::Iterator I;
27 protected:
28 typedef YaspEntity<codim, dim, GridImp> YaspEntityImp;
29
30 public:
32 enum { codimension = codim };
33
36 _entity(YaspEntityImp())
37 {}
38
40 YaspEntityPointer (const YGLI & g, const I& it)
41 : _entity(YaspEntityImp(g,it))
42 {}
43
44 YaspEntityPointer (YGLI&& g, I&& it)
45 : _entity(YaspEntityImp(std::move(g),std::move(it)))
46 {}
47
49 YaspEntityPointer (const YaspEntityImp& entity)
50 : _entity(entity)
51 {}
52
53 YaspEntityPointer (YaspEntityImp&& entity)
54 : _entity(std::move(entity))
55 {}
56
58
60 bool equals (const YaspEntityPointer& rhs) const
61 {
62 return (_entity == rhs._entity);
63 }
64
66 const Entity& dereference() const
67 {
68 return _entity;
69 }
70
72 int level () const {return _entity.level();}
73
75
76 protected:
77 Entity _entity;
78 };
79
80} // namespace Dune
81
82#endif // DUNE_GRID_YASPGRIDENTITYPOINTER_HH
A pointer to a YaspGrid::Entity.
Definition: yaspgridentitypointer.hh:16
YaspEntityPointer()
default constructor
Definition: yaspgridentitypointer.hh:35
int level() const
ask for level of entity
Definition: yaspgridentitypointer.hh:72
YaspEntityPointer(const YaspEntityImp &entity)
copying and moving
Definition: yaspgridentitypointer.hh:49
Entity _entity
use default assignment operator
Definition: yaspgridentitypointer.hh:77
const Entity & dereference() const
dereferencing
Definition: yaspgridentitypointer.hh:66
bool equals(const YaspEntityPointer &rhs) const
copying and moving – use default implementations
Definition: yaspgridentitypointer.hh:60
YaspEntityPointer(const YGLI &g, const I &it)
constructor
Definition: yaspgridentitypointer.hh:40
Dune namespace.
Definition: alignment.hh:11
STL namespace.
Static tag representing a codimension.
Definition: dimension.hh:22
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)