dune-functions  2.7.1
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Dune::Functions::FlatMultiIndex< size_type > Class Template Reference

A multi-index class with only one level. More...

#include <dune/functions/functionspacebases/flatmultiindex.hh>

Inheritance diagram for Dune::Functions::FlatMultiIndex< size_type >:
Inheritance graph

Public Member Functions

constexpr FlatMultiIndex ()=default
 
 FlatMultiIndex (std::initializer_list< size_type > const &l)
 Construct from initializer_list. More...
 
 operator const size_type & () const
 Const cast of multi-index to first entry. More...
 
 operator size_type & ()
 Non-const cast of multi-index to first entry. More...
 

Static Public Member Functions

static constexpr std::size_t max_size ()
 

Public Attributes

elements
 STL member. More...
 

Detailed Description

template<class size_type>
class Dune::Functions::FlatMultiIndex< size_type >

A multi-index class with only one level.

This class provides a multi-index interface in the sense that it has operator[] access to individual interfaces. However, since it only supports flat indices of exactly one level, it also has a cast of the multi-index to this index. This is obtianed by deriving from std::array<size_type,1> and adding this cast. Hence multi-indices of type FlatMultiIndex can be used like classic indices.

Constructor & Destructor Documentation

◆ FlatMultiIndex() [1/2]

template<class size_type >
constexpr Dune::Functions::FlatMultiIndex< size_type >::FlatMultiIndex ( )
constexprdefault

◆ FlatMultiIndex() [2/2]

template<class size_type >
Dune::Functions::FlatMultiIndex< size_type >::FlatMultiIndex ( std::initializer_list< size_type > const &  l)
inline

Construct from initializer_list.

This is needed because std::array does not have a constructor from initializer list. Instead the list initialization of an std::array is an aggregate initialization and hence not visible in the derived class.

Member Function Documentation

◆ max_size()

template<class size_type >
static constexpr std::size_t Dune::Functions::FlatMultiIndex< size_type >::max_size ( )
inlinestaticconstexpr

◆ operator const size_type &()

template<class size_type >
Dune::Functions::FlatMultiIndex< size_type >::operator const size_type & ( ) const
inline

Const cast of multi-index to first entry.

Returns
The first (and only) index of this multi-index

◆ operator size_type &()

template<class size_type >
Dune::Functions::FlatMultiIndex< size_type >::operator size_type & ( )
inline

Non-const cast of multi-index to first entry.

Returns
The first (and only) index of this multi-index

Member Data Documentation

◆ elements

T std::array< T >::elements
inherited

STL member.


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