Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Static Public Member Functions
mrpt::utils::TEnumType< ENUMTYPE > Struct Template Reference

Detailed Description

template<typename ENUMTYPE>
struct mrpt::utils::TEnumType< ENUMTYPE >

A helper class that can convert an enum value into its textual representation, and viceversa.

Definition at line 32 of file TEnumType.h.

#include <mrpt/utils/TEnumType.h>

Static Public Member Functions

static ENUMTYPE name2value (const std::string &name)
 Gives the numerical name for a given enum text name.
 
static std::string value2name (const ENUMTYPE val)
 Gives the textual name for a given enum value.
 
static bimap< ENUMTYPE, std::string > & getBimap ()
 Singleton access.
 

Member Function Documentation

◆ getBimap()

template<typename ENUMTYPE >
static bimap< ENUMTYPE, std::string > & mrpt::utils::TEnumType< ENUMTYPE >::getBimap ( )
inlinestatic

◆ name2value()

template<typename ENUMTYPE >
static ENUMTYPE mrpt::utils::TEnumType< ENUMTYPE >::name2value ( const std::string &  name)
inlinestatic

Gives the numerical name for a given enum text name.

Exceptions
std::exceptionon unknown enum name

Definition at line 35 of file TEnumType.h.

References empty(), mrpt::utils::TEnumTypeFiller< ENUMTYPE >::fill(), and mrpt::utils::TEnumType< ENUMTYPE >::getBimap().

Referenced by mrpt::utils::CConfigFileBase::read_enum().

◆ value2name()

template<typename ENUMTYPE >
static std::string mrpt::utils::TEnumType< ENUMTYPE >::value2name ( const ENUMTYPE  val)
inlinestatic

Gives the textual name for a given enum value.

Exceptions
std::exceptionon unknown enum value name

Definition at line 42 of file TEnumType.h.

References empty(), mrpt::utils::TEnumTypeFiller< ENUMTYPE >::fill(), and mrpt::utils::TEnumType< ENUMTYPE >::getBimap().




Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Wed Mar 22 06:31:24 UTC 2023