A mapper from emums to string values. - usefull for names flags. More...
#include <mia/core/dictmap.hh>
Data Structures | |
struct | Table |
Public Types | |
typedef std::map< T, std::pair< std::string, std::string > > | THelpMap |
Public Member Functions | |
const char * | get_help (T value) const |
THelpMap::const_iterator | get_help_begin () const |
THelpMap::const_iterator | get_help_end () const |
const char * | get_name (T value) const |
const std::set< std::string > | get_name_set () const |
T | get_value (const char *name) const |
TDictMap (const Table *table, bool last_is_default=false) | |
A mapper from emums to string values. - usefull for names flags.
Definition at line 45 of file dictmap.hh.
typedef std::map<T, std::pair<std::string, std::string> > TDictMap< T >::THelpMap |
This map is used to reference the help strings
Definition at line 50 of file dictmap.hh.
Create the map by providing an initialisation map
table | the initialisation table, needs to be terminated by a {NULL, some_value} pair. |
last_is_default | true if the value provided with the NULL name is the default return value if unknown names are given. If false, an unknown name in get_value() will throw std::invalid_argument exception. |
Definition at line 131 of file dictmap.hh.
const char * TDictMap< T >::get_help | ( | T | value | ) | const |
value |
Definition at line 178 of file dictmap.hh.
TDictMap< T >::THelpMap::const_iterator TDictMap< T >::get_help_begin | ( | ) | const |
Definition at line 195 of file dictmap.hh.
Definition at line 201 of file dictmap.hh.
const char * TDictMap< T >::get_name | ( | T | value | ) | const |
value |
Definition at line 164 of file dictmap.hh.
const std::set< std::string > TDictMap< T >::get_name_set | ( | ) | const |
Definition at line 187 of file dictmap.hh.
T TDictMap< T >::get_value | ( | const char * | name | ) | const |
name |
Definition at line 150 of file dictmap.hh.