4 #ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
5 #define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
10 #include <dune/common/exceptions.hh>
11 #include <dune/common/shared_ptr.hh>
12 #include <dune/common/tuples.hh>
23 template<
typename SourceNode,
typename Transformation,
typename TransformedNode>
32 static transformed_type
transform(
const SourceNode& s,
const Transformation& t)
37 static transformed_storage_type
transform_storage(shared_ptr<const SourceNode> s,
const Transformation& t)
39 return make_shared<transformed_type>();
45 template<
typename SourceNode,
typename Transformation,
template<
typename Child, std::
size_t>
class TransformedNode>
54 typedef TransformedNode<TC, SourceNode::CHILDREN>
type;
67 return make_shared<typename result<TC>::type>(children);
73 template<
typename SourceNode,
typename Transformation,
template<
typename...>
class TransformedNode>
79 template<
typename... TC>
82 typedef TransformedNode<TC...>
type;
86 template<
typename... TC>
87 static typename result<TC...>::type
transform(
const SourceNode& s,
const Transformation& t, shared_ptr<TC>... children)
92 template<
typename... TC>
93 static typename result<TC...>::storage_type
transform_storage(shared_ptr<const SourceNode> s,
const Transformation& t, shared_ptr<TC>... children)
95 return make_shared<
typename result<TC...>::type>(children...);
105 #endif // DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
Definition: simpletransformationdescriptors.hh:24
static transformed_storage_type transform_storage(shared_ptr< const SourceNode > s, const Transformation &t)
Definition: simpletransformationdescriptors.hh:37
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::array< shared_ptr< TC >, result< TC >::type::CHILDREN > &children)
Definition: simpletransformationdescriptors.hh:59
static const bool recursive
Definition: simpletransformationdescriptors.hh:49
shared_ptr< type > storage_type
Definition: simpletransformationdescriptors.hh:55
Definition: accumulate_static.hh:12
TransformedNode< TC, SourceNode::CHILDREN > type
Definition: simpletransformationdescriptors.hh:54
TransformedNode transformed_type
Definition: simpletransformationdescriptors.hh:29
Definition: simpletransformationdescriptors.hh:74
shared_ptr< transformed_type > transformed_storage_type
Definition: simpletransformationdescriptors.hh:30
static transformed_type transform(const SourceNode &s, const Transformation &t)
Definition: simpletransformationdescriptors.hh:32
static result< TC...>::storage_type transform_storage(shared_ptr< const SourceNode > s, const Transformation &t, shared_ptr< TC >...children)
Definition: simpletransformationdescriptors.hh:93
Definition: simpletransformationdescriptors.hh:52
static result< TC >::storage_type transform_storage(shared_ptr< const SourceNode > s, const Transformation &t, const std::array< shared_ptr< TC >, result< TC >::type::CHILDREN > &children)
Definition: simpletransformationdescriptors.hh:65
static const bool recursive
Definition: simpletransformationdescriptors.hh:77
Definition: simpletransformationdescriptors.hh:46
TransformedNode< TC...> type
Definition: simpletransformationdescriptors.hh:82
shared_ptr< type > storage_type
Definition: simpletransformationdescriptors.hh:83
static const bool recursive
Definition: simpletransformationdescriptors.hh:27
static result< TC...>::type transform(const SourceNode &s, const Transformation &t, shared_ptr< TC >...children)
Definition: simpletransformationdescriptors.hh:87
Definition: simpletransformationdescriptors.hh:80