dune-typetree  2.8.0
leafnode.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 
4 #ifndef DUNE_TYPETREE_LEAFNODE_HH
5 #define DUNE_TYPETREE_LEAFNODE_HH
6 
8 #include <cstddef>
9 #include <type_traits>
10 
11 namespace Dune {
12  namespace TypeTree {
13 
25  class LeafNode
26  {
27 
28  public:
29 
31  static const bool isLeaf = true;
32 
34  static const bool isPower = false;
35 
37  static const bool isComposite = false;
38 
40  static const std::size_t CHILDREN = 0;
41 
44 
45  static constexpr auto degree()
46  {
47  return std::integral_constant<std::size_t,0>{};
48  }
49 
50  protected:
51 
53 
58  LeafNode() {}
59  };
60 
62 
63  } // namespace TypeTree
64 } //namespace Dune
65 
66 #endif // DUNE_TYPETREE_POWERNODE_HH
Definition: accumulate_static.hh:13
Base class for leaf nodes in a dune-typetree.
Definition: leafnode.hh:26
LeafNodeTag NodeTag
The type tag that describes a LeafNode.
Definition: leafnode.hh:43
static const bool isLeaf
Mark this class as a leaf in a dune-typetree.
Definition: leafnode.hh:31
static const std::size_t CHILDREN
Leafs have no children.
Definition: leafnode.hh:40
static const bool isPower
Mark this class as a non power in the dune-typetree.
Definition: leafnode.hh:34
LeafNode()
Default constructor.
Definition: leafnode.hh:58
static const bool isComposite
Mark this class as a non composite in the dune-typetree.
Definition: leafnode.hh:37
static constexpr auto degree()
Definition: leafnode.hh:45
Tag designating a leaf node.
Definition: nodetags.hh:16