ADTF  3.18.2
ErrorDescriptionfinal

Implements the error description interface for heap allocated error cases. More...

Inheritance diagram for ErrorDescription:
[legend]

Public Member Functions

 ErrorDescription (const ErrorDescription &)=delete
 
ErrorDescriptionoperator= (const ErrorDescription &)=delete
 
 ErrorDescription (ErrorDescription &&)=delete
 
ErrorDescriptionoperator= (ErrorDescription &&)=delete
 
 ~ErrorDescription ()=default
 DTOR.
 
 ErrorDescription (std::int32_t error_code, const char *error_description, std::int32_t line, const char *file, const char *function, const char *error_label)
 Construct error description object with complete set of error information. More...
 
std::int32_t getErrorCode () const
 Get error code. More...
 
std::int32_t getLine () const
 Get line in source file where the error was reported. More...
 
const char * getErrorDescription () const
 Get error code as string representation. More...
 
const char * getFileName () const
 Get name of the file the error was reported in. More...
 
const char * getFunctionName () const
 Get name of the function the error was reported in. More...
 
const char * getErrorCodeLabel () const
 Get error code label. More...
 

Private Attributes

const std::int32_t _error_code
 Currently held error code.
 
const std::int32_t _line_number
 Line number in which the error occurred.
 
const std::string _error_description
 Currently held error description.
 
const std::string _file_name
 File in which the error occurred.
 
const std::string _function_name
 Function in which the error occurred.
 
const std::string _error_label
 Error code as string representation.
 

Additional Inherited Members

- Protected Member Functions inherited from IErrorDescription
 ~IErrorDescription ()
 DTOR.
 

Detailed Description

Implements the error description interface for heap allocated error cases.

Definition at line 29 of file error_description.h.

Constructor & Destructor Documentation

◆ ErrorDescription()

ErrorDescription ( std::int32_t  error_code,
const char *  error_description,
std::int32_t  line,
const char *  file,
const char *  function,
const char *  error_label 
)
inline

Construct error description object with complete set of error information.

Template Parameters
ErrorCodeError code (to deduce specialized template to stringify the error code)
Parameters
[in]error_codeThe The concrete error object
[in]error_descriptionComplete description of the error
[in]lineLine in source file the error was reported (default: -1)
[in]fileSource file the error was reported in
[in]functionFunction the error was reported in
[in]error_labelThe error code as an string object

Definition at line 23 of file error_description_impl.h.

Member Function Documentation

◆ getErrorCode()

std::int32_t getErrorCode ( ) const
inlinevirtual

Get error code.

Returns
Error code.

Implements IErrorDescription.

Definition at line 38 of file error_description_impl.h.

References ErrorDescription::_error_code.

◆ getErrorCodeLabel()

const char * getErrorCodeLabel ( ) const
inlinevirtual

Get error code label.

Returns
Error code as an string object.

Implements IErrorDescription.

Definition at line 63 of file error_description_impl.h.

References ErrorDescription::_error_label.

◆ getErrorDescription()

const char * getErrorDescription ( ) const
inlinevirtual

Get error code as string representation.

Returns
Error code represented as string.

Implements IErrorDescription.

Definition at line 48 of file error_description_impl.h.

References ErrorDescription::_error_description.

◆ getFileName()

const char * getFileName ( ) const
inlinevirtual

Get name of the file the error was reported in.

Returns
File name as string.

Implements IErrorDescription.

Definition at line 53 of file error_description_impl.h.

References ErrorDescription::_file_name.

◆ getFunctionName()

const char * getFunctionName ( ) const
inlinevirtual

Get name of the function the error was reported in.

Returns
Function name as string.

Implements IErrorDescription.

Definition at line 58 of file error_description_impl.h.

References ErrorDescription::_function_name.

◆ getLine()

std::int32_t getLine ( ) const
inlinevirtual

Get line in source file where the error was reported.

Returns
Line number.

Implements IErrorDescription.

Definition at line 43 of file error_description_impl.h.

References ErrorDescription::_line_number.