dune-typetree  2.4.0-rc1
Namespaces | Classes | Enumerations | Functions
Collaboration diagram for TreePath:

Namespaces

 Dune::TypeTree::TreePathType
 

Classes

struct  Dune::TypeTree::FixedCapacityStackView< T >::Impl
 
class  Dune::TypeTree::FixedCapacityStackView< T >
 
class  Dune::TypeTree::FixedCapacityStack< T, capacity >
 
struct  Dune::TypeTree::TreePath< i >
 
struct  Dune::TypeTree::TreePathSize< typename >
 
struct  Dune::TypeTree::TreePathSize< TreePath< i...> >
 
struct  Dune::TypeTree::TreePathPushBack< typename, size_t >
 
struct  Dune::TypeTree::TreePathPushBack< TreePath< i...>, k >
 
struct  Dune::TypeTree::TreePathPushFront< typename, size_t >
 
struct  Dune::TypeTree::TreePathPushFront< TreePath< i...>, k >
 
struct  Dune::TypeTree::TreePathBack< typename >
 
struct  Dune::TypeTree::TreePathBack< TreePath< k > >
 
struct  Dune::TypeTree::TreePathBack< TreePath< j, k, l...> >
 
struct  Dune::TypeTree::TreePathFront< typename >
 
struct  Dune::TypeTree::TreePathFront< TreePath< k, i...> >
 
struct  Dune::TypeTree::TreePathPopBack< typename, >
 
struct  Dune::TypeTree::TreePathPopBack< TreePath< k >, i...>
 
struct  Dune::TypeTree::TreePathPopBack< TreePath< j, k, l...>, i...>
 
struct  Dune::TypeTree::TreePathPopFront< typename >
 
struct  Dune::TypeTree::TreePathPopFront< TreePath< k, i...> >
 
struct  Dune::TypeTree::TreePathConcat< typename, typename >
 
struct  Dune::TypeTree::TreePathConcat< TreePath< i...>, TreePath< k...> >
 
class  Dune::TypeTree::DynamicTreePath
 A TreePath that stores the path of a node as runtime information. More...
 
class  Dune::TypeTree::HybridTreePath< T >
 A hybrid version of TreePath that supports both compile time and run time indices. More...
 

Enumerations

enum  Dune::TypeTree::TreePathType::Type { Dune::TypeTree::TreePathType::fullyStatic, Dune::TypeTree::TreePathType::mostlyStatic, Dune::TypeTree::TreePathType::dynamic }
 

Functions

template<std::size_t... i>
constexpr std::size_t Dune::TypeTree::treePathSize (const TreePath< i...> &)
 Returns the size (number of components) of the given TreePath. More...
 
template<std::size_t... i>
void Dune::TypeTree::print_tree_path (std::ostream &os)
 
template<std::size_t k, std::size_t... i>
void Dune::TypeTree::print_tree_path (std::ostream &os)
 
template<std::size_t... i>
std::ostream & Dune::TypeTree::operator<< (std::ostream &os, const TreePath< i...> &tp)
 
template<typename... T>
constexpr HybridTreePath< T...> Dune::TypeTree::hybridTreePath (const T &...t)
 Constructs a new HybridTreePath from the given indices. More...
 
template<typename... T>
constexpr std::size_t Dune::TypeTree::treePathSize (const HybridTreePath< T...> &)
 Returns the size (number of components) of the given HybridTreePath. More...
 
template<std::size_t i, typename... T>
auto Dune::TypeTree::treePathEntry (const HybridTreePath< T...> &tp, index_constant< i >={}) -> typename std::decay< decltype(std::get< i >(tp._data))>::type
 Returns a copy of the i-th element of the HybridTreePath. More...
 
template<std::size_t i, typename... T>
std::size_t Dune::TypeTree::treePathIndex (const HybridTreePath< T...> &tp, index_constant< i >={})
 Returns the index value of the i-th element of the HybridTreePath. More...
 
