Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake_case xbt/exception.hpp
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 16 Jun 2018 13:29:20 +0000 (15:29 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 16 Jun 2018 13:29:35 +0000 (15:29 +0200)
include/xbt/exception.hpp
src/xbt/cunit.cpp
src/xbt/exception.cpp

index 8fa032d..544f6ae 100644 (file)
@@ -83,8 +83,19 @@ public:
     return backtrace_;
   }
   int pid() const { return pid_; }
     return backtrace_;
   }
   int pid() const { return pid_; }
-  std::string const& processName() const { return procname_; }
-  ThrowPoint& throwPoint() { return throwpoint_; }
+  std::string const& process_name() const { return procname_; }
+  ThrowPoint& throw_point() { return throwpoint_; }
+
+  // deprecated
+  XBT_ATTRIB_DEPRECATED_v323("Please use WithContextException::process_name()") std::string const& processName() const
+  {
+    return process_name();
+  }
+  XBT_ATTRIB_DEPRECATED_v323("Please use WithContextException::throw_point()") ThrowPoint& throwPoint()
+  {
+    return throw_point();
+  }
+
 private:
   Backtrace backtrace_;
   std::string procname_; /**< Name of the process who thrown this */
 private:
   Backtrace backtrace_;
   std::string procname_; /**< Name of the process who thrown this */
index f6d6ee0..95b4d95 100644 (file)
@@ -581,7 +581,8 @@ void _xbt_test_fail(const char *file, int line, const char *fmt, ...)
 
 void xbt_test_exception(xbt_ex_t e)
 {
 
 void xbt_test_exception(xbt_ex_t e)
 {
-  _xbt_test_fail(e.throwPoint().file, e.throwPoint().line, "Exception %s raised: %s", xbt_ex_catname(e.category), e.what());
+  _xbt_test_fail(e.throw_point().file, e.throw_point().line, "Exception %s raised: %s", xbt_ex_catname(e.category),
+                 e.what());
 }
 
 void xbt_test_expect_failure()
 }
 
 void xbt_test_expect_failure()
index ba9bbcf..9d5ad43 100644 (file)
@@ -35,10 +35,8 @@ void log_exception(e_xbt_log_priority_t prio, const char* context, std::exceptio
 
     auto* with_context = dynamic_cast<const simgrid::xbt::WithContextException*>(&exception);
     if (with_context != nullptr)
 
     auto* with_context = dynamic_cast<const simgrid::xbt::WithContextException*>(&exception);
     if (with_context != nullptr)
-      XBT_LOG(prio, "%s %s by %s/%d: %s",
-        context, name.get(),
-        with_context->processName().c_str(), with_context->pid(),
-        exception.what());
+      XBT_LOG(prio, "%s %s by %s/%d: %s", context, name.get(), with_context->process_name().c_str(),
+              with_context->pid(), exception.what());
     else
       XBT_LOG(prio, "%s %s: %s", context, name.get(), exception.what());
 
     else
       XBT_LOG(prio, "%s %s: %s", context, name.get(), exception.what());