4 #ifndef DUNE_TYPETREE_CHILDEXTRACTION_HH
5 #define DUNE_TYPETREE_CHILDEXTRACTION_HH
7 #include <dune/common/documentation.hh>
8 #include <dune/common/typetraits.hh>
9 #include <dune/common/shared_ptr.hh>
24 template<
typename Node,
typename TreePath>
30 typename Node::template Child<TypeTree::TreePathFront<TreePath>::value>
::Type,
36 typename Node::template Child<TypeTree::TreePathFront<TreePath>::value>
::Type,
42 typename Node::template Child<TypeTree::TreePathFront<TreePath>::value>
::Type,
52 template<
typename Node>
90 template<
typename Node,
typename TreePath>
118 template<
typename Node,
typename TreePath>
128 template<
typename Node,
typename TreePath>
131 typename extract_child_type<Node,TreePath>::type&
139 template<
typename Node,
typename TreePath>
141 TypeTree::TreePathSize<TreePath>::value == 1,
142 typename Node::template Child<TypeTree::TreePathFront<TreePath>::value>
::Type&
146 return node.template child<TypeTree::TreePathFront<TreePath>::value>();
149 template<
typename Node,
typename TreePath>
151 TypeTree::TreePathSize<TreePath>::value == 0,
163 template<
typename Node,
typename TreePath>
165 (TypeTree::TreePathSize<TreePath>::value > 1),
166 const typename extract_child_type<Node,TreePath>::type&
170 return extract_child(node.template child<TypeTree::TreePathFront<TreePath>::value>(),
171 typename TypeTree::TreePathPopFront<TreePath>::type());
174 template<
typename Node,
typename TreePath>
176 TypeTree::TreePathSize<TreePath>::value == 1,
177 const typename Node::template Child<TypeTree::TreePathFront<TreePath>::value>
::Type&
181 return node.template child<TypeTree::TreePathFront<TreePath>::value>();
184 template<
typename Node,
typename TreePath>
186 TypeTree::TreePathSize<TreePath>::value == 0,
226 template<
typename Node,
typename TreePath>
255 template<
typename Node,
typename TreePath>
265 template<
typename Node,
typename TreePath>
267 (TypeTree::TreePathSize<TreePath>::value > 1),
268 typename extract_child_type<Node,TreePath>::storage_type
276 template<
typename Node,
typename TreePath>
278 TypeTree::TreePathSize<TreePath>::value == 1,
279 typename Node::template Child<TypeTree::TreePathFront<TreePath>::value>::Storage&
283 return node.template childStorage<TypeTree::TreePathFront<TreePath>::value>();
286 template<
typename Node,
typename TreePath>
288 TypeTree::TreePathSize<TreePath>::value == 0
292 static_assert((Dune::AlwaysFalse<Node>::value),
293 "extract_child_storage only works for real children, not the node itself.");
300 template<
typename Node,
typename TreePath>
302 (TypeTree::TreePathSize<TreePath>::value > 1),
303 typename extract_child_type<Node,TreePath>::const_storage_type
308 typename TypeTree::TreePathPopFront<TreePath>::type());
311 template<
typename Node,
typename TreePath>
313 TypeTree::TreePathSize<TreePath>::value == 1,
314 typename Node::template Child<TypeTree::TreePathFront<TreePath>::value>::ConstStorage
318 return node.template childStorage<TypeTree::TreePathFront<TreePath>::value>();
321 template<
typename Node,
typename TreePath>
323 TypeTree::TreePathSize<TreePath>::value == 0
327 static_assert((Dune::AlwaysFalse<Node>::value),
328 "extract_child_storage only works for real children, not the node itself.");
340 #endif // DUNE_TYPETREE_CHILDEXTRACTION_HH
extract_child_type< typename Node::template Child< TypeTree::TreePathFront< TreePath >::value >::Type, typename TypeTree::TreePathPopFront< TreePath >::type >::type type
The type of the child.
Definition: childextraction.hh:32
Definition: accumulate_static.hh:12
extract_child_type< typename Node::template Child< TypeTree::TreePathFront< TreePath >::value >::Type, typename TypeTree::TreePathPopFront< TreePath >::type >::const_storage_type const_storage_type
The const storage type of the child.
Definition: childextraction.hh:44
ImplementationDefined & extract_child(Node &node, Treepath tp)
Extract the child of a node located at tp (non-const version).
Definition: childextraction.hh:91
extract_child_type< typename Node::template Child< TypeTree::TreePathFront< TreePath >::value >::Type, typename TypeTree::TreePathPopFront< TreePath >::type >::storage_type storage_type
The storage type of the child.
Definition: childextraction.hh:38
ImplementationDefined extract_child_storage(Node &node, Treepath tp)
Definition: childextraction.hh:227
Definition: treepath.hh:106
Type
Definition: treepath.hh:25
Definition: treepath.hh:81
Extract the type of the child of Node at position TreePath.
Definition: childextraction.hh:25
Definition: treepath.hh:29
Definition: treepath.hh:36