Diag-Client-Lib
Public Types | Public Member Functions | Private Attributes | List of all members
diag::client::error_domain::DmErrorDomain Class Referencefinal

Definition of Dcm Client Error domain. More...

#include <dm_error_domain.h>

Inheritance diagram for diag::client::error_domain::DmErrorDomain:
Inheritance graph
[legend]
Collaboration diagram for diag::client::error_domain::DmErrorDomain:
Collaboration graph
[legend]

Public Types

using Errc = DmErrorErrc
 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

 DmErrorDomain () noexcept
 Default constructor. More...
 
 ~DmErrorDomain () noexcept=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_ {"DcmClientErrorDomain"}
 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 Dcm Client Error domain.

Definition at line 31 of file dm_error_domain.h.

Member Typedef Documentation

◆ Errc

Type alias for the error code value enumeration.

Definition at line 36 of file dm_error_domain.h.

Constructor & Destructor Documentation

◆ DmErrorDomain()

diag::client::error_domain::DmErrorDomain::DmErrorDomain ( )
explicitnoexcept

Default constructor.

Definition at line 46 of file dm_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.

◆ ~DmErrorDomain()

diag::client::error_domain::DmErrorDomain::~DmErrorDomain ( )
defaultnoexcept

Default destructor.

Member Function Documentation

◆ Message()

const char * diag::client::error_domain::DmErrorDomain::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 50 of file dm_error_domain.cpp.

50  {
51  message_.clear();
52  message_ = ConvertErrorCodeToString(error_code);
53  return message_.c_str();
54 }
std::string message_
Store the error message.
auto ConvertErrorCodeToString(core_type::ErrorDomain::CodeType error_code) noexcept -> std::string

References diag::client::error_domain::anonymous_namespace{dm_error_domain.cpp}::ConvertErrorCodeToString().

Here is the call graph for this function:

◆ Name()

const char * diag::client::error_domain::DmErrorDomain::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 48 of file dm_error_domain.cpp.

48 { 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 diag::client::error_domain::DmErrorDomain::domain_name_ {"DcmClientErrorDomain"}
private

Store the error domain name.

Definition at line 66 of file dm_error_domain.h.

Referenced by Name().

◆ message_

std::string diag::client::error_domain::DmErrorDomain::message_
private

Store the error message.

Definition at line 71 of file dm_error_domain.h.


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