System Diagnostics
namespace thrust::system::errc { … }
template <typename T> struct thrust::system::is_error_code_enum;
template <typename T> struct thrust::system::is_error_condition_enum;
struct thrust::system::is_error_condition_enum< errc::errc_t >;
/* The class error_category
serves as a base class for types used to identify the source and encoding of a particular category of error code. Classes may be derived from error_category
to support categories of errors in addition to those defined in the C++ International Standard. */class thrust::system::error_category;
/* The class error_code
describes an object used to hold error code values, such as those originating from the operating system or other low-level application program interfaces. */class thrust::system::error_code;
/* The class error_condition
describes an object used to hold values identifying error conditions. */class thrust::system::error_condition;
/* The class system_error
describes an exception object used to report error conditions that have an associated error_code
. Such error conditions typically originate from the operating system or other low-level application program interfaces. */class thrust::system::system_error;
const error_category & thrust::system::generic_category(void);
const error_category & thrust::system::system_category(void);
error_code thrust::system::make_error_code(cuda::errc::errc_t e);
bool thrust::system::operator<(const error_code & lhs, const error_code & rhs);
template <typename charT, typename traits> std::basic_ostream< charT, traits > & thrust::system::operator<<(std::basic_ostream< charT, traits > & os, const error_code & ec);
error_condition thrust::system::make_error_condition(cuda::errc::errc_t e);
bool thrust::system::operator<(const error_condition & lhs, const error_condition & rhs);
bool thrust::system::operator==(const error_code & lhs, const error_code & rhs);
bool thrust::system::operator==(const error_code & lhs, const error_condition & rhs);
bool thrust::system::operator==(const error_condition & lhs, const error_code & rhs);
bool thrust::system::operator==(const error_condition & lhs, const error_condition & rhs);
bool thrust::system::operator!=(const error_code & lhs, const error_code & rhs);
bool thrust::system::operator!=(const error_code & lhs, const error_condition & rhs);
bool thrust::system::operator!=(const error_condition & lhs, const error_code & rhs);
bool thrust::system::operator!=(const error_condition & lhs, const error_condition & rhs);
const error_code & thrust::system::system_error::code(void) const;
const char * thrust::system::system_error::what(void) const;
Member Classes
Struct thrust::system::is_error_code_enum
Inherits From: thrust::detail::false_type
Struct thrust::system::is_error_condition_enum
Inherits From: thrust::detail::false_type
Struct thrust::system::is_error_condition_enum< errc::errc_t >
Inherits From: thrust::detail::true_type
Class thrust::system::error_category
The class error_category
serves as a base class for types used to identify the source and encoding of a particular category of error code. Classes may be derived from error_category
to support categories of errors in addition to those defined in the C++ International Standard.
Class thrust::system::error_code
The class error_code
describes an object used to hold error code values, such as those originating from the operating system or other low-level application program interfaces.
Class thrust::system::error_condition
The class error_condition
describes an object used to hold values identifying error conditions.
Class thrust::system::system_error
The class system_error
describes an exception object used to report error conditions that have an associated error_code
. Such error conditions typically originate from the operating system or other low-level application program interfaces.
Inherits From: std::runtime_error
Functions
Function thrust::system::generic_category
const error_category & generic_category(void);
Note: The object’s default_error_condition
and equivalent
virtual functions shall behave as specified for the class error_category
. The object’s name
virtual function shall return a pointer to the string "generic"
.
Returns: A reference to an object of a type derived from class error_category
.
Function thrust::system::system_category
const error_category & system_category(void);
If the argument ev
corresponds to a POSIX errno
value posv
, the function shall return error_condition(ev,generic_category())
. Otherwise, the function shall return error_condition(ev,system_category())
. What constitutes correspondence for any given operating system is unspecified.
Note: The object’s equivalent
virtual functions shall behave as specified for class error_category
. The object’s name
virtual function shall return a pointer to the string "system"
. The object’s default_error_condition
virtual function shall behave as follows:
Returns: A reference to an object of a type derived from class error_category
.
Function thrust::system::make_error_code
error_code make_error_code(cuda::errc::errc_t e);
Returns:
error_code(static_cast<int>(e), cuda::error_category())
error_code(static_cast<int>(e), generic_category())
Function thrust::system::operator<
bool operator<(const error_code & lhs, const error_code & rhs);
Returns: lhs.category() < rhs.category() || lhs.category() == rhs.category() && lhs.value() < rhs.value()
.
Function thrust::system::operator<<
template <typename charT, typename traits> std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > & os, const error_code & ec);
Effects: os << ec.category().name() << ':' << ec.value()
.
Function thrust::system::make_error_condition
error_condition make_error_condition(cuda::errc::errc_t e);
Returns:
error_condition(static_cast<int>(e), cuda::error_category())
.error_condition(static_cast<int>(e), generic_category())
.
Function thrust::system::operator<
bool operator<(const error_condition & lhs, const error_condition & rhs);
Returns: lhs.category() < rhs.category() || lhs.category() == rhs.category() && lhs.value() < rhs.value()
.
Function thrust::system::operator==
bool operator==(const error_code & lhs, const error_code & rhs);
Returns: lhs.category() == rhs.category() && lhs.value() == rhs.value()
.
Function thrust::system::operator==
bool operator==(const error_code & lhs, const error_condition & rhs);
Returns: lhs.category().equivalent(lhs.value(), rhs) || rhs.category().equivalent(lhs,rhs.value())
.
Function thrust::system::operator==
bool operator==(const error_condition & lhs, const error_code & rhs);
Returns: rhs.category().equivalent(lhs.value(), lhs) || lhs.category().equivalent(rhs, lhs.value())
.
Function thrust::system::operator==
bool operator==(const error_condition & lhs, const error_condition & rhs);
Returns: lhs.category() == rhs.category() && lhs.value() == rhs.value()
Function thrust::system::operator!=
bool operator!=(const error_code & lhs, const error_code & rhs);
Returns: !(lhs == rhs)
Function thrust::system::operator!=
bool operator!=(const error_code & lhs, const error_condition & rhs);
Returns: !(lhs == rhs)
Function thrust::system::operator!=
bool operator!=(const error_condition & lhs, const error_code & rhs);
Returns: !(lhs == rhs)
Function thrust::system::operator!=
bool operator!=(const error_condition & lhs, const error_condition & rhs);
Returns: !(lhs == rhs)
Function thrust::system::system_error::system_error
system_error(error_code ec, const std::string & what_arg);
Constructs an object of class system_error
.
Function Parameters:
Postconditions:
code() == ec
.std::string(what()).find(what_arg) != string::npos
.
Function thrust::system::system_error::system_error
system_error(error_code ec, const char * what_arg);
Constructs an object of class system_error
.
Function Parameters:
Postconditions:
code() == ec
.std::string(what()).find(what_arg) != string::npos
.
Function thrust::system::system_error::system_error
system_error(error_code ec);
Constructs an object of class system_error
.
Function Parameters: ec
: The value returned by code()
.
Postconditions: code() == ec
.
Function thrust::system::system_error::system_error
system_error(int ev, const error_category & ecat, const std::string & what_arg);
Constructs an object of class system_error
.
Function Parameters:
ev
The error value used to create anerror_code
.ecat
Theerror_category
used to create anerror_code
.what_arg
A string to include in the result returned bywhat()
.
Postconditions:
code() == error_code(ev, ecat)
.std::string(what()).find(what_arg) != string::npos
.
Function thrust::system::system_error::system_error
system_error(int ev, const error_category & ecat, const char * what_arg);
Constructs an object of class system_error
.
Function Parameters:
ev
The error value used to create anerror_code
.ecat
Theerror_category
used to create anerror_code
.what_arg
A string to include in the result returned bywhat()
.
Postconditions:
code() == error_code(ev, ecat)
.std::string(what()).find(what_arg) != string::npos
.
Function thrust::system::system_error::system_error
system_error(int ev, const error_category & ecat);
Constructs an object of class system_error
.
Function Parameters:
ev
The error value used to create anerror_code
.ecat
Theerror_category
used to create anerror_code
.
Postconditions: code() == error_code(ev, ecat)
.
Function thrust::system::system_error::~system_error
virtual ~system_error(void);
Destructor does not throw.
Function thrust::system::system_error::code
const error_code & code(void) const;
Returns an object encoding the error.
Returns: ec
or error_code(ev, ecat)
, from the constructor, as appropriate.
Function thrust::system::system_error::what
const char * what(void) const;
Returns a human-readable string indicating the nature of the error.
Returns: a string incorporating code().message()
and the arguments supplied in the constructor.