/** Return the information about where the exception was thrown */
xbt::ThrowPoint const& throw_point() const { return throwpoint_; }
+ /** Allow to carry a value (used by testany/waitany) */
+ int get_value() const { return value_; }
+ void set_value(int value) { value_ = value; }
+
std::string resolve_backtrace() const { return throwpoint_.backtrace_.resolve(); }
virtual void rethrow_nested(const simgrid::xbt::ThrowPoint& throwpoint, const std::string& message) const
std::throw_with_nested(Exception(throwpoint, message));
}
- /** Allow to carry a value (used by waitall/waitany) */
- int value = 0;
-
private:
xbt::ThrowPoint throwpoint_;
+ int value_ = 0;
};
#define DECLARE_SIMGRID_EXCEPTION(AnyException, ...) \
}
CommImpl** element = std::find(comms, comms + count, this);
int rank = (element != comms + count) ? element - comms : -1;
-
// In order to modify the exception we have to rethrow it:
try {
std::rethrow_exception(simcall->issuer_->exception_);
} catch (simgrid::Exception& e) {
- e.value = rank;
+ e.set_value(rank);
}
}
try {
finished_index = simcall_comm_testany(s_comms.data(), s_comms.size());
} catch (const simgrid::TimeoutException& e) {
- finished_index = e.value;
+ finished_index = e.get_value();
status = MSG_TIMEOUT;
} catch (const simgrid::CancelException& e) {
- finished_index = e.value;
+ finished_index = e.get_value();
status = MSG_TASK_CANCELED;
} catch (const simgrid::NetworkFailureException& e) {
- finished_index = e.value;
+ finished_index = e.get_value();
status = MSG_TRANSFER_FAILURE;
}
try {
finished_index = simcall_comm_waitany(s_comms.data(), s_comms.size(), -1);
} catch (const simgrid::TimeoutException& e) {
- finished_index = e.value;
+ finished_index = e.get_value();
status = MSG_TIMEOUT;
} catch (const simgrid::CancelException& e) {
- finished_index = e.value;
+ finished_index = e.get_value();
status = MSG_TASK_CANCELED;
} catch (const simgrid::NetworkFailureException& e) {
- finished_index = e.value;
+ finished_index = e.get_value();
status = MSG_TRANSFER_FAILURE;
}