21 template <
typename KEY,
typename VALUE>
30 bool direct(
const KEY& k, VALUE& out_v)
const 32 auto i =
m_k2v.find(k);
33 if (i ==
m_k2v.end())
return false;
37 bool inverse(
const VALUE& v, KEY& out_k)
const 39 auto i =
m_v2k.find(v);
40 if (i ==
m_v2k.end())
return false;
44 void insert(
const KEY& k,
const VALUE& v)
56 template <
typename ENUMTYPE>
62 #define MRPT_ENUM_TYPE_BEGIN(_ENUM_TYPE_WITH_NS) \ 68 struct TEnumTypeFiller<_ENUM_TYPE_WITH_NS> \ 71 mrpt::typemeta::internal::bimap<_ENUM_TYPE_WITH_NS, std::string>& \ 74 #define MRPT_ENUM_TYPE_BEGIN_NAMESPACE(_NAMESPACE, _ENUM_TYPE_WITH_NS) \ 75 MRPT_ENUM_TYPE_BEGIN(_ENUM_TYPE_WITH_NS) \ 76 using namespace _NAMESPACE; 78 #define MRPT_ENUM_TYPE_END() \ 86 #define MRPT_FILL_ENUM(_X) m_map.insert(_X, #_X) 87 #define MRPT_FILL_ENUM_CUSTOM_NAME(_X, _NAME) m_map.insert(_X, _NAME) 88 #define MRPT_FILL_ENUM_MEMBER(_CLASS, _VALUE) \ 89 m_map.insert(_CLASS::_VALUE, #_VALUE) 93 template <
typename ENUMTYPE>
96 #define _MRPT_AUXTOSTR(__AA) #__AA 105 throw std::runtime_error(
107 TEnumType)
">::name2value(): Unknown name: ") +
120 throw std::runtime_error(
122 TEnumType)
">::value2name(): Unknown value: ") +
135 #undef _MRPT_AUXTOSTR
#define _MRPT_AUXTOSTR(__AA)
std::string to_string(T v)
Just like std::to_string(), but with an overloaded version for std::string arguments.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
static struct FontData data