Diag-Client-Lib
|
Encapsulation of an error domain. An error domain is the controlling entity for ErrorCode’s error code values, and defines the mapping of such error code values to textual representations. More...
#include <error_domain.h>
Public Types | |
using | IdType = std::uint64_t |
Type alias for a unique ErrorDomain identifier type. More... | |
using | CodeType = std::int32_t |
Type alias for a domain-specific error code value. More... | |
using | SupportDataType = std::uint8_t |
Type alias type for vendor-specific supplementary data. More... | |
Public Member Functions | |
ErrorDomain (const ErrorDomain &)=delete | |
Copy construction shall be disabled. More... | |
ErrorDomain (ErrorDomain &&)=delete | |
Move construction shall be disabled. More... | |
ErrorDomain & | operator= (const ErrorDomain &)=delete |
Copy assignment shall be disabled. More... | |
ErrorDomain & | operator= (ErrorDomain &&)=delete |
Move assignment shall be disabled. More... | |
constexpr IdType | Id () const noexcept |
Return the unique domain identifier. More... | |
virtual const char * | Name () const noexcept=0 |
Return the name of this error domain. More... | |
virtual const char * | Message (CodeType error_code) noexcept=0 |
Return a textual representation of the given error code. More... | |
Protected Member Functions | |
ErrorDomain (IdType id) noexcept | |
Construct a new instance with the given identifier. Identifiers are expected to be system-wide unique. More... | |
virtual | ~ErrorDomain () noexcept=default |
Destructor. More... | |
Private Attributes | |
IdType | id_ |
Store the unique identifier. More... | |
Encapsulation of an error domain. An error domain is the controlling entity for ErrorCode’s error code values, and defines the mapping of such error code values to textual representations.
This class is a literal type, and subclasses are strongly advised to be literal types as well.
Definition at line 20 of file error_domain.h.
using core_type::ErrorDomain::CodeType = std::int32_t |
Type alias for a domain-specific error code value.
Definition at line 30 of file error_domain.h.
using core_type::ErrorDomain::IdType = std::uint64_t |
Type alias for a unique ErrorDomain identifier type.
Definition at line 25 of file error_domain.h.
using core_type::ErrorDomain::SupportDataType = std::uint8_t |
Type alias type for vendor-specific supplementary data.
Definition at line 35 of file error_domain.h.
|
delete |
Copy construction shall be disabled.
|
delete |
Move construction shall be disabled.
|
explicitprotectednoexcept |
Construct a new instance with the given identifier. Identifiers are expected to be system-wide unique.
[in] | id | The unique identifier |
Definition at line 12 of file error_domain.cpp.
|
protectedvirtualdefaultnoexcept |
Destructor.
This dtor is non-virtual (and trivial) so that this class can be a literal type. While this class has virtual functions, no polymorphic destruction is needed
|
constexprnoexcept |
Return the unique domain identifier.
Definition at line 14 of file error_domain.cpp.
References id_.
|
pure virtualnoexcept |
Return a textual representation of the given error code.
[in] | error_code | The error code value |
Implemented in doip_client::error_domain::DoipErrorDomain, and diag::client::error_domain::DmErrorDomain.
Referenced by core_type::ErrorCode::Message().
|
pure virtualnoexcept |
Return the name of this error domain.
Implemented in doip_client::error_domain::DoipErrorDomain, and diag::client::error_domain::DmErrorDomain.
|
delete |
Copy assignment shall be disabled.
|
delete |
Move assignment shall be disabled.
|
private |