const boost::bimap<NAME, std::string> NAME##Map \
= boost::assign::list_of<boost::bimap<NAME, std::string>::relation> \
BOOST_PP_SEQ_FOR_EACH( \
NAME, \
auto it = NAME##Map.left.find(v); \
if ( it == NAME##Map.left.end() ) \
" is not a valid value for enumeration "#NAME) \
return it->second; \
} \
NAME to##NAME(const std::string& v) { \
auto it = NAME##Map.right.find(v); \
if ( it == NAME##Map.right.end() ) \
" is not a valid value for enumeration "#NAME) \
return it->second; \
}
#define MIRA_HUMANREADABLE_ENUM_MAP_ITEM(R, NAME, VALUE)
Definition: HumanReadableEnum.h:88
#define MIRA_THROW(ex, msg)
Macro for throwing an exception.
Definition: Exception.h:82
std::string toString(const T &value, int precision=-1)
Converts any data type to string (the data type must support the stream << operator).
Definition: ToString.h:256
#define MIRA_VARIADIC_SIZE(...)
Definition: VariadicMacro.h:96