Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename fields to end with _
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 24 Aug 2018 16:57:27 +0000 (18:57 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 24 Aug 2018 20:40:30 +0000 (22:40 +0200)
include/xbt/exception.hpp
src/xbt/cunit.cpp

index edc0221..65b0990 100644 (file)
@@ -33,7 +33,7 @@ namespace xbt {
  */
 typedef std::vector<xbt_backtrace_location_t> Backtrace;
 
  */
 typedef std::vector<xbt_backtrace_location_t> Backtrace;
 
-/** The location of where an exception has been throwed
+/** The location of where an exception has been thrown
  *
  *  This is a tuple (__FILE__, __LINE__, __func__) and can be created with
  *  @ref XBT_THROW_POINT.
  *
  *  This is a tuple (__FILE__, __LINE__, __func__) and can be created with
  *  @ref XBT_THROW_POINT.
@@ -43,10 +43,12 @@ typedef std::vector<xbt_backtrace_location_t> Backtrace;
 class ThrowPoint {
  public:
   ThrowPoint() = default;
 class ThrowPoint {
  public:
   ThrowPoint() = default;
-  explicit ThrowPoint(const char* file, int line, const char* function) : file(file), line(line), function(function) {}
-  const char* file = nullptr;
-  int line = 0;
-  const char* function = nullptr;
+  explicit ThrowPoint(const char* file, int line, const char* function) : file_(file), line_(line), function_(function)
+  {
+  }
+  const char* file_     = nullptr;
+  int line_             = 0;
+  const char* function_ = nullptr;
 };
 
 /** Create a ThrowPoint with (__FILE__, __LINE__, __func__) */
 };
 
 /** Create a ThrowPoint with (__FILE__, __LINE__, __func__) */
@@ -56,13 +58,6 @@ 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.
- *
- *  You are not expected to inherit from it. Instead of you use should
- *  @ref XBT_THROW an exception which will throw a subclass of your original
- *  exception with those additional features.
- *
- *  However, you can try `dynamic_cast` an exception to this type in order to
- *  get contextual information about the exception.
  */
 class XBT_PUBLIC WithContextException {
 public:
  */
 class XBT_PUBLIC WithContextException {
 public:
index 586173e..4a4fd78 100644 (file)
@@ -581,7 +581,7 @@ 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.throw_point().file, e.throw_point().line, "Exception %s raised: %s", xbt_ex_catname(e.category),
+  _xbt_test_fail(e.throw_point().file_, e.throw_point().line_, "Exception %s raised: %s", xbt_ex_catname(e.category),
                  e.what());
 }
 
                  e.what());
 }