4 #ifndef DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH 5 #define DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH 12 #include <dune/common/exceptions.hh> 23 template<
typename SourceNode,
typename Transformation,
typename TransformedNode>
32 static transformed_type
transform(
const SourceNode& s,
const Transformation& t)
37 static transformed_type
transform(std::shared_ptr<const SourceNode> s,
const Transformation& t)
42 static transformed_storage_type
transform_storage(std::shared_ptr<const SourceNode> s,
const Transformation& t)
44 return std::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 std::array<std::shared_ptr<TC>,result<TC>::type::CHILDREN>& children)
66 return typename result<TC>::type(s,t,children);
70 static typename result<TC>::type
transform(std::shared_ptr<const SourceNode> s,
const Transformation& t,
const std::array<std::shared_ptr<TC>,result<TC>::type::CHILDREN>& children)
72 return typename result<TC>::type(s,t,children);
76 static typename result<TC>::storage_type
transform_storage(std::shared_ptr<const SourceNode> s,
const Transformation& t,
const std::array<std::shared_ptr<TC>,result<TC>::type::CHILDREN>& children)
78 return std::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 template<
typename SourceNode,
typename Transformation,
template<
typename...>
class TransformedNodeTemplate>
101 template<
typename... TC>
108 template<
typename... TC>
109 static typename result<TC...>::type
transform(
const SourceNode& s,
const Transformation& t, std::shared_ptr<TC>... children)
111 return typename result<TC...>::type(s,t,children...);
114 template<
typename... TC>
115 static typename result<TC...>::type
transform(std::shared_ptr<const SourceNode> s,
const Transformation& t, std::shared_ptr<TC>... children)
117 return typename result<TC...>::type(s,t,children...);
120 template<
typename... TC>
121 static typename result<TC...>::storage_type
transform_storage(std::shared_ptr<const SourceNode> s,
const Transformation& t, std::shared_ptr<TC>... children)
123 return std::make_shared<
typename result<TC...>::type>(s,t,children...);
129 template<
typename SourceNode,
typename Transformation,
template<
typename,
typename...>
class TransformedNode>
133 GenericCompositeNodeTransformationTemplate<SourceNode,
135 TransformedNode>::template result
144 #endif // DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH static result< TC... >::type transform(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >...children)
Definition: generictransformationdescriptors.hh:115
std::shared_ptr< transformed_type > transformed_storage_type
Definition: generictransformationdescriptors.hh:30
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::type::CHILDREN > &children)
Definition: generictransformationdescriptors.hh:64
Definition: generictransformationdescriptors.hh:102
Definition: generictransformationdescriptors.hh:51
static transformed_storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t)
Definition: generictransformationdescriptors.hh:42
static result< TC >::type transform(std::shared_ptr< const SourceNode > s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::type::CHILDREN > &children)
Definition: generictransformationdescriptors.hh:70
TransformedNodeTemplate< TC >::type type
Definition: generictransformationdescriptors.hh:59
TransformedNodeTemplate< TC... >::type type
Definition: generictransformationdescriptors.hh:104
static const result_type result
Definition: accumulate_static.hh:109
Definition: generictransformationdescriptors.hh:85
TransformedNode transformed_type
Definition: generictransformationdescriptors.hh:29
Definition: generictransformationdescriptors.hh:130
std::shared_ptr< type > storage_type
Definition: generictransformationdescriptors.hh:105
static const bool recursive
Definition: generictransformationdescriptors.hh:27
static result< TC... >::type transform(const SourceNode &s, const Transformation &t, std::shared_ptr< TC >...children)
Definition: generictransformationdescriptors.hh:109
Definition: generictransformationdescriptors.hh:96
static transformed_type transform(const SourceNode &s, const Transformation &t)
Definition: generictransformationdescriptors.hh:32
static transformed_type transform(std::shared_ptr< const SourceNode > s, const Transformation &t)
Definition: generictransformationdescriptors.hh:37
Definition: generictransformationdescriptors.hh:24
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 >::type::CHILDREN > &children)
Definition: generictransformationdescriptors.hh:76
Definition: generictransformationdescriptors.hh:57
Definition: accumulate_static.hh:12
std::shared_ptr< type > storage_type
Definition: generictransformationdescriptors.hh:60
static result< TC... >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >...children)
Definition: generictransformationdescriptors.hh:121