Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename xbt::WithContextException into xbt::ContextedException
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 24 Aug 2018 20:37:46 +0000 (22:37 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 24 Aug 2018 20:40:30 +0000 (22:40 +0200)
include/simgrid/exception.hpp
include/xbt/exception.hpp
src/xbt/exception.cpp

index 32edcea..f363a2e 100644 (file)
@@ -58,7 +58,7 @@ class canceled_error : public simgrid::exception {
  *
  *  @ingroup XBT_ex_c
  */
  *
  *  @ingroup XBT_ex_c
  */
-class XBT_PUBLIC xbt_ex : public simgrid::exception, public simgrid::xbt::WithContextException {
+class XBT_PUBLIC xbt_ex : public simgrid::exception, public simgrid::xbt::ContextedException {
 public:
   xbt_ex() : simgrid::exception() {}
 
 public:
   xbt_ex() : simgrid::exception() {}
 
@@ -68,7 +68,7 @@ public:
    * @param message    Exception message
    */
   xbt_ex(simgrid::xbt::ThrowPoint throwpoint, const char* message)
    * @param message    Exception message
    */
   xbt_ex(simgrid::xbt::ThrowPoint throwpoint, const char* message)
-      : simgrid::exception(message), simgrid::xbt::WithContextException(throwpoint, simgrid::xbt::backtrace())
+      : simgrid::exception(message), simgrid::xbt::ContextedException(throwpoint, simgrid::xbt::backtrace())
   {
   }
 
   {
   }
 
index 65b0990..e214640 100644 (file)
@@ -59,19 +59,19 @@ class ThrowPoint {
  *  This is a base class for exceptions which store additional contextual
  *  information: backtrace, throw point, simulated process name, PID, etc.
  */
  *  This is a base class for exceptions which store additional contextual
  *  information: backtrace, throw point, simulated process name, PID, etc.
  */
-class XBT_PUBLIC WithContextException {
+class XBT_PUBLIC ContextedException {
 public:
 public:
-  WithContextException() :
+  ContextedException() :
     backtrace_(simgrid::xbt::backtrace()),
     procname_(xbt_procname()),
     pid_(xbt_getpid())
   {}
     backtrace_(simgrid::xbt::backtrace()),
     procname_(xbt_procname()),
     pid_(xbt_getpid())
   {}
-  explicit WithContextException(Backtrace bt) : backtrace_(std::move(bt)), procname_(xbt_procname()), pid_(xbt_getpid())
+  explicit ContextedException(Backtrace bt) : backtrace_(std::move(bt)), procname_(xbt_procname()), pid_(xbt_getpid())
   {}
   {}
-  explicit WithContextException(ThrowPoint throwpoint, Backtrace bt)
+  explicit ContextedException(ThrowPoint throwpoint, Backtrace bt)
       : backtrace_(std::move(bt)), procname_(xbt_procname()), pid_(xbt_getpid()), throwpoint_(throwpoint)
   {}
       : backtrace_(std::move(bt)), procname_(xbt_procname()), pid_(xbt_getpid()), throwpoint_(throwpoint)
   {}
-  virtual ~WithContextException();
+  virtual ~ContextedException();
   Backtrace const& backtrace() const
   {
     return backtrace_;
   Backtrace const& backtrace() const
   {
     return backtrace_;
index dbfd17f..b9503b6 100644 (file)
@@ -84,14 +84,14 @@ const char* xbt_ex_catname(xbt_errcat_t cat)
 namespace simgrid {
 namespace xbt {
 
 namespace simgrid {
 namespace xbt {
 
-WithContextException::~WithContextException() = default;
+ContextedException::~ContextedException() = default;
 
 void log_exception(e_xbt_log_priority_t prio, const char* context, std::exception const& exception)
 {
   try {
     auto name = simgrid::xbt::demangle(typeid(exception).name());
 
 
 void log_exception(e_xbt_log_priority_t prio, const char* context, std::exception const& exception)
 {
   try {
     auto name = simgrid::xbt::demangle(typeid(exception).name());
 
-    auto* with_context = dynamic_cast<const simgrid::xbt::WithContextException*>(&exception);
+    auto* with_context = dynamic_cast<const simgrid::xbt::ContextedException*>(&exception);
     if (with_context != nullptr)
       XBT_LOG(prio, "%s %s by %s/%d: %s", context, name.get(), with_context->process_name().c_str(),
               with_context->pid(), exception.what());
     if (with_context != nullptr)
       XBT_LOG(prio, "%s %s by %s/%d: %s", context, name.get(), with_context->process_name().c_str(),
               with_context->pid(), exception.what());