From c58278cb019a1db459dd698bc4ec8e313aa53b59 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Fri, 24 Aug 2018 22:37:46 +0200 Subject: [PATCH] rename xbt::WithContextException into xbt::ContextedException --- include/simgrid/exception.hpp | 4 ++-- include/xbt/exception.hpp | 10 +++++----- src/xbt/exception.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/simgrid/exception.hpp b/include/simgrid/exception.hpp index 32edceaa42..f363a2ee47 100644 --- a/include/simgrid/exception.hpp +++ b/include/simgrid/exception.hpp @@ -58,7 +58,7 @@ class canceled_error : public simgrid::exception { * * @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() {} @@ -68,7 +68,7 @@ public: * @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()) { } diff --git a/include/xbt/exception.hpp b/include/xbt/exception.hpp index 65b0990aaf..e214640759 100644 --- a/include/xbt/exception.hpp +++ b/include/xbt/exception.hpp @@ -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. */ -class XBT_PUBLIC WithContextException { +class XBT_PUBLIC ContextedException { public: - WithContextException() : + ContextedException() : 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) {} - virtual ~WithContextException(); + virtual ~ContextedException(); Backtrace const& backtrace() const { return backtrace_; diff --git a/src/xbt/exception.cpp b/src/xbt/exception.cpp index dbfd17f2c5..b9503b69ef 100644 --- a/src/xbt/exception.cpp +++ b/src/xbt/exception.cpp @@ -84,14 +84,14 @@ const char* xbt_ex_catname(xbt_errcat_t cat) 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()); - auto* with_context = dynamic_cast(&exception); + auto* with_context = dynamic_cast(&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()); -- 2.20.1