4#ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
5#define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
12#include <dune/common/exceptions.hh>
23 template<
typename SourceNode,
typename Transformation,
typename TransformedNode>
39 return std::make_shared<transformed_type>();
45 template<
typename SourceNode,
typename Transformation,
template<
typename Child, std::
size_t>
class TransformedNode>
54 typedef TransformedNode<TC, StaticDegree<SourceNode>::value>
type;
68 return std::make_shared<typename result<TC>::type>(children);
74 template<
typename SourceNode,
typename Transformation,
template<
typename Child>
class TransformedNode>
83 typedef TransformedNode<TC>
type;
88 static typename result<TC>::type transform(
const SourceNode& s,
const Transformation& t,
const std::vector<std::shared_ptr<TC>>& children)
96 return std::make_shared<typename result<TC>::type>(children);
102 template<
typename SourceNode,
typename Transformation,
template<
typename...>
class TransformedNode>
108 template<
typename... TC>
111 typedef TransformedNode<TC...>
type;
115 template<
typename... TC>
116 static typename result<TC...>::type
transform(
const SourceNode& s,
const Transformation& t, std::shared_ptr<TC>... children)
121 template<
typename... TC>
122 static typename result<TC...>::storage_type
transform_storage(std::shared_ptr<const SourceNode> s,
const Transformation& t, std::shared_ptr<TC>... children)
124 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:113
Definition accumulate_static.hh:13
Definition simpletransformationdescriptors.hh:25
static transformed_type transform(const SourceNode &s, const Transformation &t)
Definition simpletransformationdescriptors.hh:32
static const bool recursive
Definition simpletransformationdescriptors.hh:27
std::shared_ptr< transformed_type > transformed_storage_type
Definition simpletransformationdescriptors.hh:30
static transformed_storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t)
Definition simpletransformationdescriptors.hh:37
TransformedNode transformed_type
Definition simpletransformationdescriptors.hh:29
Definition simpletransformationdescriptors.hh:47
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:66
static const bool recursive
Definition simpletransformationdescriptors.hh:49
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:60
Definition simpletransformationdescriptors.hh:53
TransformedNode< TC, StaticDegree< SourceNode >::value > type
Definition simpletransformationdescriptors.hh:54
static const std::size_t degree
Definition simpletransformationdescriptors.hh:56
std::shared_ptr< type > storage_type
Definition simpletransformationdescriptors.hh:55
Definition simpletransformationdescriptors.hh:76
static const bool recursive
Definition simpletransformationdescriptors.hh:78
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
Definition simpletransformationdescriptors.hh:88
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:94
Definition simpletransformationdescriptors.hh:82
TransformedNode< TC > type
Definition simpletransformationdescriptors.hh:83
std::shared_ptr< type > storage_type
Definition simpletransformationdescriptors.hh:84
Definition simpletransformationdescriptors.hh:104
static const bool recursive
Definition simpletransformationdescriptors.hh:106
static result< TC... >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
Definition simpletransformationdescriptors.hh:122
static result< TC... >::type transform(const SourceNode &s, const Transformation &t, std::shared_ptr< TC >... children)
Definition simpletransformationdescriptors.hh:116
Definition simpletransformationdescriptors.hh:110
std::shared_ptr< type > storage_type
Definition simpletransformationdescriptors.hh:112
TransformedNode< TC... > type
Definition simpletransformationdescriptors.hh:111