46 #define EXIT_OUTCOME_SUCCESS EXIT_SUCCESS
47 #define EXIT_OUTCOME_UNKNOWN EXIT_FAILURE
48 #define EXIT_OUTCOME_NOSTART 4
49 #define EXIT_OUTCOME_STOPPED 8
50 #define EXIT_OUTCOME_FAILURE 9
51 #define EXIT_OUTCOME_ABORTED 16
55 {SimulationOutcome::Aborted,
"aborted"},
56 {SimulationOutcome::NoStart,
"no-start"},
57 {SimulationOutcome::Failure,
"failure"},
58 {SimulationOutcome::Success,
"success"},
59 {SimulationOutcome::Stopped,
"stopped"},
60 {SimulationOutcome::Probing,
"probing"},
64 inline
int as_exit_code(SimulationOutcome outcome,
bool require_success = true) {
66 case SimulationOutcome::Success:
67 return EXIT_OUTCOME_SUCCESS;
68 case SimulationOutcome::Stopped:
69 return (require_success ? EXIT_OUTCOME_STOPPED : EXIT_OUTCOME_SUCCESS);
70 case SimulationOutcome::Aborted:
71 return EXIT_OUTCOME_ABORTED;
72 case SimulationOutcome::NoStart:
73 return EXIT_OUTCOME_NOSTART;
74 case SimulationOutcome::Failure:
75 return EXIT_OUTCOME_FAILURE;
76 case SimulationOutcome::Probing:
77 return EXIT_OUTCOME_SUCCESS;
79 return EXIT_OUTCOME_UNKNOWN;
#define ENUM_SERIALIZATION(xType, xMap)
Definition: enum.hpp:51
SimulationOutcome
Definition: simulation_outcome.hpp:33
@ Success
Simulation explicitly concluded with success.
@ Aborted
Simulation aborted due to technical problems or interrupt.
@ Stopped
Simulation concluded, but without valuation.
@ Probing
Simulation started briefly to gather specific information.
@ Failure
Simulation explicitly concluded with failure.
@ NoStart
Simulation unable to start.