Class documentation of Concepts

Loading...
Searching...
No Matches
meshInfo.hh
Go to the documentation of this file.
1
6#ifndef dgMeshInfo_hh
7#define dgMeshInfo_hh
8
9#include "edgeInfo.hh"
10
11// forward declaration
12namespace concepts {
13 class Mesh2;
14}
15
16namespace linDG2D {
17
25 class MeshInfo {
26 public:
33 Scanner* scan() const { return new S(edgeInfos_); }
35 const EdgeInfo& edgeInfo(const concepts::Edge& edge) const {
36 return edgeInfos_.find(edge.key())->second;
37 }
38 private:
40 class S : public Scanner {
41 public:
42 inline S(const std::unordered_map<uint, EdgeInfo>& edgeInfos) :
43 idx_(edgeInfos.begin()), edgeInfos_(edgeInfos) {}
44 inline S(const S& scan) : idx_(scan.idx_), edgeInfos_(scan.edgeInfos_) {}
45 inline bool eos() const { return idx_ == edgeInfos_.end(); }
46 inline EdgeInfo& operator++(int) {
47 return const_cast<EdgeInfo&>((*idx_++).second);
48 }
49 inline S* clone() const { return new S(*this); }
50 private:
51 std::unordered_map<uint, EdgeInfo>::const_iterator idx_;
52 const std::unordered_map<uint, EdgeInfo>& edgeInfos_;
53 };
55 std::unordered_map<uint, EdgeInfo> edgeInfos_;
56 };
57
58} // namespace linDG2D
59
60#endif // dgMeshInfo_hh
const Key & key() const
Returns the key of the connector.
Definition connector.hh:105
const EdgeInfo & edgeInfo(const concepts::Edge &edge) const
Returns the edge info object built up for edge edge.
Definition meshInfo.hh:35
Scanner * scan() const
scanner over EdgeInfo objects
Definition meshInfo.hh:33
MeshInfo(concepts::Mesh2 &mesh)