ADTF
error_def.h File Reference

Public API for result macros. More...

Go to the source code of this file.

Macros

#define ERROR_DESCRIPTION(_errcode, ...)
 Return an a_util::result::Result object with detailed error information. More...
 
#define RETURN_ERROR_DESCRIPTION(_errcode, ...)
 Return an a_util::result::Result object with detailed error information. More...
 

Detailed Description

Public API for result macros.

Definition in file error_def.h.

Macro Definition Documentation

◆ ERROR_DESCRIPTION

#define ERROR_DESCRIPTION (   _errcode,
  ... 
)
Value:
a_util::strings::format(__VA_ARGS__).c_str(), \
__LINE__, \
__FILE__, \
A common result class usable as return value throughout.
#define A_UTIL_CURRENT_FUNCTION
Resolves to the name of the function this macro is used in.
std::string format(const char *str_format,...)
printf()-like formatting of an input string.

Return an a_util::result::Result object with detailed error information.

The resolved macro instanciates and returns the result object with the error description containing line, file and function name this macro is evaluated from as well as the printf()-like values from the second parameter.

Parameters
[in]_errcodeThe error code to distribute with the result object.
[in]...printf()-like arguments creating the error message.

Definition at line 30 of file error_def.h.

◆ RETURN_ERROR_DESCRIPTION

#define RETURN_ERROR_DESCRIPTION (   _errcode,
  ... 
)
Value:
return a_util::result::Result(_errcode, \
a_util::strings::format(__VA_ARGS__).c_str(), \
__LINE__, \
__FILE__, \

Return an a_util::result::Result object with detailed error information.

The resolved macro instanciates and returns the result object with the error description containing line, file and function name this macro is evaluated from as well as the printf()-like values from the second parameter.

Parameters
[in]_errcodeThe error code to distribute with the result object.
[in]...printf()-like arguments creating the error message.

Definition at line 39 of file error_def.h.