Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
woops, align the 'noexcept' declaration between .hpp and .cpp
[simgrid.git] / include / xbt / ex.h
index a7ec2f8..d1e3fdf 100644 (file)
@@ -1,5 +1,3 @@
-/* ex - Exception Handling                                                  */
-
 /* Copyright (c) 2005-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
@@ -51,6 +49,7 @@
 #include <string>
 #include <vector>
 #include <stdexcept>
+#include <xbt/exception.hpp>
 #endif
 
 #include "xbt/base.h"
@@ -101,7 +100,9 @@ typedef enum {
 } xbt_errcat_t;
 
 #ifdef __cplusplus
-XBT_PUBLIC_CLASS xbt_ex : public std::runtime_error {
+XBT_PUBLIC_CLASS xbt_ex :
+  public std::runtime_error,
+  public simgrid::xbt::WithContextException {
 public:
   xbt_ex() : std::runtime_error("") {}
   xbt_ex(const char* message) : std::runtime_error(message) {}
@@ -109,15 +110,9 @@ public:
 
   xbt_errcat_t category;        /**< category like HTTP (what went wrong) */
   int value;                    /**< like errno (why did it went wrong) */
-  /* throw point */
-  std::string procname;         /**< Name of the process who thrown this */
-  int pid;                      /**< PID of the process who thrown this */
   const char *file;             /**< Thrown point */
   int line;                     /**< Thrown point */
   const char *func;             /**< Thrown point */
-  /* Backtrace */
-  std::vector<std::string>      bt_strings;
-  std::vector<void*>            bt;
 };
 #endif
 
@@ -149,17 +144,6 @@ XBT_PUBLIC(void) xbt_throw(char* message, xbt_errcat_t errcat, int value, const
 /** @brief The display made by an exception that is not catched */
 XBT_PUBLIC(void) xbt_ex_display(xbt_ex_t * e);
 
-/** @brief Shows a backtrace of the current location */
-XBT_PUBLIC(void) xbt_backtrace_display_current(void);
-/** @brief reimplementation of glibc backtrace based directly on gcc library, without implicit malloc  */
-XBT_PUBLIC(int) xbt_backtrace_no_malloc(void**bt, int size);
-/** @brief Captures a backtrace for further use */
-XBT_PUBLIC(void) xbt_backtrace_current(xbt_ex_t * e);
-/** @brief Display a previously captured backtrace */
-XBT_PUBLIC(void) xbt_backtrace_display(xbt_ex_t * e);
-/** @brief Get current backtrace with libunwind */
-XBT_PUBLIC(int) xbt_libunwind_backtrace(void *bt[XBT_BACKTRACE_SIZE], int size);
-
 SG_END_DECL()
 
 /** @} */