DUNE PDELab (2.7)
compositenode.hh
160 // * the first argument is not a valid flat index, i.e. either a std::size_t or an index_constant.
165 // We have to do a lazy lookup of the return type after SFINAE has succeeded, otherwise the return
183 "You cannot use the member function child() with an empty TreePath, use the freestanding version child(node,treePath) instead."
203 "You cannot use the member function child() with an empty TreePath, use the freestanding version child(node,treePath) instead."
227 template<typename... Args, typename = typename std::enable_if<(sizeof...(Args) == CHILDREN)>::type>
Base class for composite nodes based on variadic templates.
Definition: compositenode.hh:25
CompositeNode(Args &&... args)
Initialize all children with the passed-in objects.
Definition: compositenode.hh:228
void setChild(typename Child< k >::Storage child, index_constant< k >={})
Sets the storage of the i-th child to the passed-in value.
Definition: compositenode.hh:136
static const bool isLeaf
Mark this class as non leaf in the dune-typetree.
Definition: compositenode.hh:39
ImplementationDefined & child(Indices... indices)
Returns the child given by the list of indices.
Definition: compositenode.hh:175
Child< k >::Storage childStorage(index_constant< k >={})
Returns the storage of the i-th child.
Definition: compositenode.hh:102
static const bool isComposite
Mark this class as a composite in the dune-typetree.
Definition: compositenode.hh:45
static const std::size_t CHILDREN
The number of children.
Definition: compositenode.hh:48
CompositeNode()
Default constructor.
Definition: compositenode.hh:223
CompositeNodeTag NodeTag
The type tag that describes a CompositeNode.
Definition: compositenode.hh:30
void setChild(typename Child< k >::Type &child, index_constant< k >={})
Sets the i-th child to the passed-in value.
Definition: compositenode.hh:122
void setChild(typename Child< k >::Type &&child, index_constant< k >={})
Store the passed value in k-th child.
Definition: compositenode.hh:129
CompositeNode(std::shared_ptr< Children >... children)
Initialize the CompositeNode with copies of the passed in Storage objects.
Definition: compositenode.hh:233
Child< k >::ConstStorage childStorage(index_constant< k >={}) const
Returns the storage of the i-th child (const version).
Definition: compositenode.hh:115
std::tuple< Children... > ChildTypes
A tuple storing the types of all children.
Definition: compositenode.hh:36
const ImplementationDefined & child(Indices... indices)
Returns the child given by the list of indices.
Definition: compositenode.hh:195
static const bool isPower
Mark this class as a non power in the dune-typetree.
Definition: compositenode.hh:42
Child< k >::Type & child(index_constant< k >={})
Returns the i-th child.
Definition: compositenode.hh:82
CompositeNode(const NodeStorage &children)
Initialize the CompositeNode with a copy of the passed-in storage type.
Definition: compositenode.hh:238
std::tuple< std::shared_ptr< Children >... > NodeStorage
The type used for storing the children.
Definition: compositenode.hh:33
const Child< k >::Type & child(index_constant< k >={}) const
Returns the i-th child (const version).
Definition: compositenode.hh:92
ImplementationDefined child(Node &&node, Indices... indices)
Extracts the child of a node given by a sequence of compile-time and run-time indices.
Definition: childextraction.hh:179
Namespace with predefined compile time indices for the range [0,19].
Definition: indices.hh:49
shared_ptr< T > stackobject_to_shared_ptr(T &t)
Create a shared_ptr for a stack-allocated object.
Definition: shared_ptr.hh:75
STL namespace.
Dummy struct used for documentation purposes.
Definition: documentation.hh:40
Access to the type and storage type of the i-th child.
Definition: compositenode.hh:57
std::tuple_element< k, ChildTypes >::type Type
The type of the child.
Definition: compositenode.hh:62
std::tuple_element< k, NodeStorage >::type Storage
The storage type of the child.
Definition: compositenode.hh:68
std::tuple_element< k, ChildTypes >::type type
The type of the child.
Definition: compositenode.hh:65
std::shared_ptr< const typename std::tuple_element< k, ChildTypes >::type > ConstStorage
The const storage type of the child.
Definition: compositenode.hh:71
![Creative Commons License](https://i.creativecommons.org/l/by-sa/4.0/80x15.png)