Diag-Client-Lib
|
Encapsulation of an error code. An ErrorCode contains a raw error code value and an error domain. The raw error code value is specific to this error domain. More...
#include <error_code.h>
Public Member Functions | |
template<typename EnumT > | |
ErrorCode (EnumT e, ErrorDomain::SupportDataType data=ErrorDomain::SupportDataType{}) noexcept | |
Construct a new ErrorCode instance with parameters. More... | |
ErrorCode (ErrorDomain::CodeType value, ErrorDomain &domain, ErrorDomain::SupportDataType data=ErrorDomain::SupportDataType{}) noexcept | |
Construct a new ErrorCode instance with parameters. More... | |
constexpr ErrorDomain::CodeType | Value () const noexcept |
Return the raw error code value. More... | |
constexpr const ErrorDomain & | Domain () const noexcept |
Return the domain with which this ErrorCode is associated. More... | |
constexpr ErrorDomain::SupportDataType | SupportData () const noexcept |
Return the supplementary error context data. More... | |
std::string_view | Message () noexcept |
Return a textual representation of this ErrorCode. More... | |
Private Attributes | |
ErrorDomain::CodeType | code_value_ {} |
Store the domain error code value. More... | |
ErrorDomain & | domain_ |
Store the reference to error domain contained. More... | |
ErrorDomain::SupportDataType | support_data_ {} |
Store the supported data. More... | |
Encapsulation of an error code. An ErrorCode contains a raw error code value and an error domain. The raw error code value is specific to this error domain.
This class is implemented based on API specification of ara::core::ErrorCode from Adaptive Platform Core AUTOSAR AP R21-11
Definition at line 22 of file error_code.h.
|
explicitnoexcept |
Construct a new ErrorCode instance with parameters.
This constructor does not participate in overload resolution unless EnumT is an enum type
EnumT | An enum type that contains error code values |
[in] | e | A domain-specific error code value |
[in] | data | Optional vendor-specific supplementary error context data |
Definition at line 14 of file error_code.cpp.
|
noexcept |
Construct a new ErrorCode instance with parameters.
EnumT | An enum type that contains error code values |
[in] | value | A domain-specific error code value |
[in] | domain | The ErrorDomain associated with value |
[in] | data | Optional vendor-specific supplementary error context data |
Definition at line 17 of file error_code.cpp.
|
constexprnoexcept |
Return the domain with which this ErrorCode is associated.
Definition at line 24 of file error_code.cpp.
References domain_.
|
noexcept |
Return a textual representation of this ErrorCode.
Definition at line 28 of file error_code.cpp.
References code_value_, domain_, and core_type::ErrorDomain::Message().
|
constexprnoexcept |
Return the supplementary error context data.
The underlying type and the meaning of the returned value are implementation-defined
Definition at line 26 of file error_code.cpp.
References support_data_.
|
constexprnoexcept |
Return the raw error code value.
Definition at line 22 of file error_code.cpp.
References code_value_.
|
private |
Store the domain error code value.
Definition at line 80 of file error_code.h.
|
private |
Store the reference to error domain contained.
Definition at line 85 of file error_code.h.
|
private |