4 #ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH 5 #define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_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_storage_type
transform_storage(std::shared_ptr<const SourceNode> s,
const Transformation& t)
39 return std::make_shared<transformed_type>();
45 template<
typename SourceNode,
typename Transformation,
template<
typename Child, std::
size_t>
class TransformedNode>
54 typedef TransformedNode<TC, StaticDegree<SourceNode>::value>
type;
68 return std::make_shared<typename result<TC>::type>(children);
74 template<
typename SourceNode,
typename Transformation,
template<
typename...>
class TransformedNode>
80 template<
typename... TC>
83 typedef TransformedNode<TC...>
type;
87 template<
typename... TC>
88 static typename result<TC...>::type
transform(
const SourceNode& s,
const Transformation& t, std::shared_ptr<TC>... children)
93 template<
typename... TC>
94 static typename result<TC...>::storage_type
transform_storage(std::shared_ptr<const SourceNode> s,
const Transformation& t, std::shared_ptr<TC>... children)
96 return std::make_shared<
typename result<TC...>::type>(children...);
106 #endif // DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH std::shared_ptr< type > storage_type
Definition: simpletransformationdescriptors.hh:84
static result< TC... >::type transform(const SourceNode &s, const Transformation &t, std::shared_ptr< TC >... children)
Definition: simpletransformationdescriptors.hh:88
Definition: simpletransformationdescriptors.hh:81
Definition: simpletransformationdescriptors.hh:46
std::shared_ptr< transformed_type > transformed_storage_type
Definition: simpletransformationdescriptors.hh:30
static const bool recursive
Definition: simpletransformationdescriptors.hh:27
Definition: simpletransformationdescriptors.hh:75
Definition: accumulate_static.hh:13
TransformedNode< TC... > type
Definition: simpletransformationdescriptors.hh:83
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:71
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
Definition: simpletransformationdescriptors.hh:60
static transformed_storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t)
Definition: simpletransformationdescriptors.hh:37
Definition: simpletransformationdescriptors.hh:24
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
static result< TC... >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
Definition: simpletransformationdescriptors.hh:94
TransformedNode< TC, StaticDegree< SourceNode >::value > type
Definition: simpletransformationdescriptors.hh:54
Definition: simpletransformationdescriptors.hh:52
static transformed_type transform(const SourceNode &s, const Transformation &t)
Definition: simpletransformationdescriptors.hh:32
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: simpletransformationdescriptors.hh:66
std::shared_ptr< type > storage_type
Definition: simpletransformationdescriptors.hh:55
TransformedNode transformed_type
Definition: simpletransformationdescriptors.hh:29