MRPT  1.9.9
mrpt::typemeta::TEnumType< ENUMTYPE > Struct Template Reference

Detailed Description

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

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

Examples:
typemeta_TEnumType/test.cpp.

Definition at line 24 of file config/CConfigFileBase.h.

#include <mrpt/config/CConfigFileBase.h>

Static Public Member Functions

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

Member Function Documentation

◆ getBimap()

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

Singleton access.

Definition at line 129 of file TEnumType.h.

Referenced by mrpt::typemeta::TEnumType< ENUMTYPE >::name2value(), and mrpt::typemeta::TEnumType< ENUMTYPE >::value2name().

Here is the caller graph for this function:

◆ name2value()

template<typename ENUMTYPE>
static ENUMTYPE mrpt::typemeta::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 100 of file TEnumType.h.

References _MRPT_AUXTOSTR, mrpt::typemeta::TEnumType< ENUMTYPE >::getBimap(), mrpt::pbmap::inverse(), and val.

Referenced by mrpt::apps::CGridMapAlignerApp::initialize(), mrpt::hwdrivers::CCameraSensor::initialize(), and mrpt::config::CConfigFileBase::read_enum().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ value2name()

template<typename ENUMTYPE>
static std::string mrpt::typemeta::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 115 of file TEnumType.h.

References _MRPT_AUXTOSTR, mrpt::typemeta::TEnumType< ENUMTYPE >::getBimap(), mrpt::to_string(), and val.

Here is the call graph for this function:



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: abb8b1a1e Fri Oct 18 14:19:12 2019 +0200 at vie oct 18 14:20:13 CEST 2019