Error#

Fully qualified name: carb::Error

Defined in carb/detail/Error2.h

class Error : public carb::IObject#

Representation of an Error.

Public Functions

virtual ErrorCode getCode() const noexcept = 0#

Retrieve the code stored in the Error object.

Returns:

The ErrorCode stored in this Error object.

virtual cpp::zstring_view getMessage() const noexcept = 0#

Retrieve the message stored in the Error object.

Note

This may be a default message for the error code, or a custom message. Use hasCustomMessage() to determine if a custom message is present.

Returns:

The message stored in the Error object.

virtual bool hasCustomMessage() const noexcept = 0#

Checks whether this Error object has a custom message.

Returns:

true if *this is storing a custom message; false otherwise.

virtual size_t addRef() = 0#

Atomically add one to the reference count.

Returns:

The current reference count after one was added, though this value may change before read if other threads are also modifying the reference count. The return value is guaranteed to be non-zero.

virtual size_t release() = 0#

Atomically subtracts one from the reference count.

If the result is zero, carb::deleteHandler() is called for this.

Returns:

The current reference count after one was subtracted. If zero is returned, carb::deleteHandler() was called for this.

Public Static Functions

static inline constexpr carb::InterfaceDesc getInterfaceDesc(
) noexcept#

Returns information about this interface.

Auto-generated by CARB_PLUGIN_INTERFACE() or CARB_PLUGIN_INTERFACE_EX.

Returns:

The carb::InterfaceDesc struct with information about this interface.

static inline constexpr carb::InterfaceDesc getLatestInterfaceDesc(
) noexcept#

Returns information about the latest version of this interface.

Auto-generated by CARB_PLUGIN_INTERFACE() or CARB_PLUGIN_INTERFACE_EX.

Returns:

The carb::InterfaceDesc struct with information about the latest version of this interface.