Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Core::Utils::EnumConverter< EnumBaseType > Class Template Reference

This class manage the bijective association between string and integral representation of an enumeration. More...

#include <Core/Utils/EnumConverter.hpp>

+ Collaboration diagram for Ra::Core::Utils::EnumConverter< EnumBaseType >:

Public Member Functions

 EnumConverter (std::initializer_list< std::pair< EnumBaseType, std::string > > pairs)
 
std::string getEnumerator (EnumBaseType v) const
 
EnumBaseType getEnumerator (const std::string &v) const
 
std::vector< std::stringgetEnumerators () const
 

Detailed Description

template<typename EnumBaseType>
class Ra::Core::Utils::EnumConverter< EnumBaseType >

This class manage the bijective association between string and integral representation of an enumeration.

Template Parameters
EnumBaseTypethe underlying type (as returned by typename std::underlying_type_t<Enum>) of the enumeration to manage.

Definition at line 24 of file EnumConverter.hpp.

Constructor & Destructor Documentation

◆ EnumConverter()

template<typename EnumBaseType >
Ra::Core::Utils::EnumConverter< EnumBaseType >::EnumConverter ( std::initializer_list< std::pair< EnumBaseType, std::string > > pairs)
explicit
Todo
think of manage both EnumType and EnumUnderlyingType Eg using EnumUnderlyingType = std::underling_type_t<Enum>; getEnumeratorUnderlying ->EnumUnderlyingType getEnumerator -> Enum

Definition at line 46 of file EnumConverter.hpp.

Member Function Documentation

◆ getEnumerator() [1/2]

template<typename EnumBaseType >
EnumBaseType Ra::Core::Utils::EnumConverter< EnumBaseType >::getEnumerator ( const std::string & v) const

Definition at line 56 of file EnumConverter.hpp.

◆ getEnumerator() [2/2]

template<typename EnumBaseType >
std::string Ra::Core::Utils::EnumConverter< EnumBaseType >::getEnumerator ( EnumBaseType v) const

Definition at line 51 of file EnumConverter.hpp.

◆ getEnumerators()

template<typename EnumBaseType >
std::vector< std::string > Ra::Core::Utils::EnumConverter< EnumBaseType >::getEnumerators ( ) const

Definition at line 61 of file EnumConverter.hpp.


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