dune-typetree
2.9
|
Base class for composite nodes based on variadic templates. More...
#include <dune/typetree/compositenode.hh>
Classes | |
struct | Child |
Access to the type and storage type of the i-th child. More... | |
Public Types | |
typedef CompositeNodeTag | NodeTag |
The type tag that describes a CompositeNode. More... | |
typedef std::tuple< std::shared_ptr< Children >... > | NodeStorage |
The type used for storing the children. More... | |
typedef std::tuple< Children... > | ChildTypes |
A tuple storing the types of all children. More... | |
Public Member Functions | |
Child Access | |
template<std::size_t k> | |
Child< k >::Type & | child (index_constant< k >={}) |
Returns the k-th child. More... | |
template<std::size_t k> | |
const Child< k >::Type & | child (index_constant< k >={}) const |
Returns the k-th child (const version). More... | |
template<std::size_t k> | |
std::shared_ptr< typename Child< k >::Type > | childStorage (index_constant< k >={}) |
Returns the storage of the k-th child. More... | |
template<std::size_t k> | |
std::shared_ptr< const typename Child< k >::Type > | childStorage (index_constant< k >={}) const |
Returns the storage of the k-th child (const version). More... | |
template<std::size_t k> | |
void | setChild (typename Child< k >::Type &child, index_constant< k >={}) |
Sets the k-th child to the passed-in value. More... | |
template<std::size_t k> | |
void | setChild (typename Child< k >::Type &&child, index_constant< k >={}) |
Store the passed value in k-th child. More... | |
template<std::size_t k> | |
void | setChild (std::shared_ptr< typename Child< k >::Type > child, index_constant< k >={}) |
Sets the storage of the k-th child to the passed-in value. More... | |
const NodeStorage & | nodeStorage () const |
Nested Child Access | |
template<typename... Indices> | |
ImplementationDefined & | child (Indices... indices) |
Returns the child given by the list of indices. More... | |
template<typename... Indices> | |
const ImplementationDefined & | child (Indices... indices) |
Returns the child given by the list of indices. More... | |
Static Public Member Functions | |
static constexpr auto | degree () |
Static Public Attributes | |
static const bool | isLeaf = false |
Mark this class as non leaf in the dune-typetree. More... | |
static const bool | isPower = false |
Mark this class as a non power in the dune-typetree. More... | |
static const bool | isComposite = true |
Mark this class as a composite in the dune-typetree. More... | |
static const std::size_t | CHILDREN = sizeof...(Children) |
The number of children. More... | |
Protected Member Functions | |
Constructors | |
CompositeNode () | |
Default constructor. More... | |
template<typename... Args, typename = typename std::enable_if<(sizeof...(Args) == degree())>::type> | |
CompositeNode (Args &&... args) | |
Initialize all children with the passed-in objects. More... | |
CompositeNode (std::shared_ptr< Children >... children) | |
Initialize the CompositeNode with copies of the passed in Storage objects. More... | |
CompositeNode (const NodeStorage &children) | |
Initialize the CompositeNode with a copy of the passed-in storage type. More... | |
Base class for composite nodes based on variadic templates.
typedef std::tuple<Children...> Dune::TypeTree::CompositeNode< Children >::ChildTypes |
A tuple storing the types of all children.
typedef std::tuple<std::shared_ptr<Children>... > Dune::TypeTree::CompositeNode< Children >::NodeStorage |
The type used for storing the children.
typedef CompositeNodeTag Dune::TypeTree::CompositeNode< Children >::NodeTag |
The type tag that describes a CompositeNode.
|
inlineprotected |
Default constructor.
This constructor requires the storage type to be default constructible.
|
inlineprotected |
Initialize all children with the passed-in objects.
|
inlineprotected |
Initialize the CompositeNode with copies of the passed in Storage objects.
|
inlineprotected |
Initialize the CompositeNode with a copy of the passed-in storage type.
|
inline |
Returns the k-th child.
|
inline |
Returns the k-th child (const version).
|
inline |
Returns the child given by the list of indices.
This method simply forwards to the freestanding function child(). See that function for further information.
|
inline |
Returns the child given by the list of indices.
This method simply forwards to the freestanding function child(). See that function for further information.
|
inline |
Returns the storage of the k-th child.
|
inline |
Returns the storage of the k-th child (const version).
|
inlinestaticconstexpr |
|
inline |
|
inline |
Sets the storage of the k-th child to the passed-in value.
|
inline |
Store the passed value in k-th child.
|
inline |
Sets the k-th child to the passed-in value.
|
static |
The number of children.
|
static |
Mark this class as a composite in the dune-typetree.
|
static |
Mark this class as non leaf in the dune-typetree.
|
static |
Mark this class as a non power in the dune-typetree.