template<typename... T, typename std::enable_if<(sizeof...(T) > 0>
auto Dune::TypeTree::back (const HybridTreePath< T...> &tp) -> decltype(treePathEntry< treePathSize(tp)-1 >(tp))
 Returns a copy of the last element of the HybridTreePath. More...
 
template<typename... T, typename std::enable_if<(sizeof...(T) > 0>
std::size_t Dune::TypeTree::backIndex (const HybridTreePath< T...> &tp)
 Returns the index value of the last element of the HybridTreePath. More...
 
template<typename... T>
auto Dune::TypeTree::front (const HybridTreePath< T...> &tp) -> decltype(treePathEntry< 0 >(tp))
 Returns a copy of the first element of the HybridTreePath. More...
 
template<typename... T>
std::size_t Dune::TypeTree::frontIndex (const HybridTreePath< T...> &tp)
 Returns the index value of the first element of the HybridTreePath. More...
 
template<typename... T>
HybridTreePath< T..., std::size_t > Dune::TypeTree::push_back (const HybridTreePath< T...> &tp, std::size_t i)
 Appends a run time index to a HybridTreePath. More...
 
template<std::size_t i, typename... T>
HybridTreePath< T..., index_constant< i > > Dune::TypeTree::push_back (const HybridTreePath< T...> &tp, index_constant< i > i_={})
 Appends a compile time index to a HybridTreePath. More...
 
template<typename... T>
HybridTreePath< std::size_t, T...> Dune::TypeTree::push_front (const HybridTreePath< T...> &tp, std::size_t element)
 Prepends a run time index to a HybridTreePath. More...
 
template<std::size_t i, typename... T>
HybridTreePath< index_constant< i >, T...> Dune::TypeTree::push_front (const HybridTreePath< T...> &tp, index_constant< i > _i={})
 Prepends a compile time index to a HybridTreePath. More...
 
template<typename... T>
std::ostream & Dune::TypeTree::operator<< (std::ostream &os, const HybridTreePath< T...> &tp)
 Dumps a HybridTreePath to a stream. More...
 

Detailed Description

Enumeration Type Documentation

Enumerator
fullyStatic 
mostlyStatic 
dynamic 

Function Documentation

template<typename... T, typename std::enable_if<(sizeof...(T) > 0>
auto Dune::TypeTree::back ( const HybridTreePath< T...> &  tp) -> decltype(treePathEntry<treePathSize(tp)-1>(tp))

Returns a copy of the last element of the HybridTreePath.

As HybridTreePath instances should not be mutated after their creation, this function returns a copy of the value. As values are either std::integral_constant or std::size_t, that's just as cheap as returning a reference.

References Dune::TypeTree::treePathEntry(), and Dune::TypeTree::treePathSize().

template<typename... T, typename std::enable_if<(sizeof...(T) > 0>
std::size_t Dune::TypeTree::backIndex ( const HybridTreePath< T...> &  tp)

Returns the index value of the last element of the HybridTreePath.

References Dune::TypeTree::treePathEntry(), and Dune::TypeTree::treePathSize().

template<typename... T>
auto Dune::TypeTree::front ( const HybridTreePath< T...> &  tp) -> decltype(treePathEntry<0>(tp))

Returns a copy of the first element of the HybridTreePath.

As HybridTreePath instances should not be mutated after their creation, this function returns a copy of the value. As values are either std::integral_constant or std::size_t, that's just as cheap as returning a reference.

template<typename... T>
std::size_t Dune::TypeTree::frontIndex ( const HybridTreePath< T...> &  tp)

Returns the index value of the first element of the HybridTreePath.

template<typename... T>
constexpr HybridTreePath<T...> Dune::TypeTree::hybridTreePath ( const T &...  t)

Constructs a new HybridTreePath from the given indices.

This function returns a new HybridTreePath with the given index values. It exists mainly to avoid having to manually specify the exact type of the new object.

template<std::size_t... i>
std::ostream& Dune::TypeTree::operator<< ( std::ostream &  os,
const TreePath< i...> &  tp 
)
template<typename... T>
std::ostream& Dune::TypeTree::operator<< ( std::ostream &  os,
const HybridTreePath< T...> &  tp 
)

Dumps a HybridTreePath to a stream.

template<std::size_t... i>
void Dune::TypeTree::print_tree_path ( std::ostream &  os)
template<std::size_t k, std::size_t... i>
void Dune::TypeTree::print_tree_path ( std::ostream &  os)
template<typename... T>
HybridTreePath<T...,std::size_t> Dune::TypeTree::push_back ( const HybridTreePath< T...> &  tp,
std::size_t  i 
)

Appends a run time index to a HybridTreePath.

This function returns a new HybridTreePath with the run time index i appended.

template<std::size_t i, typename... T>
HybridTreePath<T...,index_constant<i> > Dune::TypeTree::push_back ( const HybridTreePath< T...> &  tp,
index_constant< i >  i_ = {} 
)

Appends a compile time index to a HybridTreePath.

This function returns a new HybridTreePath with the compile time index i appended.

The value for the new entry can be passed either as a template parameter or as an index_constant:

auto tp = hybridTreePath(1,2,3,4);
using namespace Dune::TypeTree::Indices;
// the following two lines are equivalent
auto tp_a = push_back<1>(tp);
auto tp_b = push_back(tp,_1);
template<typename... T>
HybridTreePath<std::size_t,T...> Dune::TypeTree::push_front ( const HybridTreePath< T...> &  tp,
std::size_t  element 
)

Prepends a run time index to a HybridTreePath.

This function returns a new HybridTreePath with the run time index i prepended.

template<std::size_t i, typename... T>
HybridTreePath<index_constant<i>,T...> Dune::TypeTree::push_front ( const HybridTreePath< T...> &  tp,
index_constant< i >  _i = {} 
)

Prepends a compile time index to a HybridTreePath.

This function returns a new HybridTreePath with the compile time index i prepended.

The value for the new entry can be passed either as a template parameter or as an index_constant:

auto tp = hybridTreePath(1,2,3,4);
using namespace Dune::TypeTree::Indices;
// the following two lines are equivalent
auto tp_a = push_front<1>(tp);
auto tp_b = push_front(tp,_1);
template<std::size_t i, typename... T>
auto Dune::TypeTree::treePathEntry ( const HybridTreePath< T...> &  tp,
index_constant< i >  = {} 
) -> typename std::decay<decltype(std::get<i>(tp._data))>::type

Returns a copy of the i-th element of the HybridTreePath.

As HybridTreePath instances should not be mutated after their creation, this function returns a copy of the value. As values are either std::integral_constant or std::size_t, that's just as cheap as returning a reference.

The index for the entry can be passed either as a template parameter or as an index_constant:

auto tp = hybridTreePath(1,2,3,4);
using namespace Dune::TypeTree::Indices;
// the following two lines are equivalent
std::cout << treePathEntry<2>(tp) << std::endl;
std::cout << treePathEntry(tp,_2) << std::endl;

Referenced by Dune::TypeTree::back(), and Dune::TypeTree::backIndex().

template<std::size_t i, typename... T>
std::size_t Dune::TypeTree::treePathIndex ( const HybridTreePath< T...> &  tp,
index_constant< i >  = {} 
)

Returns the index value of the i-th element of the HybridTreePath.

This function always returns the actual index value, irrespective of whether the entry is a compile time index or a run time index.

The index for the entry can be passed either as a template parameter or as an index_constant:

auto tp = hybridTreePath(1,2,3,4);
using namespace Dune::TypeTree::Indices;
// the following two lines are equivalent
std::cout << treePathIndex<2>(tp) << std::endl;
std::cout << treePathIndex(tp,_2) << std::endl;
template<std::size_t... i>
constexpr std::size_t Dune::TypeTree::treePathSize ( const TreePath< i...> &  )

Returns the size (number of components) of the given TreePath.

Referenced by Dune::TypeTree::back(), and Dune::TypeTree::backIndex().

template<typename... T>
constexpr std::size_t Dune::TypeTree::treePathSize ( const HybridTreePath< T...> &  )

Returns the size (number of components) of the given HybridTreePath.