6#ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
7#define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
14#include <dune/common/exceptions.hh>
25 template<
typename SourceNode,
typename Transformation,
typename TransformedNode>
41 return std::make_shared<transformed_type>();
47 template<
typename SourceNode,
typename Transformation,
template<
typename Child, std::
size_t>
class TransformedNode>
56 typedef TransformedNode<TC, StaticDegree<SourceNode>::value>
type;
70 return std::make_shared<typename result<TC>::type>(children);
76 template<
typename SourceNode,
typename Transformation,
template<
typename Child>
class TransformedNode>
85 typedef TransformedNode<TC>
type;
90 static typename result<TC>::type transform(
const SourceNode& s,
const Transformation& t,
const std::vector<std::shared_ptr<TC>>& children)
98 return std::make_shared<typename result<TC>::type>(children);
104 template<
typename SourceNode,
typename Transformation,
template<
typename...>
class TransformedNode>
110 template<
typename... TC>
113 typedef TransformedNode<TC...>
type;
117 template<
typename... TC>
118 static typename result<TC...>::type
transform(
const SourceNode& s,
const Transformation& t, std::shared_ptr<TC>... children)
123 template<
typename... TC>
124 static typename result<TC...>::storage_type
transform_storage(std::shared_ptr<const SourceNode> s,
const Transformation& t, std::shared_ptr<TC>... children)
126 return std::make_shared<
typename result<TC...>::type>(children...);
decltype(Node::degree()) StaticDegree
Returns the statically known degree of the given Node type as a std::integral_constant.
Definition nodeinterface.hh:107
Definition accumulate_static.hh:16
Definition simpletransformationdescriptors.hh:27
static transformed_type transform(const SourceNode &s, const Transformation &t)
Definition simpletransformationdescriptors.hh:34
static const bool recursive
Definition simpletransformationdescriptors.hh:29
std::shared_ptr< transformed_type > transformed_storage_type
Definition simpletransformationdescriptors.hh:32
static transformed_storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t)
Definition simpletransformationdescriptors.hh:39
TransformedNode transformed_type
Definition simpletransformationdescriptors.hh:31
Definition simpletransformationdescriptors.hh:49
static result< TC >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
Definition simpletransformationdescriptors.hh:68
static const bool recursive
Definition simpletransformationdescriptors.hh:51
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
Definition simpletransformationdescriptors.hh:62
Definition simpletransformationdescriptors.hh:55
TransformedNode< TC, StaticDegree< SourceNode >::value > type
Definition simpletransformationdescriptors.hh:56
static const std::size_t degree
Definition simpletransformationdescriptors.hh:58
std::shared_ptr< type > storage_type
Definition simpletransformationdescriptors.hh:57
Definition simpletransformationdescriptors.hh:78
static const bool recursive
Definition simpletransformationdescriptors.hh:80
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
Definition simpletransformationdescriptors.hh:90
static result< TC >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
Definition simpletransformationdescriptors.hh:96
Definition simpletransformationdescriptors.hh:84
TransformedNode< TC > type
Definition simpletransformationdescriptors.hh:85
std::shared_ptr< type > storage_type
Definition simpletransformationdescriptors.hh:86
Definition simpletransformationdescriptors.hh:106
static const bool recursive
Definition simpletransformationdescriptors.hh:108
static result< TC... >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
Definition simpletransformationdescriptors.hh:124
static result< TC... >::type transform(const SourceNode &s, const Transformation &t, std::shared_ptr< TC >... children)
Definition simpletransformationdescriptors.hh:118
Definition simpletransformationdescriptors.hh:112
std::shared_ptr< type > storage_type
Definition simpletransformationdescriptors.hh:114
TransformedNode< TC... > type
Definition simpletransformationdescriptors.hh:113