4 #ifndef DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH 5 #define DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH 13 #include <dune/common/exceptions.hh> 24 template<
typename SourceNode,
typename Transformation,
typename TransformedNode>
33 static transformed_type
transform(
const SourceNode& s,
const Transformation& t)
38 static transformed_type
transform(std::shared_ptr<const SourceNode> s,
const Transformation& t)
43 static transformed_storage_type
transform_storage(std::shared_ptr<const SourceNode> s,
const Transformation& t)
45 return std::make_shared<transformed_type>(s,t);
51 template<
typename SourceNode,
typename Transformation,
template<
typename Child>
class TransformedNodeTemplate>
60 typedef typename TransformedNodeTemplate<TC>::type
type;
66 static typename result<TC>::type
transform(
const SourceNode& s,
const Transformation& t,
const std::array<std::shared_ptr<TC>,
result<TC>::degree>& children)
68 return typename result<TC>::type(s,t,children);
72 static typename result<TC>::type
transform(std::shared_ptr<const SourceNode> s,
const Transformation& t,
const std::array<std::shared_ptr<TC>,
result<TC>::degree>& children)
74 return typename result<TC>::type(s,t,children);
78 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>::degree>& children)
80 return std::make_shared<typename result<TC>::type>(s,t,children);
86 template<
typename SourceNode,
typename Transformation,
template<
typename,
typename,std::
size_t>
class TransformedNode>
90 GenericPowerNodeTransformationTemplate<SourceNode,
92 TransformedNode>::template result
97 template<
typename SourceNode,
typename Transformation,
template<
typename...>
class TransformedNodeTemplate>
103 template<
typename... TC>
110 template<
typename... TC>
111 static typename result<TC...>::type
transform(
const SourceNode& s,
const Transformation& t, std::shared_ptr<TC>... children)
113 return typename result<TC...>::type(s,t,children...);
116 template<
typename... TC>
117 static typename result<TC...>::type
transform(std::shared_ptr<const SourceNode> s,
const Transformation& t, std::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(std::shared_ptr<const SourceNode> s,
const Transformation& t, std::shared_ptr<TC>... children)
125 return std::make_shared<
typename result<TC...>::type>(s,t,children...);
131 template<
typename SourceNode,
typename Transformation,
template<
typename,
typename...>
class TransformedNode>
135 GenericCompositeNodeTransformationTemplate<SourceNode,
137 TransformedNode>::template result
146 #endif // DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH TransformedNodeTemplate< TC >::type type
Definition: generictransformationdescriptors.hh:60
Definition: generictransformationdescriptors.hh:87
Definition: generictransformationdescriptors.hh:25
std::shared_ptr< type > storage_type
Definition: generictransformationdescriptors.hh:107
static result< TC >::type transform(std::shared_ptr< const SourceNode > s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
Definition: generictransformationdescriptors.hh:72
TransformedNodeTemplate< TC... >::type type
Definition: generictransformationdescriptors.hh:106
Definition: generictransformationdescriptors.hh:104
static result< TC... >::type transform(const SourceNode &s, const Transformation &t, std::shared_ptr< TC >... children)
Definition: generictransformationdescriptors.hh:111
static result< TC... >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
Definition: generictransformationdescriptors.hh:123
Definition: accumulate_static.hh:13
static transformed_type transform(const SourceNode &s, const Transformation &t)
Definition: generictransformationdescriptors.hh:33
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: generictransformationdescriptors.hh:78
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:71
static const bool recursive
Definition: generictransformationdescriptors.hh:28
std::shared_ptr< type > storage_type
Definition: generictransformationdescriptors.hh:61
static result< TC... >::type transform(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
Definition: generictransformationdescriptors.hh:117
Definition: generictransformationdescriptors.hh:58
static transformed_type transform(std::shared_ptr< const SourceNode > s, const Transformation &t)
Definition: generictransformationdescriptors.hh:38
static transformed_storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t)
Definition: generictransformationdescriptors.hh:43
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
Definition: generictransformationdescriptors.hh:66
Definition: generictransformationdescriptors.hh:98
TransformedNode transformed_type
Definition: generictransformationdescriptors.hh:30
std::shared_ptr< transformed_type > transformed_storage_type
Definition: generictransformationdescriptors.hh:31
static const result_type result
Definition: accumulate_static.hh:110
std::integral_constant< std::size_t, degree(static_cast< std::decay_t< Node > * >(nullptr), NodeTag< std::decay_t< Node >>()) > StaticDegree
Returns the statically known degree of the given Node type as a std::integral_constant.
Definition: nodeinterface.hh:105
Definition: generictransformationdescriptors.hh:52
Definition: generictransformationdescriptors.hh:132