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>
|
| 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.
const std::vector<ConstInfo>& opflex::modb::EnumInfo::getConsts |
( |
| ) |
const |
|
inline |
Get the vector of possible const values for the enum.
- Returns
- the vector of possible const values
const uint64_t opflex::modb::EnumInfo::getIdByName |
( |
const std::string & |
name | ) |
const |
Get the constant value by the enum name.
- Returns
- The integer enum value
- Exceptions
-
std::out_of_range | if the name does not exist |
const std::string& opflex::modb::EnumInfo::getName |
( |
| ) |
const |
|
inline |
Get the name of the enum.
- Returns
- the enum name
const std::string& opflex::modb::EnumInfo::getNameById |
( |
uint64_t |
id | ) |
const |
Get the enum constant name by the enum value.
- Returns
- the string name
- Exceptions
-
std::out_of_range | if the ID does not exist |
The documentation for this class was generated from the following file: