Diag-Client-Lib
Public Types | Public Member Functions | Private Attributes | List of all members
doip_client::error_domain::DoipErrorDomain Class Referencefinal

Definition of Doip Client Error domain. More...

#include <doip_error_domain.h>

Inheritance diagram for doip_client::error_domain::DoipErrorDomain:
Inheritance graph
[legend]
Collaboration diagram for doip_client::error_domain::DoipErrorDomain:
Collaboration graph
[legend]

Public Types

using Errc = DoipErrorErrc
 Type alias for the error code value enumeration. More...
 
- Public Types inherited from core_type::ErrorDomain
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

 DoipErrorDomain () noexcept
 Default constructor. More...
 
 ~DoipErrorDomain () noexcept override=default
 Default destructor. More...
 
const char * Name () const noexcept override
 Return the name of this error domain. More...
 
const char * Message (CodeType error_code) noexcept override
 Return a textual representation of the given error code. More...
 
- Public Member Functions inherited from core_type::ErrorDomain
 ErrorDomain (const ErrorDomain &)=delete
 Copy construction shall be disabled. More...
 
 ErrorDomain (ErrorDomain &&)=delete
 Move construction shall be disabled. More...
 
ErrorDomainoperator= (const ErrorDomain &)=delete
 Copy assignment shall be disabled. More...
 
ErrorDomainoperator= (ErrorDomain &&)=delete
 Move assignment shall be disabled. More...
 
constexpr IdType Id () const noexcept
 Return the unique domain identifier. More...
 

Private Attributes

const std::string domain_name_ {"DoipClientErrorDomain"}
 Store the error domain name. More...
 
std::string message_
 Store the error message. More...
 

Additional Inherited Members

- Protected Member Functions inherited from core_type::ErrorDomain
 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...
 

Detailed Description

Definition of Doip Client Error domain.

Definition at line 32 of file doip_error_domain.h.

Member Typedef Documentation

◆ Errc

Type alias for the error code value enumeration.

Definition at line 37 of file doip_error_domain.h.

Constructor & Destructor Documentation

◆ DoipErrorDomain()

doip_client::error_domain::DoipErrorDomain::DoipErrorDomain ( )
explicitnoexcept

Default constructor.

Definition at line 51 of file doip_error_domain.cpp.

Encapsulation of an error domain. An error domain is the controlling entity for ErrorCode’s error cod...
Definition: error_domain.h:20
constexpr core_type::ErrorDomain::IdType unique_identifier
Store the unique identifier of this domain.

◆ ~DoipErrorDomain()

doip_client::error_domain::DoipErrorDomain::~DoipErrorDomain ( )
overridedefaultnoexcept

Default destructor.

Member Function Documentation

◆ Message()

const char * doip_client::error_domain::DoipErrorDomain::Message ( CodeType  error_code)
overridevirtualnoexcept

Return a textual representation of the given error code.

Parameters
[in]error_codeThe error code value
Returns
The returned pointer remains owned by the ErrorDomain subclass and shall not be freed by clients.

Implements core_type::ErrorDomain.

Definition at line 55 of file doip_error_domain.cpp.

55  {
56  message_.clear();
57  message_ = ConvertErrorCodeToString(error_code);
58  return message_.c_str();
59 }
std::string message_
Store the error message.
auto ConvertErrorCodeToString(core_type::ErrorDomain::CodeType error_code) noexcept -> std::string

References doip_client::error_domain::anonymous_namespace{doip_error_domain.cpp}::ConvertErrorCodeToString().

Here is the call graph for this function:

◆ Name()

const char * doip_client::error_domain::DoipErrorDomain::Name ( ) const
overridevirtualnoexcept

Return the name of this error domain.

Returns
The returned pointer remains owned by class ErrorDomain and shall not be freed by clients.

Implements core_type::ErrorDomain.

Definition at line 53 of file doip_error_domain.cpp.

53 { return domain_name_.c_str(); }
const std::string domain_name_
Store the error domain name.

References domain_name_.

Member Data Documentation

◆ domain_name_

const std::string doip_client::error_domain::DoipErrorDomain::domain_name_ {"DoipClientErrorDomain"}
private

Store the error domain name.

Definition at line 67 of file doip_error_domain.h.

Referenced by Name().

◆ message_

std::string doip_client::error_domain::DoipErrorDomain::message_
private

Store the error message.

Definition at line 72 of file doip_error_domain.h.


The documentation for this class was generated from the following files: