Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
ExtendSettingEnumWithSelectionField.h
Go to the documentation of this file.
1#pragma once
2
4
5#define ExtendEnumsWithSelectionField(NAME, ...) \
6 enum class NAME : int { __VA_ARGS__ }; \
7 enum class NAME##Selection : int{__VA_ARGS__, FROMSETTINGS}; \
8 std::string toString(NAME); \
9 inline NAME convert(NAME##Selection e) { \
10 STORM_LOG_ASSERT(e != NAME##Selection::FROMSETTINGS, "Unexpected conversion of engine."); \
11 return static_cast<NAME>(e); \
12 } \
13 inline std::string toString(NAME##Selection e) { \
14 if (e == NAME##Selection::FROMSETTINGS) { \
15 return "[from settings]"; \
16 } else { \
17 return toString(convert(e)); \
18 } \
19 }