Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add new entry in Release_Notes.
[simgrid.git] / src / mc / mc_exit.hpp
index 273384b..234ea14 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2015-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -8,22 +8,22 @@
 #include "xbt/base.h"
 #include <exception>
 
-constexpr int SIMGRID_MC_EXIT_SUCCESS         = 0;
-constexpr int SIMGRID_MC_EXIT_SAFETY          = 1;
-constexpr int SIMGRID_MC_EXIT_LIVENESS        = 2;
-constexpr int SIMGRID_MC_EXIT_DEADLOCK        = 3;
-constexpr int SIMGRID_MC_EXIT_NON_TERMINATION = 4;
-constexpr int SIMGRID_MC_EXIT_NON_DETERMINISM = 5;
-constexpr int SIMGRID_MC_EXIT_PROGRAM_CRASH   = 6;
-
-constexpr int SIMGRID_MC_EXIT_ERROR           = 63;
-
 namespace simgrid::mc {
-class XBT_PUBLIC DeadlockError : public std::exception {
-};
-class XBT_PUBLIC TerminationError : public std::exception {
+
+enum class ExitStatus {
+  SUCCESS         = 0,
+  SAFETY          = 1,
+  LIVENESS        = 2,
+  DEADLOCK        = 3,
+  NON_TERMINATION = 4,
+  NON_DETERMINISM = 5,
+  PROGRAM_CRASH   = 6,
+  ERROR           = 63
 };
-class XBT_PUBLIC LivenessError : public std::exception {
+
+struct McError : public std::exception {
+  const ExitStatus value;
+  explicit McError(ExitStatus v = ExitStatus::ERROR) : value(v) {}
 };
 } // namespace simgrid::mc