dune-grid 2.9.0
common/entityseed.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4// vi: set et ts=4 sw=2 sts=2:
5#ifndef DUNE_GRID_COMMON_ENTITY_SEED_HH
6#define DUNE_GRID_COMMON_ENTITY_SEED_HH
7
9
14namespace Dune {
15
24 template<class GridImp, class EntitySeedImp>
26 {
27 public:
28
30 constexpr static int codimension = EntitySeedImp::codimension;
31
37 typedef EntitySeedImp Implementation;
38
41 {}
42
44 EntitySeed(const EntitySeedImp& implementation)
45 : implementation_(implementation)
46 {}
47
49 bool isValid() const
50 {
51 return implementation_.isValid();
52 }
53
59 Implementation& impl() { return implementation_; }
60
66 const Implementation& impl() const { return implementation_; }
67
68 private:
70 EntitySeedImp implementation_;
71 };
72
73} // end namespace Dune
74
75#endif
Include standard header files.
Definition: agrid.hh:60
Store a reference to an entity with a minimal memory footprint.
Definition: common/entityseed.hh:26
Implementation & impl()
access to the underlying implementation
Definition: common/entityseed.hh:59
EntitySeedImp Implementation
type of underlying implementation
Definition: common/entityseed.hh:37
EntitySeed(const EntitySeedImp &implementation)
Construct from implementation class.
Definition: common/entityseed.hh:44
static constexpr int codimension
codimension of underlying entity
Definition: common/entityseed.hh:30
EntitySeed()
Construct an empty (i.e. isValid() == false) seed.
Definition: common/entityseed.hh:40
const Implementation & impl() const
access to the underlying implementation
Definition: common/entityseed.hh:66
bool isValid() const
check whether it is safe to create an Entity from this Seed
Definition: common/entityseed.hh:49
Different resources needed by all grid implementations.