4 #ifndef DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH
5 #define DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH
9 #include <dune/common/exceptions.hh>
10 #include <dune/common/shared_ptr.hh>
11 #include <dune/common/array.hh>
12 #include <dune/common/tuples.hh>
23 template<
typename SourceNode,
typename Transformation,
typename TransformedNode>
44 return make_shared<transformed_type>(s,t);
50 template<
typename SourceNode,
typename Transformation,
template<
typename Child>
class TransformedNodeTemplate>
59 typedef typename TransformedNodeTemplate<TC>::type
type;
64 static typename result<TC>::type
transform(
const SourceNode& s,
const Transformation& t,
const array<shared_ptr<TC>,result<TC>::type::CHILDREN>& children)
70 static typename result<TC>::type
transform(shared_ptr<const SourceNode> s,
const Transformation& t,
const array<shared_ptr<TC>,result<TC>::type::CHILDREN>& children)
76 static typename result<TC>::storage_type
transform_storage(shared_ptr<const SourceNode> s,
const Transformation& t,
const array<shared_ptr<TC>,result<TC>::type::CHILDREN>& children)
78 return make_shared<typename result<TC>::type>(s,t,children);
84 template<
typename SourceNode,
typename Transformation,
template<
typename,
typename,std::
size_t>
class TransformedNode>
88 GenericPowerNodeTransformationTemplate<SourceNode,
90 TransformedNode>::template result
95 #if HAVE_VARIADIC_TEMPLATES
97 template<
typename SourceNode,
typename Transformation,
template<
typename...>
class TransformedNodeTemplate>
98 struct TemplatizedGenericVariadicCompositeNodeTransformation
101 static const bool recursive =
true;
103 template<
typename... TC>
106 typedef typename TransformedNodeTemplate<TC...>::type type;
107 typedef shared_ptr<type> storage_type;
110 template<
typename... TC>
111 static typename result<TC...>::type transform(
const SourceNode& s,
const Transformation& t, shared_ptr<TC>... children)
113 return typename result<TC...>::type(s,t,children...);
116 template<
typename... TC>
117 static typename result<TC...>::type transform(shared_ptr<const SourceNode> s,
const Transformation& t, shared_ptr<TC>... children)
119 return typename result<TC...>::type(s,t,children...);
122 template<
typename... TC>
123 static typename result<TC...>::storage_type transform_storage(shared_ptr<const SourceNode> s,
const Transformation& t, shared_ptr<TC>... children)
125 return make_shared<
typename result<TC...>::type>(s,t,children...);
131 template<
typename SourceNode,
typename Transformation,
template<
typename,
typename...>
class TransformedNode>
132 struct GenericVariadicCompositeNodeTransformation
133 :
public TemplatizedGenericVariadicCompositeNodeTransformation<SourceNode,
135 GenericVariadicCompositeNodeTransformationTemplate<SourceNode,
137 TransformedNode>::template result
141 #endif // HAVE_VARIADIC_TEMPLATES
144 template<
typename SourceNode,
typename Transformation,
template<
typename C0,
154 >
class TransformedNodeTemplate>
158 static const bool recursive =
true;
160 template<
typename TC0,
172 typedef typename TransformedNodeTemplate<TC0,TC1,TC2,TC3,TC4,TC5,TC6,TC7,TC8,TC9>::type
type;
176 template<
typename TC0,
188 const Transformation& t,
200 return typename result<TC0,TC1,TC2,TC3,TC4,TC5,TC6,TC7,TC8,TC9>::type(s,t,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9);
203 template<
typename TC0,
213 static typename result<TC0,TC1,TC2,TC3,TC4,TC5,TC6,TC7,TC8,TC9>::storage_type
215 const Transformation& t,
227 return make_shared<typename result<TC0,TC1,TC2,TC3,TC4,TC5,TC6,TC7,TC8,TC9>::type>(s,t,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9);
233 template<
typename SourceNode,
typename Transformation,
template<
typename Source,
243 typename C9>
class TransformedNode>
247 GenericCompositeNodeTransformationTemplate<SourceNode,
249 TransformedNode>::template result
259 #endif // DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH
static result< TC >::type transform(shared_ptr< const SourceNode > s, const Transformation &t, const array< shared_ptr< TC >, result< TC >::type::CHILDREN > &children)
Definition: generictransformationdescriptors.hh:70
static const bool recursive
Definition: generictransformationdescriptors.hh:54
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: generictransformationdescriptors.hh:187
static transformed_storage_type transform_storage(shared_ptr< const SourceNode > s, const Transformation &t)
Definition: generictransformationdescriptors.hh:42
Definition: generictransformationdescriptors.hh:85
TransformedNodeTemplate< TC >::type type
Definition: generictransformationdescriptors.hh:59
Definition: generictransformationdescriptors.hh:51
TransformedNode transformed_type
Definition: generictransformationdescriptors.hh:29
Definition: generictransformationdescriptors.hh:244
TransformedNodeTemplate< TC0, TC1, TC2, TC3, TC4, TC5, TC6, TC7, TC8, TC9 >::type type
Definition: generictransformationdescriptors.hh:172
static const bool recursive
Definition: generictransformationdescriptors.hh:27
static transformed_type transform(const SourceNode &s, const Transformation &t)
Definition: generictransformationdescriptors.hh:32
shared_ptr< type > storage_type
Definition: generictransformationdescriptors.hh:173
static const result_type result
Definition: accumulate_static.hh:108
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const array< shared_ptr< TC >, result< TC >::type::CHILDREN > &children)
Definition: generictransformationdescriptors.hh:64
Definition: generictransformationdescriptors.hh:24
shared_ptr< type > storage_type
Definition: generictransformationdescriptors.hh:60
Definition: generictransformationdescriptors.hh:155
static transformed_type transform(shared_ptr< const SourceNode > s, const Transformation &t)
Definition: generictransformationdescriptors.hh:37
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: generictransformationdescriptors.hh:214
shared_ptr< transformed_type > transformed_storage_type
Definition: generictransformationdescriptors.hh:30
Definition: generictransformationdescriptors.hh:57
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: generictransformationdescriptors.hh:76
Definition: generictransformationdescriptors.hh:170