ADTF
|
Copyright © Audi Electronics Venture GmbH. More...
Go to the source code of this file.
Classes | |
struct | tErrorCode |
C++11 POD type to distribute error codes between binary boundaries. More... | |
struct | tErrorString |
Wrapper for stringification of error codes - for usage by struct tError. More... | |
Macros | |
#define | IS_OK(s) ( ( s ).IsOk() ) |
Check if result is OK. | |
#define | IS_FAILED(s) ( ( s ).IsFailed() ) |
Check if result is failed. | |
#define | RETURN_NOERROR return ERR_NOERROR |
Return status ERR_NOERROR, which requires the calling function's return type to be tResult. | |
#define | RETURN_ERROR(code) return (code) |
Return specific error code, which requires the calling function's return type to be tResult. | |
#define | RETURN_ERROR_DESC(_code, ...) return DETAILED_RESULT(_code, __VA_ARGS__) |
Same as RETURN_ERROR(_error) using a printf like parameter list for detailed error description. | |
#define | RETURN_IF_FAILED(s) { tResult _errcode(s); if ( _errcode.IsFailed() ) { return (_errcode); } } |
Return if expression is failed, which requires the calling function's return type to be tResult. | |
#define | RETURN_IF_FAILED_DESC(s, ...) { tResult _errcode(s); if ( _errcode.IsFailed() ) { return DETAILED_RESULT(_errcode.GetErrorCode().value, __VA_ARGS__); } } |
#define | RETURN_IF_POINTER_NULL(_ptr) if ( nullptr == _ptr ) { RETURN_ERROR(ERR_POINTER); } |
Return ERR_POINTER if _ptr is nullptr, which requires the calling function's return type to be tResult. | |
#define | RETURN_IF_POINTER_NULL_DESC(_ptr, ...) if ( nullptr == _ptr ) { return DETAILED_RESULT(ERR_POINTER, __VA_ARGS__); } |
Return ERR_POINTER with description if _ptr is nullptr, which requires the calling function's return type to be tResult. | |
#define | LOG_RESULT(code) |
Log result to console. More... | |
#define | RETURN_AND_LOG_ERROR(code) |
Log error code to console and return from the current function. More... | |
#define | RETURN_AND_LOG_ERROR_STR(code, ...) |
Log custom error description to console and return from the current function. More... | |
#define | RETURN_IF_FAILED_AND_LOG_ERROR_STR(code, ...) |
Log custom error description to console and return from the current function. More... | |
#define | ASSERT_IF_POINTER_NULL(_ptr) |
In debug mode this macro asserts if a pointer is NULL, in release mode does nothing. | |
#define | __FUNC__ __func__ |
#define | _MAKE_ERROR(_no, _strcode) |
Create an error type with its name and numeric representation. More... | |
Functions | |
_MAKE_ERROR (0, ERR_NOERROR) | |
Create error type ERR_NOERROR with numeric representation 0. | |
_MAKE_ERROR (2, ERR_UNKNOWN) | |
Create error type ERR_UNKNOWN with numeric representation -2. | |
_MAKE_ERROR (3, ERR_UNEXPECTED) | |
Create error type ERR_UNEXPECTED with numeric representation -3. | |
_MAKE_ERROR (4, ERR_POINTER) | |
Create error type ERR_POINTER with numeric representation -4. | |
_MAKE_ERROR (5, ERR_INVALID_ARG) | |
Create error type ERR_INVALID_ARG with numeric representation -5. | |
_MAKE_ERROR (6, ERR_INVALID_FUNCTION) | |
Create error type ERR_INVALID_FUNCTION with numeric representation -6. | |
_MAKE_ERROR (7, ERR_INVALID_ADDRESS) | |
Create error type ERR_INVALID_ADDRESS with numeric representation -7. | |
_MAKE_ERROR (8, ERR_INVALID_HANDLE) | |
Create error type ERR_INVALID_HANDLE with numeric representation -8. | |
_MAKE_ERROR (9, ERR_INVALID_FLAGS) | |
Create error type ERR_INVALID_FLAGS with numeric representation -9. | |
_MAKE_ERROR (10, ERR_INVALID_INDEX) | |
Create error type ERR_INVALID_INDEX with numeric representation -10. | |
_MAKE_ERROR (11, ERR_INVALID_FILE) | |
Create error type ERR_INVALID_FILE with numeric representation -11. | |
_MAKE_ERROR (12, ERR_MEMORY) | |
Create error type ERR_MEMORY with numeric representation -12. | |
_MAKE_ERROR (13, ERR_TIMEOUT) | |
Create error type ERR_TIMEOUT with numeric representation -13. | |
_MAKE_ERROR (14, ERR_OUT_OF_SYNC) | |
Create error type ERR_OUT_OF_SYNC with numeric representation -14. | |
_MAKE_ERROR (15, ERR_RESOURCE_IN_USE) | |
Create error type ERR_RESOURCE_IN_USE with numeric representation -15. | |
_MAKE_ERROR (16, ERR_NOT_IMPL) | |
Create error type ERR_NOT_IMPL with numeric representation -16. | |
_MAKE_ERROR (17, ERR_NO_INTERFACE) | |
Create error type ERR_NO_INTERFACE with numeric representation -17. | |
_MAKE_ERROR (18, ERR_NO_CLASS) | |
Create error type ERR_NO_CLASS with numeric representation -18. | |
_MAKE_ERROR (19, ERR_NOT_SUPPORTED) | |
Create error type ERR_NOT_SUPPORTED with numeric representation -19. | |
_MAKE_ERROR (20, ERR_NOT_FOUND) | |
Create error type ERR_NOT_FOUND with numeric representation -20. | |
_MAKE_ERROR (21, ERR_CANCELED) | |
Create error type ERR_CANCELED with numeric representation -21. | |
_MAKE_ERROR (22, ERR_RETRY) | |
Create error type ERR_RETRY with numeric representation -22. | |
_MAKE_ERROR (23, ERR_FILE_NOT_FOUND) | |
Create error type ERR_FILE_NOT_FOUND with numeric representation -23. | |
_MAKE_ERROR (24, ERR_PATH_NOT_FOUND) | |
Create error type ERR_PATH_NOT_FOUND with numeric representation -24. | |
_MAKE_ERROR (25, ERR_ACCESS_DENIED) | |
Create error type ERR_ACCESS_DENIED with numeric representation -25. | |
_MAKE_ERROR (26, ERR_NOT_READY) | |
Create error type ERR_NOT_READY with numeric representation -26. | |
_MAKE_ERROR (27, ERR_OPEN_FAILED) | |
Create error type ERR_OPEN_FAILED with numeric representation -27. | |
_MAKE_ERROR (28, ERR_IO_INCOMPLETE) | |
Create error type ERR_IO_INCOMPLETE with numeric representation -28. | |
_MAKE_ERROR (29, ERR_IO_PENDING) | |
Create error type ERR_IO_PENDING with numeric representation -29. | |
_MAKE_ERROR (30, ERR_NOACCESS) | |
Create error type ERR_NOACCESS with numeric representation -30. | |
_MAKE_ERROR (31, ERR_BAD_DEVICE) | |
Create error type ERR_BAD_DEVICE with numeric representation -31. | |
_MAKE_ERROR (32, ERR_DEVICE_IO) | |
Create error type ERR_DEVICE_IO with numeric representation -32. | |
_MAKE_ERROR (33, ERR_DEVICE_NOT_READY) | |
Create error type ERR_DEVICE_NOT_READY with numeric representation -33. | |
_MAKE_ERROR (34, ERR_DEVICE_IN_USE) | |
Create error type ERR_DEVICE_IN_USE with numeric representation -34. | |
_MAKE_ERROR (35, ERR_NOT_CONNECTED) | |
Create error type ERR_NOT_CONNECTED with numeric representation -35. | |
_MAKE_ERROR (36, ERR_UNKNOWN_FORMAT) | |
Create error type ERR_UNKNOWN_FORMAT with numeric representation -36. | |
_MAKE_ERROR (37, ERR_NOT_INITIALIZED) | |
Create error type ERR_NOT_INITIALIZED with numeric representation -37. | |
_MAKE_ERROR (38, ERR_FAILED) | |
Create error type ERR_FAILED with numeric representation -38. | |
_MAKE_ERROR (39, ERR_END_OF_FILE) | |
Create error type ERR_END_OF_FILE with numeric representation -39. | |
_MAKE_ERROR (40, ERR_INVALID_STATE) | |
Create error type ERR_INVALID_STATE with numeric representation -40. | |
_MAKE_ERROR (41, ERR_EXCEPTION_RAISED) | |
Create error type ERR_EXCEPTION_RAISED with numeric representation -41. | |
_MAKE_ERROR (42, ERR_INVALID_TYPE) | |
Create error type ERR_INVALID_TYPE with numeric representation -42. | |
_MAKE_ERROR (43, ERR_EMPTY) | |
Create error type ERR_EMPTY with numeric representation -43. | |
_MAKE_ERROR (44, ERR_INVALID_VERSION) | |
Create error type ERR_INVALID_VERSION with numeric representation -44. | |
_MAKE_ERROR (45, ERR_INVALID_LICENSE) | |
Create error type ERR_INVALID_LICENSE with numeric representation -45. | |
_MAKE_ERROR (46, ERR_SERVICE_NOT_FOUND) | |
Create error type ERR_SERVICE_NOT_FOUND with numeric representation -46. | |
_MAKE_ERROR (47, ERR_DAU) | |
Create error type ERR_DAU with numeric representation -47. | |
_MAKE_ERROR (48, ERR_IDLE_NOWAIT) | |
Create error type ERR_IDLE_NOWAIT with numeric representation -48. | |
_MAKE_ERROR (49, ERR_OUT_OF_RANGE) | |
Create error type ERR_OUT_OF_RANGE with numeric representation -49. | |
_MAKE_ERROR (50, ERR_KNOWN_PROBLEM) | |
Create error type ERR_KNOWN_PROBLEM with numeric representation -50. | |
_MAKE_ERROR (51, ERR_INVALID_INTERFACE) | |
Create error type ERR_INVALID_INTERFACE with numeric representation -51. | |
_MAKE_ERROR (52, ERR_INTERNAL) | |
This one is only for internal use and must not be obtained by any customer!!! Also note: The error code must be increased if a new error object is added. | |
tBool | operator== (const tErrorCode &lhs, const tErrorCode &rhs) |
Compare two POD error code types for equality. More... | |
tBool | operator!= (const tErrorCode &lhs, const tErrorCode &rhs) |
Compare two POD error code types for inequality. More... | |
tBool | operator< (const tErrorCode &lhs, const tErrorCode &rhs) |
Less-than operator for POD error type. More... | |
tBool | operator> (const tErrorCode &lhs, const tErrorCode &rhs) |
Greater-than operator for POD error type. More... | |
tBool | operator<= (const tErrorCode &lhs, const tErrorCode &rhs) |
Less-than-or-equal operator for POD error type. More... | |
tBool | operator>= (const tErrorCode &lhs, const tErrorCode &rhs) |
Greater-than-or-equal operator for POD error type. More... | |
template<tErrorCode::error_code_type ErrorCodeLHS, tErrorCode::error_code_type ErrorCodeRHS> | |
tBool | operator== (const tError< ErrorCodeLHS > &lhs, const tError< ErrorCodeRHS > &rhs) |
Compare two specialized error code types for equality. More... | |
template<tErrorCode::error_code_type ErrorCodeLHS, tErrorCode::error_code_type ErrorCodeRHS> | |
tBool | operator!= (const tError< ErrorCodeLHS > &lhs, const tError< ErrorCodeRHS > &rhs) |
Compare two specialized error code types for inequality. More... | |
template<tErrorCode::error_code_type ErrorCodeLHS, tErrorCode::error_code_type ErrorCodeRHS> | |
tBool | operator< (const tError< ErrorCodeLHS > &lhs, const tError< ErrorCodeRHS > &rhs) |
Less-than operator for two specialized error code types. More... | |
template<tErrorCode::error_code_type ErrorCodeLHS, tErrorCode::error_code_type ErrorCodeRHS> | |
tBool | operator> (const tError< ErrorCodeLHS > &lhs, const tError< ErrorCodeRHS > &rhs) |
Greater-than operator for two specialized error code types. More... | |
template<tErrorCode::error_code_type ErrorCodeLHS, tErrorCode::error_code_type ErrorCodeRHS> | |
tBool | operator<= (const tError< ErrorCodeLHS > &lhs, const tError< ErrorCodeRHS > &rhs) |
Less-than-or-equal operator for two specialized error code types. More... | |
template<tErrorCode::error_code_type ErrorCodeLHS, tErrorCode::error_code_type ErrorCodeRHS> | |
tBool | operator>= (const tError< ErrorCodeLHS > &lhs, const tError< ErrorCodeRHS > &rhs) |
Greater-than-or-equal operator for two specialized error code types. More... | |
Copyright © Audi Electronics Venture GmbH.
All rights reserved
Definition in file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
#define _MAKE_ERROR | ( | _no, | |
_strcode | |||
) |
Create an error type with its name and numeric representation.
The created error type is a specialization of tError with the numeric representation _no
being negated and used as non type template parameter. The created error type may be used to construct tResult with appropriate error information. To get the POD version of the created error type, a static_cast<tErrorCode>
might be used.
[in] | _no | Numeric representation of the error type (gets negated!) |
[in] | _strcode | Name as string for the error type |
Definition at line 164 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
#define LOG_RESULT | ( | code | ) |
Log result to console.
Definition at line 55 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
#define RETURN_AND_LOG_ERROR | ( | code | ) |
Log error code to console and return from the current function.
This requires the calling function's return type to be tResult.
Definition at line 72 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
#define RETURN_AND_LOG_ERROR_STR | ( | code, | |
... | |||
) |
Log custom error description to console and return from the current function.
This requires the calling function's return type to be tResult.
Definition at line 83 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
#define RETURN_IF_FAILED_AND_LOG_ERROR_STR | ( | code, | |
... | |||
) |
Log custom error description to console and return from the current function.
This requires the calling function's return type to be tResult.
Definition at line 93 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
Compare two specialized error code types for inequality.
ErrorCodeLHS | Left hand side numeric error code representation type |
ErrorCodeRHS | Right hand side numeric error code representation type |
[in] | lhs | Left hand side error code |
[in] | rhs | Right hand side error code |
Definition at line 377 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
References operator==().
|
inline |
Compare two POD error code types for inequality.
[in] | lhs | Left hand side error code |
[in] | rhs | Right hand side error code |
Definition at line 305 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
References operator==().
Referenced by Value::operator<().
Less-than operator for two specialized error code types.
ErrorCodeLHS | Left hand side numeric error code representation type |
ErrorCodeRHS | Right hand side numeric error code representation type |
[in] | lhs | Left hand side error code |
[in] | rhs | Right hand side error code |
Definition at line 391 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
|
inline |
Less-than operator for POD error type.
[in] | lhs | Left hand side error code |
[in] | rhs | Right hand side error code |
Definition at line 316 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
References tErrorCode::value.
Referenced by operator>(), and operator>=().
Less-than-or-equal operator for two specialized error code types.
ErrorCodeLHS | Left hand side numeric error code representation type |
ErrorCodeRHS | Right hand side numeric error code representation type |
[in] | lhs | Left hand side error code |
[in] | rhs | Right hand side error code |
Definition at line 419 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
References operator>().
|
inline |
Less-than-or-equal operator for POD error type.
[in] | lhs | Left hand side error code |
[in] | rhs | Right hand side error code |
Definition at line 338 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
References operator>().
Compare two specialized error code types for equality.
ErrorCodeLHS | Left hand side numeric error code representation type |
ErrorCodeRHS | Right hand side numeric error code representation type |
[in] | lhs | Left hand side error code |
[in] | rhs | Right hand side error code |
Definition at line 363 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
|
inline |
Compare two POD error code types for equality.
[in] | lhs | Left hand side error code |
[in] | rhs | Right hand side error code |
Definition at line 294 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
References tErrorCode::value.
Referenced by operator!=(), and Value::operator<().
Greater-than operator for two specialized error code types.
ErrorCodeLHS | Left hand side numeric error code representation type |
ErrorCodeRHS | Right hand side numeric error code representation type |
[in] | lhs | Left hand side error code |
[in] | rhs | Right hand side error code |
Definition at line 405 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
References operator<().
|
inline |
Greater-than operator for POD error type.
[in] | lhs | Left hand side error code |
[in] | rhs | Right hand side error code |
Definition at line 327 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
References operator<().
Referenced by operator<=().
Greater-than-or-equal operator for two specialized error code types.
ErrorCodeLHS | Left hand side numeric error code representation type |
ErrorCodeRHS | Right hand side numeric error code representation type |
[in] | lhs | Left hand side error code |
[in] | rhs | Right hand side error code |
Definition at line 433 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
References operator<().
|
inline |
Greater-than-or-equal operator for POD error type.
[in] | lhs | Left hand side error code |
[in] | rhs | Right hand side error code |
Definition at line 349 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/base/error.h.
References operator<().