namespace simgrid {
namespace xbt {
-/** A backtrace
- *
- * This is used (among other things) in exceptions to store the associated
- * backtrace.
- *
- * @ingroup XBT_ex
- */
-typedef std::vector<xbt_backtrace_location_t> Backtrace;
-
/** The location of where an exception has been thrown
*
* This is a tuple (__FILE__, __LINE__, __func__) and can be created with
* 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_;