Index< CategoryTag > Class Template Reference

CPP API: mio::Index< CategoryTag > Class Template Reference

An Index with more than one template parameter combines several Index objects. More...

#include <index.h>

Public Member Functions

 Index (Index< CategoryTag > const &... _indices)
 Constructor from individual Indices. More...
 
bool operator!= (Index const &other) const
 
bool operator< (Index const &other) const
 
bool operator<= (Index const &other) const
 
bool operator== (Index const &other) const
 
template<class... IndexArgs>
 requires (sizeof...(IndexArgs) > 1) Index(IndexArgs &&... subindices)
 Constructor from mixed Indices and MultiIndices. More...
 
template<class IOContext >
void serialize (IOContext &io) const
 serialize this. More...
 

Static Public Member Functions

template<class IOContext >
static IOResult< Indexdeserialize (IOContext &io)
 deserialize an object of this class. More...
 
static constexpr Index Zero ()
 Construct an Index filled with zeroes. More...
 

Public Attributes

std::tuple< Index< CategoryTag >... > indices
 

Static Public Attributes

static constexpr bool has_duplicates = has_duplicates_v<CategoryTag...>
 
static constexpr size_t size = sizeof...(CategoryTag)
 

Private Member Functions

 Index (const std::tuple< Index< CategoryTag >... > &_indices)
 Internal constructor from a tuple. More...
 

Detailed Description

template<typename... CategoryTag>
class mio::Index< CategoryTag >

An Index with more than one template parameter combines several Index objects.

It is used to index into a multidimensional CustomIndexArray

Template Parameters
CategoryTagVariadic template parameter for the Tags used in the MultiIndex

Constructor & Destructor Documentation

◆ Index() [1/2]

template<typename... CategoryTag>
mio::Index< CategoryTag >::Index ( Index< CategoryTag > const &...  _indices)
inline

Constructor from individual Indices.

◆ Index() [2/2]

template<typename... CategoryTag>
mio::Index< CategoryTag >::Index ( const std::tuple< Index< CategoryTag >... > &  _indices)
inlineprivate

Internal constructor from a tuple.

Member Function Documentation

◆ deserialize()

template<typename... CategoryTag>
template<class IOContext >
static IOResult<Index> mio::Index< CategoryTag >::deserialize ( IOContext &  io)
inlinestatic

deserialize an object of this class.

See also
mio::deserialize

◆ operator!=()

template<typename... CategoryTag>
bool mio::Index< CategoryTag >::operator!= ( Index< CategoryTag > const &  other) const
inline

◆ operator<()

template<typename... CategoryTag>
bool mio::Index< CategoryTag >::operator< ( Index< CategoryTag > const &  other) const
inline

◆ operator<=()

template<typename... CategoryTag>
bool mio::Index< CategoryTag >::operator<= ( Index< CategoryTag > const &  other) const
inline

◆ operator==()

template<typename... CategoryTag>
bool mio::Index< CategoryTag >::operator== ( Index< CategoryTag > const &  other) const
inline

◆ requires()

template<typename... CategoryTag>
template<class... IndexArgs>
mio::Index< CategoryTag >::requires ( sizeof...  IndexArgs,
 
) &&
inline

Constructor from mixed Indices and MultiIndices.

◆ serialize()

template<typename... CategoryTag>
template<class IOContext >
void mio::Index< CategoryTag >::serialize ( IOContext &  io) const
inline

serialize this.

See also
mio::serialize

◆ Zero()

template<typename... CategoryTag>
static constexpr Index mio::Index< CategoryTag >::Zero ( )
inlinestaticconstexpr

Construct an Index filled with zeroes.

Member Data Documentation

◆ has_duplicates

template<typename... CategoryTag>
constexpr bool mio::Index< CategoryTag >::has_duplicates = has_duplicates_v<CategoryTag...>
staticconstexpr

◆ indices

template<typename... CategoryTag>
std::tuple<Index<CategoryTag>...> mio::Index< CategoryTag >::indices

◆ size

template<typename... CategoryTag>
constexpr size_t mio::Index< CategoryTag >::size = sizeof...(CategoryTag)
staticconstexpr