HPX - High Performance ParalleX

PrevUpHomeNext

Class exception

hpx::exception — A hpx::exception is the main exception type used by HPX to report errors.

Synopsis

// In header: <hpx/exception.hpp>


class exception {
public:
  // construct/copy/destruct
  explicit exception(error = success);
  explicit exception(boost::system::system_error const &);
  exception(error, char const *, throwmode = plain);
  exception(error, std::string const &, throwmode = plain);
  ~exception();

  // public member functions
  error get_error() const;
  error_code get_error_code(throwmode = plain) const;
};

Description

The hpx::exception type is the main exception type used by HPX to report errors. Any exceptions thrown by functions in the HPX library are either of this type or of a type derived from it. This implies that it is always safe to use this type only in catch statements guarding HPX library calls.

exception public construct/copy/destruct

  1. explicit exception(error e = success);

    Construct a hpx::exception from a hpx::error.

    Parameters:

    e

    The parameter e holds the hpx::error code the new exception should encapsulate.

  2. explicit exception(boost::system::system_error const & e);
    Construct a hpx::exception from a boost::system_error.
  3. exception(error e, char const * msg, throwmode mode = plain);

    Construct a hpx::exception from a hpx::error and an error message.

    Parameters:

    e

    The parameter e holds the hpx::error code the new exception should encapsulate.

    mode

    The parameter mode specifies whether the returned hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).

    msg

    The parameter msg holds the error message the new exception should encapsulate.

  4. exception(error e, std::string const & msg, throwmode mode = plain);

    Construct a hpx::exception from a hpx::error and an error message.

    Parameters:

    e

    The parameter e holds the hpx::error code the new exception should encapsulate.

    mode

    The parameter mode specifies whether the returned hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).

    msg

    The parameter msg holds the error message the new exception should encapsulate.

  5. ~exception();

    Destruct a hpx::exception

    Throws:

    nothing

exception public member functions

  1. error get_error() const;

    The function get_error() returns the hpx::error code stored in the referenced instance of a hpx::exception. It returns the hpx::error code this exception instance was constructed from.

    Throws:

    nothing
  2. error_code get_error_code(throwmode mode = plain) const;

    The function get_error_code() returns a hpx::error_code which represents the same error condition as this hpx::exception instance.

    Parameters:

    mode

    The parameter mode specifies whether the returned hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).


PrevUpHomeNext