8 #ifndef A_UTILS_ERRORS_H
9 #define A_UTILS_ERRORS_H
13 #define ASSERT_IF_POINTER_NULL(_ptr) A_UTILS_ASSERT( nullptr != _ptr );
15 #define ASSERT_IF_POINTER_NULL(_ptr)
18 #define __FUNC__ __func__
56 template<tErrorCode::error_code_type ReturnValue>
69 #define _MAKE_ERROR(_no, _strcode) \
71 struct tError< -_no > \
73 explicit operator tErrorCode() const \
75 return tErrorCode { -_no }; \
77 explicit operator tErrorString() const \
79 return tErrorString { tError<-_no>::error_code, tError<-_no>::str_error_code }; \
81 static constexpr const tChar* const str_error_code = #_strcode; \
82 static constexpr const tErrorCode::error_code_type error_code = -_no; \
84 static const tError<-_no> _strcode = tError<-_no>()
267 template<tErrorCode::error_code_type ErrorCodeLHS, tErrorCode::error_code_type ErrorCodeRHS>
281 template<tErrorCode::error_code_type ErrorCodeLHS, tErrorCode::error_code_type ErrorCodeRHS>
295 template<tErrorCode::error_code_type ErrorCodeLHS, tErrorCode::error_code_type ErrorCodeRHS>
309 template<tErrorCode::error_code_type ErrorCodeLHS, tErrorCode::error_code_type ErrorCodeRHS>
323 template<tErrorCode::error_code_type ErrorCodeLHS, tErrorCode::error_code_type ErrorCodeRHS>
337 template<tErrorCode::error_code_type ErrorCodeLHS, tErrorCode::error_code_type ErrorCodeRHS>
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
int32_t tInt32
type definition for signed integer values (32bit) (platform and compiler independent type).
bool tBool
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent).
tBool operator<(const tErrorCode &lhs, const tErrorCode &rhs)
Less-than operator for POD error type.
#define _MAKE_ERROR(_no, _strcode)
Create an error type with its name and numeric representation.
tBool operator<=(const tErrorCode &lhs, const tErrorCode &rhs)
Less-than-or-equal operator for POD error type.
tBool operator>(const tErrorCode &lhs, const tErrorCode &rhs)
Greater-than operator for POD error type.
tBool operator!=(const tErrorCode &lhs, const tErrorCode &rhs)
Compare two POD error code types for inequality.
tBool operator==(const tErrorCode &lhs, const tErrorCode &rhs)
Compare two POD error code types for equality.
tBool operator>=(const tErrorCode &lhs, const tErrorCode &rhs)
Greater-than-or-equal operator for POD error type.
C++11 POD type to distribute error codes between binary boundaries.
error_code_type value
Value of this error code.
tInt32 error_code_type
Type of the error code.
Basic error type template, specialized by _MAKE_ERROR() to create concrete error types.
Wrapper for stringification of error codes - for usage by struct tError.
const tChar * strErrorCode() const
Get the error code as string representation.
const tChar *const strValue
Pointer to existing error code string.
tErrorString()=default
Default constructor.
tErrorString(const tErrorCode::error_code_type i_nErrorCode, const tChar *i_strErrorCode)
Construct with error code and error string.