SPH
Public Member Functions | Public Attributes | Friends | List of all members
EnumWrapper Struct Reference

Wrapper of an enum. More...

#include <Settings.h>

Public Member Functions

 EnumWrapper ()=default
 
template<typename TEnum >
 EnumWrapper (TEnum e)
 
 EnumWrapper (const int value, const EnumIndex &index)
 
 operator int () const
 
template<typename T , typename = std::enable_if_t<std::is_enum<T>::value>>
 operator T () const
 
bool operator== (const EnumWrapper &other) const
 

Public Attributes

int value
 
EnumIndex index
 

Friends

std::ostream & operator<< (std::ostream &ofs, const EnumWrapper &e)
 

Detailed Description

Wrapper of an enum.

Used to store an enum in settings while keeping the type safety.

Definition at line 37 of file Settings.h.

Constructor & Destructor Documentation

◆ EnumWrapper() [1/3]

EnumWrapper::EnumWrapper ( )
default

◆ EnumWrapper() [2/3]

template<typename TEnum >
EnumWrapper::EnumWrapper ( TEnum  e)
inlineexplicit

Definition at line 45 of file Settings.h.

◆ EnumWrapper() [3/3]

EnumWrapper::EnumWrapper ( const int  value,
const EnumIndex index 
)
inline

Definition at line 51 of file Settings.h.

Member Function Documentation

◆ operator int()

EnumWrapper::operator int ( ) const
inlineexplicit

Definition at line 55 of file Settings.h.

◆ operator T()

template<typename T , typename = std::enable_if_t<std::is_enum<T>::value>>
EnumWrapper::operator T ( ) const
inlineexplicit

Definition at line 60 of file Settings.h.

◆ operator==()

bool EnumWrapper::operator== ( const EnumWrapper other) const
inline

Definition at line 65 of file Settings.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  ofs,
const EnumWrapper e 
)
friend

Definition at line 69 of file Settings.h.

Member Data Documentation

◆ index

EnumIndex EnumWrapper::index

Definition at line 40 of file Settings.h.

◆ value

int EnumWrapper::value

Definition at line 38 of file Settings.h.


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