It seems to be sufficient for now.
Maybe one day we'll need to complete to handle Lvalues.
class ThrowPoint {
public:
ThrowPoint() = default;
class ThrowPoint {
public:
ThrowPoint() = default;
- explicit ThrowPoint(const char* file, int line, const char* function, Backtrace bt, std::string actor_name, int pid)
+ explicit ThrowPoint(const char* file, int line, const char* function, Backtrace&& bt, std::string&& actor_name,
+ int pid)
: file_(file)
, line_(line)
, function_(function)
: file_(file)
, line_(line)
, function_(function)
/** Ancestor class of all SimGrid exception */
class Exception : public std::runtime_error {
public:
/** Ancestor class of all SimGrid exception */
class Exception : public std::runtime_error {
public:
- Exception(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+ Exception(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
: std::runtime_error(std::move(message)), throwpoint_(std::move(throwpoint))
{
}
: std::runtime_error(std::move(message)), throwpoint_(std::move(throwpoint))
{
}
* @param throwpoint Throw point (use XBT_THROW_POINT)
* @param message Exception message
*/
* @param throwpoint Throw point (use XBT_THROW_POINT)
* @param message Exception message
*/
- xbt_ex(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+ xbt_ex(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
: simgrid::Exception(std::move(throwpoint), std::move(message))
{
}
: simgrid::Exception(std::move(throwpoint), std::move(message))
{
}
/** Exception raised when a timeout elapsed */
class TimeoutError : public xbt_ex {
public:
/** Exception raised when a timeout elapsed */
class TimeoutError : public xbt_ex {
public:
- TimeoutError(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+ TimeoutError(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
: xbt_ex(std::move(throwpoint), std::move(message))
{
category = timeout_error;
: xbt_ex(std::move(throwpoint), std::move(message))
{
category = timeout_error;
/** Exception raised when a host fails */
class HostFailureException : public xbt_ex {
public:
/** Exception raised when a host fails */
class HostFailureException : public xbt_ex {
public:
- HostFailureException(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+ HostFailureException(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
: xbt_ex(std::move(throwpoint), std::move(message))
{
category = host_error;
: xbt_ex(std::move(throwpoint), std::move(message))
{
category = host_error;
/** Exception raised when a communication fails because of the network or because of the remote host */
class NetworkFailureException : public xbt_ex {
public:
/** Exception raised when a communication fails because of the network or because of the remote host */
class NetworkFailureException : public xbt_ex {
public:
- NetworkFailureException(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+ NetworkFailureException(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
: xbt_ex(std::move(throwpoint), std::move(message))
{
category = network_error;
: xbt_ex(std::move(throwpoint), std::move(message))
{
category = network_error;
/** Exception raised when a storage fails */
class StorageFailureException : public xbt_ex {
public:
/** Exception raised when a storage fails */
class StorageFailureException : public xbt_ex {
public:
- StorageFailureException(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+ StorageFailureException(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
: xbt_ex(std::move(throwpoint), std::move(message))
{
category = io_error;
: xbt_ex(std::move(throwpoint), std::move(message))
{
category = io_error;
/** Exception raised when something got canceled before completion */
class CancelException : public xbt_ex {
public:
/** Exception raised when something got canceled before completion */
class CancelException : public xbt_ex {
public:
- CancelException(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+ CancelException(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
: xbt_ex(std::move(throwpoint), std::move(message))
{
category = cancel_error;
: xbt_ex(std::move(throwpoint), std::move(message))
{
category = cancel_error;