OpFlex Framework  1.7.0
opflex::modb::EnumInfo Class Reference

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...
 

Detailed Description

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.

Member Function Documentation

◆ getConsts()

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

◆ getIdByName()

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_rangeif the name does not exist

◆ getName()

const std::string& opflex::modb::EnumInfo::getName ( ) const
inline

Get the name of the enum.

Returns
the enum name

◆ getNameById()

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_rangeif the ID does not exist

The documentation for this class was generated from the following file: