|
dune-common 2.12-git
|
A hybrid multi-index class that supports both compile time and run time indices. More...
#include <dune/common/hybridmultiindex.hh>
Public Types | |
| using | index_sequence = std::index_sequence_for< T... > |
An index_sequence for the entries in this HybridMultiIndex. | |
Public Member Functions | |
| constexpr | HybridMultiIndex ()=default |
| constexpr | HybridMultiIndex (const HybridMultiIndex &tp)=default |
| constexpr | HybridMultiIndex (HybridMultiIndex &&tp)=default |
| constexpr HybridMultiIndex & | operator= (const HybridMultiIndex &tp)=default |
| constexpr HybridMultiIndex & | operator= (HybridMultiIndex &&tp)=default |
| constexpr | HybridMultiIndex (std::tuple< T... > t) |
Constructor from a std::tuple | |
| template<typename... I> requires ((sizeof...(T) > 0 && sizeof...(I) == sizeof...(T)) and ((std::is_integral_v<I> or Dune::IsIntegralConstant<I>::value) && ...)) | |
| constexpr | HybridMultiIndex (I... i) |
| Constructor from arguments. | |
| template<std::size_t i> requires (sizeof...(T) > i) | |
| constexpr auto | get () const |
| Get the index value at position pos. | |
| template<std::size_t i> requires (sizeof...(T) > i) | |
| constexpr auto | operator[] (Dune::index_constant< i >) const |
| Get the index value at position pos. | |
| constexpr std::size_t | operator[] (std::size_t pos) const |
| Get the index value at position pos. | |
| template<std::size_t n = sizeof...(T)> requires (n > 0 && n == sizeof...(T)) | |
| constexpr auto | front () const |
| Get the first index value. Only available in non-empty multi-indices. | |
| template<std::size_t n = sizeof...(T)> requires (n > 0 && n == sizeof...(T)) | |
| constexpr auto | back () const |
| Get the last index value. Only available in non-empty multi-indices. | |
Static Public Member Functions | |
| static constexpr index_sequence | enumerate () |
| Returns an index_sequence for enumerating the components of this HybridMultiIndex. | |
| static constexpr std::size_t | size () |
| Get the size (length) of this multi-index. | |
| static constexpr std::size_t | max_size () |
| Get the size (length) of this multi-index. | |
Friends | |
| template<class... Head, class... Other> | |
| constexpr auto | join (const HybridMultiIndex< Head... > &, const Other &...) |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<typename... T> | |
| constexpr auto | back (const HybridMultiIndex< T... > &tp) -> decltype(tp.back()) |
Returns a copy of the last element of the HybridMultiIndex. | |
| template<typename... T> | |
| constexpr auto | front (const HybridMultiIndex< T... > &tp) -> decltype(tp.front()) |
Returns a copy of the first element of the HybridMultiIndex. | |
| template<typename... T> | |
| constexpr HybridMultiIndex< T..., std::size_t > | push_back (const HybridMultiIndex< T... > &tp, std::size_t i) |
Appends a run time index to a HybridMultiIndex. | |
| template<std::size_t i, typename... T> | |
| constexpr HybridMultiIndex< T..., index_constant< i > > | push_back (const HybridMultiIndex< T... > &tp, index_constant< i > iConstant={}) |
Appends a compile time index to a HybridMultiIndex. | |
| template<typename... T> | |
| constexpr HybridMultiIndex< std::size_t, T... > | push_front (const HybridMultiIndex< T... > &tp, std::size_t i) |
Prepends a run time index to a HybridMultiIndex. | |
| template<std::size_t i, typename... T> | |
| constexpr HybridMultiIndex< index_constant< i >, T... > | push_front (const HybridMultiIndex< T... > &tp, index_constant< i > iConstant={}) |
Prepends a compile time index to a HybridMultiIndex. | |
| template<typename I , typename... T> | |
| constexpr auto | accumulate_back (const HybridMultiIndex< T... > &tp, I i) |
| Hybrid utility that accumulates to the back of a multi-index. | |
| template<typename I , typename... T> | |
| constexpr auto | accumulate_front (const HybridMultiIndex< T... > &tp, I i) |
| Hybrid utility that accumulates to the front of a multi-index. | |
| template<class... Head, class... Other> | |
| constexpr auto | join (const HybridMultiIndex< Head... > &head, const Other &... tail) |
| Join two hybrid multi-indices into one. | |
| template<class... T> | |
| constexpr auto | reverse (const HybridMultiIndex< T... > &tp) |
| Reverses the order of the elements in the multi-index. | |
| template<class... T> | |
| constexpr auto | pop_front (const HybridMultiIndex< T... > &tp) |
Removes first index on a HybridMultiIndex. | |
| template<class... T> | |
| constexpr auto | pop_back (const HybridMultiIndex< T... > &tp) |
Removes last index on a HybridMultiIndex. | |
| template<class... S, class... T> | |
| constexpr bool | operator== (const HybridMultiIndex< S... > &lhs, const HybridMultiIndex< T... > &rhs) |
Compare two HybridMultiIndexs for value equality. | |
| template<class S , S... lhs, class T , T... rhs> | |
| constexpr auto | operator== (const HybridMultiIndex< std::integral_constant< S, lhs >... > &, const HybridMultiIndex< std::integral_constant< T, rhs >... > &) |
Overload for purely static HybridMultiIndexs. | |
| template<class... S, class... T> | |
| constexpr auto | operator!= (const HybridMultiIndex< S... > &lhs, const HybridMultiIndex< T... > &rhs) |
Compare two HybridMultiIndexs for inequality. | |
| template<class S , S... lhs, class T , T... rhs> | |
| constexpr auto | operator!= (const HybridMultiIndex< std::integral_constant< S, lhs >... > &, const HybridMultiIndex< std::integral_constant< T, rhs >... > &) |
Compare two static HybridMultiIndexs for inequality. | |
| template<typename... T> | |
| std::ostream & | operator<< (std::ostream &os, const HybridMultiIndex< T... > &tp) |
Dumps a HybridMultiIndex to a stream. | |
Detailed Description
class Dune::HybridMultiIndex< T >
A hybrid multi-index class that supports both compile time and run time indices.
A HybridMultiIndex supports storing a combination of run time and compile time indices. This allows to construct multi-indices that provide sufficient information for accessing nested multi-type containers.
- Note
- Internally all indices are stored as std::size_t or std::integral_constant<std::size_t,v>. The latter is the same as Dune::index_constant<v>.
Member Typedef Documentation
◆ index_sequence
| using Dune::HybridMultiIndex< T >::index_sequence = std::index_sequence_for<T...> |
An index_sequence for the entries in this HybridMultiIndex.
Constructor & Destructor Documentation
◆ HybridMultiIndex() [1/5]
|
constexprdefault |
◆ HybridMultiIndex() [2/5]
|
constexprdefault |
◆ HybridMultiIndex() [3/5]
|
constexprdefault |
◆ HybridMultiIndex() [4/5]
|
inlineexplicitconstexpr |
Constructor from a std::tuple
◆ HybridMultiIndex() [5/5]
requires ((sizeof...(T) > 0 && sizeof...(I) == sizeof...(T)) and ((std::is_integral_v<I> or Dune::IsIntegralConstant<I>::value) && ...))
|
inlineexplicitconstexpr |
Constructor from arguments.
Member Function Documentation
◆ back()
requires (n > 0 && n == sizeof...(T))
|
inlineconstexpr |
Get the last index value. Only available in non-empty multi-indices.
◆ enumerate()
|
inlinestaticconstexpr |
Returns an index_sequence for enumerating the components of this HybridMultiIndex.
◆ front()
requires (n > 0 && n == sizeof...(T))
|
inlineconstexpr |
Get the first index value. Only available in non-empty multi-indices.
◆ get()
requires (sizeof...(T) > i)
|
inlineconstexpr |
Get the index value at position pos.
The get member function is required by the std-tuple-protocol which e.g. enables structured bindings.
◆ max_size()
|
inlinestaticconstexpr |
Get the size (length) of this multi-index.
◆ operator=() [1/2]
|
constexprdefault |
◆ operator=() [2/2]
|
constexprdefault |
◆ operator[]() [1/2]
requires (sizeof...(T) > i)
|
inlineconstexpr |
Get the index value at position pos.
◆ operator[]() [2/2]
|
inlineconstexpr |
Get the index value at position pos.
◆ size()
|
inlinestaticconstexpr |
Get the size (length) of this multi-index.
Friends And Related Symbol Documentation
◆ join
|
friend |
The documentation for this class was generated from the following file:
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8