|
OpFlex Framework
1.7.0
|
Enum info defines the set of possible values for an enum as well as the properties current defined by it. More...
#include <opflex/modb/EnumInfo.h>
Public Member Functions | |
| EnumInfo () | |
| Default constructor. | |
| EnumInfo (const std::string &name_, const std::vector< ConstInfo > &consts_) | |
| Construct an enum info with the given name and consts. | |
| ~EnumInfo () | |
| Destructor. | |
| const std::string & | getName () const |
| Get the name of the enum. More... | |
| const std::vector< ConstInfo > & | getConsts () const |
| Get the vector of possible const values for the enum. More... | |
| const uint64_t | getIdByName (const std::string &name) const |
| Get the constant value by the enum name. More... | |
| const std::string & | getNameById (uint64_t id) const |
| Get the enum constant name by the enum value. More... | |
Enum info defines the set of possible values for an enum as well as the properties current defined by it.
This metadata is generated by the code generation framework and is required when the framework is initialized.
|
inline |
Get the vector of possible const values for the enum.
References getIdByName(), and getNameById().
| const uint64_t opflex::modb::EnumInfo::getIdByName | ( | const std::string & | name | ) | const |
Get the constant value by the enum name.
| std::out_of_range | if the name does not exist |
Referenced by getConsts().
|
inline |
Get the name of the enum.
| const std::string& opflex::modb::EnumInfo::getNameById | ( | uint64_t | id | ) | const |
Get the enum constant name by the enum value.
| std::out_of_range | if the ID does not exist |
Referenced by getConsts().