Our poor man's implementation of enum reflection. This is a necessary ingredient for bridging runtime string parsed from input files and static enum types.
For developers, this class shall only be used for parsing purposes during the setup phase. Avoid directly working with this class at model evaluation phase at all cost!
|
| | EnumSelectionBase ()=default |
| |
| | EnumSelectionBase (const std::vector< std::string > &choices) |
| | Create an enum selection from a list of choices.
|
| |
| | EnumSelectionBase (const std::vector< std::string > &choices, const std::vector< int > &values) |
| | Create an enum selection from a list of choices and their corresponding values.
|
| |
| const std::unordered_map< std::string, int > & | choices () const |
| | Choices.
|
| |
| std::string | join (const std::string &separator=", ") const |
| | Join the choices into a single string with the given separator.
|
| |