4 #ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
5 #define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
8 #include <dune/common/exceptions.hh>
9 #include <dune/common/shared_ptr.hh>
10 #include <dune/common/array.hh>
11 #include <dune/common/tuples.hh>
22 template<
typename SourceNode,
typename Transformation,
typename TransformedNode>
38 return make_shared<transformed_type>();
44 template<
typename SourceNode,
typename Transformation,
template<
typename Child, std::
size_t>
class TransformedNode>
53 typedef TransformedNode<TC, SourceNode::CHILDREN>
type;
66 return make_shared<typename result<TC>::type>(children);
72 #if HAVE_VARIADIC_TEMPLATES
74 template<
typename SourceNode,
typename Transformation,
template<
typename...>
class TransformedNode>
75 struct SimpleVariadicCompositeNodeTransformation
78 static const bool recursive =
true;
80 template<
typename... TC>
83 typedef TransformedNode<TC...> type;
84 typedef shared_ptr<type> storage_type;
87 template<
typename... TC>
88 static typename result<TC...>::type transform(
const SourceNode& s,
const Transformation& t, shared_ptr<TC>... children)
90 return typename result<TC...>::type(children...);
93 template<
typename... TC>
94 static typename result<TC...>::storage_type transform_storage(shared_ptr<const SourceNode> s,
const Transformation& t, shared_ptr<TC>... children)
96 return make_shared<
typename result<TC...>::type>(children...);
101 #endif // HAVE_VARIADIC_TEMPLATES
104 template<
typename SourceNode,
typename Transformation,
template<
typename C0,
114 >
class TransformedNode>
118 static const bool recursive =
true;
120 template<
typename TC0,
132 typedef TransformedNode<TC0,TC1,TC2,TC3,TC4,TC5,TC6,TC7,TC8,TC9>
type;
136 template<
typename TC0,
148 const Transformation& t,
160 return typename result<TC0,TC1,TC2,TC3,TC4,TC5,TC6,TC7,TC8,TC9>::type(c0,c1,c2,c3,c4,c5,c6,c7,c8,c9);
163 template<
typename TC0,
173 static typename result<TC0,TC1,TC2,TC3,TC4,TC5,TC6,TC7,TC8,TC9>::storage_type
175 const Transformation& t,
187 return make_shared<typename result<TC0,TC1,TC2,TC3,TC4,TC5,TC6,TC7,TC8,TC9>::type>(c0,c1,c2,c3,c4,c5,c6,c7,c8,c9);
197 #endif // DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
TransformedNode< TC0, TC1, TC2, TC3, TC4, TC5, TC6, TC7, TC8, TC9 > type
Definition: simpletransformationdescriptors.hh:132
Definition: simpletransformationdescriptors.hh:51
Definition: simpletransformationdescriptors.hh:115
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const array< shared_ptr< TC >, result< TC >::type::CHILDREN > &children)
Definition: simpletransformationdescriptors.hh:58
Definition: simpletransformationdescriptors.hh:23
static const bool recursive
Definition: simpletransformationdescriptors.hh:26
shared_ptr< type > storage_type
Definition: simpletransformationdescriptors.hh:133
TransformedNode transformed_type
Definition: simpletransformationdescriptors.hh:28
static result< TC >::storage_type transform_storage(shared_ptr< const SourceNode > s, const Transformation &t, const array< shared_ptr< TC >, result< TC >::type::CHILDREN > &children)
Definition: simpletransformationdescriptors.hh:64
Definition: simpletransformationdescriptors.hh:45
static const result_type result
Definition: accumulate_static.hh:108
static transformed_type transform(const SourceNode &s, const Transformation &t)
Definition: simpletransformationdescriptors.hh:31
Definition: simpletransformationdescriptors.hh:130
shared_ptr< type > storage_type
Definition: simpletransformationdescriptors.hh:54
static result< TC0, TC1, TC2, TC3, TC4, TC5, TC6, TC7, TC8, TC9 >::storage_type transform_storage(shared_ptr< const SourceNode > s, const Transformation &t, shared_ptr< TC0 > c0, shared_ptr< TC1 > c1, shared_ptr< TC2 > c2, shared_ptr< TC3 > c3, shared_ptr< TC4 > c4, shared_ptr< TC5 > c5, shared_ptr< TC6 > c6, shared_ptr< TC7 > c7, shared_ptr< TC8 > c8, shared_ptr< TC9 > c9)
Definition: simpletransformationdescriptors.hh:174
static result< TC0, TC1, TC2, TC3, TC4, TC5, TC6, TC7, TC8, TC9 >::type transform(const SourceNode &s, const Transformation &t, shared_ptr< TC0 > c0, shared_ptr< TC1 > c1, shared_ptr< TC2 > c2, shared_ptr< TC3 > c3, shared_ptr< TC4 > c4, shared_ptr< TC5 > c5, shared_ptr< TC6 > c6, shared_ptr< TC7 > c7, shared_ptr< TC8 > c8, shared_ptr< TC9 > c9)
Definition: simpletransformationdescriptors.hh:147
shared_ptr< transformed_type > transformed_storage_type
Definition: simpletransformationdescriptors.hh:29
static const bool recursive
Definition: simpletransformationdescriptors.hh:48
static transformed_storage_type transform_storage(shared_ptr< const SourceNode > s, const Transformation &t)
Definition: simpletransformationdescriptors.hh:36
TransformedNode< TC, SourceNode::CHILDREN > type
Definition: simpletransformationdescriptors.hh:53