Dune Core Modules (unstable)

entityseed.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright © 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
Store a reference to an entity with a minimal memory footprint.
Definition: entityseed.hh:26
Implementation & impl()
access to the underlying implementation
Definition: entityseed.hh:59
EntitySeedImp Implementation
type of underlying implementation
Definition: entityseed.hh:37
EntitySeed(const EntitySeedImp &implementation)
Construct from implementation class.
Definition: entityseed.hh:44
static constexpr int codimension
codimension of underlying entity
Definition: entityseed.hh:30
EntitySeed()
Construct an empty (i.e. isValid() == false) seed.
Definition: entityseed.hh:40
const Implementation & impl() const
access to the underlying implementation
Definition: entityseed.hh:66
bool isValid() const
check whether it is safe to create an Entity from this Seed
Definition: entityseed.hh:49
Different resources needed by all grid implementations.
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)