*/
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.
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__) */
*
* 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:
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());
}