Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::core::ErrorDomain Class Referenceabstract

A class that defines the domain of an ErrorCode to avoid code interferences. More...

#include <error_domain.h>

Inheritance diagram for ara::core::ErrorDomain:
ara::diag::DiagErrorDomain ara::exec::ExecErrorDomain

Public Types

using IdType = uint64_t
 Alias type of the domain ID.
 
using CodeType = uint32_t
 Alias type of the error code.
 

Public Member Functions

constexpr ErrorDomain (IdType id) noexcept
 Constructor. More...
 
 ErrorDomain (const ErrorDomain &)=delete
 
 ErrorDomain (ErrorDomain &&)=delete
 
ErrorDomainoperator= (const ErrorDomain &)=delete
 
ErrorDomainoperator= (ErrorDomain &&)=delete
 
constexpr bool operator== (const ErrorDomain &other) const noexcept
 
constexpr bool operator!= (const ErrorDomain &other) const noexcept
 
constexpr IdType Id () const noexcept
 Get the domain ID. More...
 
virtual const char * Name () const noexcept=0
 Get the domain's name. More...
 
virtual const char * Message (CodeType errorCode) const noexcept=0
 Get error message of a specific error code. More...
 

Detailed Description

A class that defines the domain of an ErrorCode to avoid code interferences.

Note
The class is literal type and it is recommended that derived classes be literal type as well.

Constructor & Destructor Documentation

◆ ErrorDomain()

constexpr ara::core::ErrorDomain::ErrorDomain ( IdType  id)
inlineexplicitconstexprnoexcept

Constructor.

Parameters
idError domain ID

Member Function Documentation

◆ Id()

constexpr IdType ara::core::ErrorDomain::Id ( ) const
inlineconstexprnoexcept

Get the domain ID.

Returns
Error domain ID

◆ Message()

virtual const char * ara::core::ErrorDomain::Message ( CodeType  errorCode) const
pure virtualnoexcept

Get error message of a specific error code.

Parameters
errorCodeError code of interest
Returns
Error code message in this domain

Implemented in ara::diag::DiagErrorDomain, and ara::exec::ExecErrorDomain.

◆ Name()

virtual const char * ara::core::ErrorDomain::Name ( ) const
pure virtualnoexcept

Get the domain's name.

Returns
Error domain name

Implemented in ara::diag::DiagErrorDomain, and ara::exec::ExecErrorDomain.