dune-common  2.11
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Dune::HybridMultiIndex< T > Class Template Reference

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. More...
 

Public Member Functions

constexpr HybridMultiIndex ()=default
 
constexpr HybridMultiIndex (const HybridMultiIndex &tp)=default
 
constexpr HybridMultiIndex (HybridMultiIndex &&tp)=default
 
constexpr HybridMultiIndexoperator= (const HybridMultiIndex &tp)=default
 
constexpr HybridMultiIndexoperator= (HybridMultiIndex &&tp)=default
 
constexpr HybridMultiIndex (std::tuple< T... > t)
 Constructor from a std::tuple More...
 
template<typename... I>
 requires ((sizeof...(T) > 0 &&sizeof...(I)==sizeof...(T)) and((std::is_integral_v< I > or Dune::IsIntegralConstant< I >::value) &&...)) explicit const expr HybridMultiIndex(I... i)
 Constructor from arguments. More...
 
template<std::size_t i>
 requires (sizeof...(T) > i) const expr auto get() const
 Get the index value at position pos. More...
 

Static Public Member Functions

static constexpr index_sequence enumerate ()
 Returns an index_sequence for enumerating the components of this HybridMultiIndex. More...
 
static constexpr std::size_t size ()
 Get the size (length) of this multi-index. More...
 
static constexpr std::size_t max_size ()
 Get the size (length) of this multi-index. More...
 

Public Attributes

template<std::size_t i>
requires(sizeof...(T) > i) const expr auto operator[](Dune std::tuple< T... > _data
 Get the index value at position pos. More...
 

Detailed Description

template<typename... T>
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

template<typename... T>
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/4]

template<typename... T>
constexpr Dune::HybridMultiIndex< T >::HybridMultiIndex ( )
default

◆ HybridMultiIndex() [2/4]

template<typename... T>
constexpr Dune::HybridMultiIndex< T >::HybridMultiIndex ( const HybridMultiIndex< T > &  tp)
default

◆ HybridMultiIndex() [3/4]

template<typename... T>
constexpr Dune::HybridMultiIndex< T >::HybridMultiIndex ( HybridMultiIndex< T > &&  tp)
default

◆ HybridMultiIndex() [4/4]

template<typename... T>
constexpr Dune::HybridMultiIndex< T >::HybridMultiIndex ( std::tuple< T... >  t)
inlineexplicit

Constructor from a std::tuple

Member Function Documentation

◆ enumerate()

template<typename... T>
static constexpr index_sequence Dune::HybridMultiIndex< T >::enumerate ( )
inlinestatic

Returns an index_sequence for enumerating the components of this HybridMultiIndex.

◆ max_size()

template<typename... T>
static constexpr std::size_t Dune::HybridMultiIndex< T >::max_size ( )
inlinestatic

Get the size (length) of this multi-index.

◆ operator=() [1/2]

template<typename... T>
constexpr HybridMultiIndex& Dune::HybridMultiIndex< T >::operator= ( const HybridMultiIndex< T > &  tp)
default

◆ operator=() [2/2]

template<typename... T>
constexpr HybridMultiIndex& Dune::HybridMultiIndex< T >::operator= ( HybridMultiIndex< T > &&  tp)
default

◆ requires() [1/2]

template<typename... T>
template<typename... I>
Dune::HybridMultiIndex< T >::requires ( (sizeof...(T) > 0 &&sizeof...(I)==sizeof...(T)) and((std::is_integral_v< I > or Dune::IsIntegralConstant< I >::value) &&...)  ) const
inline

Constructor from arguments.

◆ requires() [2/2]

template<typename... T>
template<std::size_t i>
Dune::HybridMultiIndex< T >::requires ( sizeof...  T,
i   
) const
inline

Get the index value at position pos.

The get member function is required by the std-tuple-protocol which e.g. enables structured bindings.

◆ size()

template<typename... T>
static constexpr std::size_t Dune::HybridMultiIndex< T >::size ( )
inlinestatic

Get the size (length) of this multi-index.

Member Data Documentation

◆ _data

template<typename... T>
template<std::size_t i>
requires (sizeof...(T) > i) const expr auto operator[](Dune std::tuple<T...> Dune::HybridMultiIndex< T >::_data

Get the index value at position pos.


The documentation for this class was generated from the following file: