6#ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
7#define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
15#include <dune/common/exceptions.hh>
26 template<
typename SourceNode,
typename Transformation,
typename TransformedNode>
42 return std::make_shared<transformed_type>();
48 template<
typename SourceNode,
typename Transformation,
template<
typename Child, std::
size_t>
class TransformedNode>
57 typedef TransformedNode<TC, StaticDegree<SourceNode>::value>
type;
71 return std::make_shared<typename result<TC>::type>(children);
77 template<
typename SourceNode,
typename Transformation,
template<
typename Child>
class TransformedNode>
86 typedef TransformedNode<TC>
type;
91 static typename result<TC>::type transform(
const SourceNode& s,
const Transformation& t,
const std::vector<std::shared_ptr<TC>>& children)
99 return std::make_shared<typename result<TC>::type>(children);
105 template<
typename SourceNode,
typename Transformation,
template<
typename...>
class TransformedNode>
111 template<
typename... TC>
114 typedef TransformedNode<TC...>
type;
118 template<
typename... TC>
119 static typename result<TC...>::type
transform(
const SourceNode& s,
const Transformation& t, std::shared_ptr<TC>... children)
124 template<
typename... TC>
125 static typename result<TC...>::storage_type
transform_storage(std::shared_ptr<const SourceNode> s,
const Transformation& t, std::shared_ptr<TC>... children)
127 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:17
Definition accumulate_static.hh:18
Definition simpletransformationdescriptors.hh:28
static transformed_type transform(const SourceNode &s, const Transformation &t)
Definition simpletransformationdescriptors.hh:35
static const bool recursive
Definition simpletransformationdescriptors.hh:30
std::shared_ptr< transformed_type > transformed_storage_type
Definition simpletransformationdescriptors.hh:33
static transformed_storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t)
Definition simpletransformationdescriptors.hh:40
TransformedNode transformed_type
Definition simpletransformationdescriptors.hh:32
Definition simpletransformationdescriptors.hh:50
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:69
static const bool recursive
Definition simpletransformationdescriptors.hh:52
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:63
Definition simpletransformationdescriptors.hh:56
TransformedNode< TC, StaticDegree< SourceNode >::value > type
Definition simpletransformationdescriptors.hh:57
static const std::size_t degree
Definition simpletransformationdescriptors.hh:59
std::shared_ptr< type > storage_type
Definition simpletransformationdescriptors.hh:58
Definition simpletransformationdescriptors.hh:79
static const bool recursive
Definition simpletransformationdescriptors.hh:81
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
Definition simpletransformationdescriptors.hh:91
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:97
Definition simpletransformationdescriptors.hh:85
TransformedNode< TC > type
Definition simpletransformationdescriptors.hh:86
std::shared_ptr< type > storage_type
Definition simpletransformationdescriptors.hh:87
Definition simpletransformationdescriptors.hh:107
static const bool recursive
Definition simpletransformationdescriptors.hh:109
static result< TC... >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
Definition simpletransformationdescriptors.hh:125
static result< TC... >::type transform(const SourceNode &s, const Transformation &t, std::shared_ptr< TC >... children)
Definition simpletransformationdescriptors.hh:119
Definition simpletransformationdescriptors.hh:113
std::shared_ptr< type > storage_type
Definition simpletransformationdescriptors.hh:115
TransformedNode< TC... > type
Definition simpletransformationdescriptors.hh:114