dune-typetree  2.4-dev
Classes | Functions
Child Extraction
Collaboration diagram for Child Extraction:

Classes

struct  Dune::TypeTree::extract_child_type< Node, TreePath >
 Extract the type of the child of Node at position TreePath. More...
 

Functions

template<typename Node , typename TreePath >
ImplementationDefined & Dune::TypeTree::extract_child (Node &node, Treepath tp)
 Extract the child of a node located at tp (non-const version). More...
 
template<typename Node , typename TreePath >
const ImplementationDefined & Dune::TypeTree::extract_child (const Node &node, Treepath tp)
 Extract the child of a node located at tp (const version). More...
 
template<typename Node , typename TreePath >
ImplementationDefined Dune::TypeTree::extract_child_storage (Node &node, Treepath tp)
 
template<typename Node , typename TreePath >
ImplementationDefined Dune::TypeTree::extract_child_storage (const Node &node, Treepath tp)
 

Detailed Description

Utility functions and metafunctions for extracting children from a TypeTree.

Function Documentation

template<typename Node , typename TreePath >
ImplementationDefined& Dune::TypeTree::extract_child ( Node &  node,
Treepath  tp 
)

Extract the child of a node located at tp (non-const version).

Use this function to extract a (possibly indirect) child of a TypeTree node.

Example:

extract_child(node,Dune::TypeTree::TreePath<2,3,0>())

returns the first child of the fourth child of the third child of node.

See also
Use extract_child_type to determine the type of the return value.
Parameters
nodeThe node from which to extract the child.
tpThe path into the tree leading to the child. Note that the actual instance is not used at all by this function, only the type of the parameter.
Template Parameters
TreePathA TreePath instantiation which statically encodes the path to the child.
Returns
A reference to the child.
template<typename Node , typename TreePath >
const ImplementationDefined& Dune::TypeTree::extract_child ( const Node &  node,
Treepath  tp 
)

Extract the child of a node located at tp (const version).

Use this function to extract a (possibly indirect) child of a TypeTree node.

Example:

extract_child(node,Dune::TypeTree::TreePath<2,3,0>())

returns the first child of the fourth child of the third child of node.

See also
Use extract_child_type to determine the type of the return value.
Parameters
nodeThe node from which to extract the child.
tpThe path into the tree leading to the child. Note that the actual instance is not used at all by this function, only the type of the parameter.
Template Parameters
TreePathA TreePath instantiation which statically encodes the path to the child.
Returns
A reference to the child.
template<typename Node , typename TreePath >
ImplementationDefined Dune::TypeTree::extract_child_storage ( Node &  node,
Treepath  tp 
)

Extract the storage for the child of a node located at tp (non-const version). Use this function to extract the storage (usually a shared_ptr) of a (possibly indirect) child of a TypeTree node.

Example:

extract_child_storage(node,Dune::TypeTree::TreePath<2,3,0>())

returns the first child of the fourth child of the third child of node.

See also
Use extract_child_type to determine the type of the return value.
Parameters
nodeThe node from which to extract the child.
tpThe path into the tree leading to the child. Note that the actual instance is not used at all by this function, only the type of the parameter.
Template Parameters
TreePathA TreePath instantiation which statically encodes the path to the child.
Returns
A reference to the child.
template<typename Node , typename TreePath >
ImplementationDefined Dune::TypeTree::extract_child_storage ( const Node &  node,
Treepath  tp 
)

Extract the storage for the child of a node located at tp (const version). Use this function to extract the const storage (usually a shared_ptr) of a (possibly indirect) child of a TypeTree node.

Example:

extract_child_storage(node,Dune::TypeTree::TreePath<2,3,0>())

returns the first child of the foruth child of the third child of node.

See also
Use extract_child_type to determine the type of the return value.
Parameters
nodeThe node from which to extract the child.
tpThe path into the tree leading to the child. Note that the actual instance is not used at all by this function, only the type of the parameter.
Template Parameters
TreePathA TreePath instantiation which statically encodes the path to the child.
Returns
A reference to the child.