ADTF
|
A common result class usable as return value throughout. More...
Classes | |
struct | sErrorEval |
Used as entry point for comparison on the error codes used in IsEqual() More... | |
struct | sErrorEval< ErrorType > |
Used as exit point for comparison on the error codes used in IsEqual() More... | |
Public Member Functions | |
cResult () | |
Construct empty which basically means no error occurred. More... | |
cResult (decltype(ERR_NOERROR)) | |
Construct with ERR_NOERROR. More... | |
template<tErrorCode::error_code_type ErrorCode> | |
cResult (const tError< ErrorCode > &i_oError) | |
Assign error code to result object. More... | |
cResult (tErrorCode i_oError) | |
Assign error code to result object. More... | |
template<tErrorCode::error_code_type ErrorCode> | |
cResult (tError< ErrorCode > i_oError, const tChar *i_strErrorDescription, tInt32 i_nLine, const tChar *i_strFile, const tChar *i_strFunction) | |
Construct result object with complete set of error information. More... | |
cResult (tErrorCode::error_code_type i_nErrorCode) | |
Create result object with just the error code type. More... | |
cResult (tErrorCode::error_code_type i_nErrorCode, const tChar *i_strErrorDescription, tInt32 i_nLine, const tChar *i_strFile, const tChar *i_strFunction) | |
Create result object with complete set of error information from just an error code. More... | |
cResult (const cResult &i_oResult, const tChar *i_strErrorDescription, tInt32 i_nLine, const tChar *i_strFile, const tChar *i_strFunction) | |
Create result object from another result, creating new detailed information. More... | |
~cResult () | |
Destructor. | |
cResult (const cResult &i_oOther) | |
Copy constructor. More... | |
cResult & | operator= (decltype(ERR_NOERROR)) |
Assign with ERR_NOERROR. More... | |
cResult & | operator= (cResult i_oOther) |
Assignment operator. More... | |
cResult (cResult &&i_oOther) | |
Move operator. More... | |
tErrorCode | GetErrorCode () const |
Get error code. More... | |
const tChar * | GetErrorString () const |
Get error code as string representation. More... | |
const tChar * | GetDescription () const |
Get user provided error description. More... | |
tInt32 | GetLine () const |
Get line in source file where the error was reported. More... | |
const tChar * | GetFile () const |
Get name of the file the error was reported in. More... | |
const tChar * | GetFunction () const |
Get name of the function the error was reported in. More... | |
template<tErrorCode::error_code_type ErrorCode> | |
tBool | IsEqual (const tError< ErrorCode > &i_oErrorVal) const |
Check whether an error code is equal to the contained one. More... | |
template<typename ... ErrorTypes> | |
tBool | IsEqual (const ErrorTypes &... i_oErrorVals) const |
Check whether one of several error codes is equal to the contained one. More... | |
tBool | IsOk () const |
Check whether this result object contains ERR_NOERROR . More... | |
tBool | IsFailed () const |
Check whether this result object contains an error != ERR_NOERROR . More... | |
Private Types | |
typedef detail::result_description< detail::IErrorDescription > | description_type |
Abbreviation typedef. | |
Private Member Functions | |
cResult (tErrorCode i_nErrorCode, const tChar *i_strErrorDescription, tInt32 i_nLine, const tChar *i_strFile, const tChar *i_strFunction, const tChar *i_strErrorCode) | |
Construct result object with complete set of error information. More... | |
Static Private Member Functions | |
static cResult | CreateFrom (tErrorCode::error_code_type i_nErrorCode, const tChar *i_strErrorDescription, tInt32 i_nLine, const tChar *i_strFile, const tChar *i_strFunction) |
Create a detailed object of type cResult on the heap from an error code. More... | |
static tErrorString | GetErrorString (const tErrorCode &i_oErrorCode) |
Query the string representation of an error code. More... | |
Private Attributes | |
description_type | m_oResultHandler |
The result handler wrapper. | |
A common result class usable as return value throughout.
Definition at line 17 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
|
inline |
Construct empty which basically means no error occurred.
Definition at line 287 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
Referenced by cResult::cResult(), and cResult::operator=().
|
inline |
Construct with ERR_NOERROR.
This constructors sole intention is to provide the best match during compilation time if a function call returns with ERR_NOERROR. With decltype(ERR_NOERROR) being another type than all other error codes the compiler deduces this constructor as best fit.
Definition at line 291 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
Assign error code to result object.
[in] | i_oError | The error code |
Definition at line 296 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
|
inline |
Assign error code to result object.
[in] | i_oError | The error code |
Definition at line 301 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
|
inlineexplicit |
Construct result object with complete set of error information.
ErrorCode | Error code (to deduce specialized template to stringify the error code) |
[in] | i_oError | The The concrete error object |
[in] | i_strErrorDescription | Complete description of the error (default: "") |
[in] | i_nLine | Line in source file the error was reported (default: -1) |
[in] | i_strFile | Source file the error was reported in (default: "") |
[in] | i_strFunction | Function the error was reported in (default: "") |
Definition at line 307 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
|
inlineexplicit |
Create result object with just the error code type.
[in] | i_nErrorCode | The error code |
Definition at line 321 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
|
inlineexplicit |
Create result object with complete set of error information from just an error code.
[in] | i_nErrorCode | The error code |
[in] | i_strErrorDescription | Complete description of the error (default: "") |
[in] | i_nLine | Line in source file the error was reported (default: -1) |
[in] | i_strFile | Source file the error was reported in (default: "") |
[in] | i_strFunction | Function the error was reported in (default: "") |
Definition at line 326 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
|
inlineexplicit |
Create result object from another result, creating new detailed information.
[in] | i_oResult | Result to copy the error code and error code string information from. |
[in] | i_strErrorDescription | Complete description of the error. |
[in] | i_nLine | Line in source file the error was reported. |
[in] | i_strFile | Source file the error was reported in. |
[in] | i_strFunction | Function the error was reported in. |
Definition at line 335 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
Copy constructor.
[in] | i_oOther | Where this gets copied from. |
i_oOther
are safely referenced in the new created object of type cResult
. Move operator.
[in] | i_oOther | rvalue of type cResult moved to *this. Left in an empty but valid state. |
Definition at line 360 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
References cResult::cResult(), and cResult::swap.
|
explicitprivate |
Construct result object with complete set of error information.
[in] | i_nErrorCode | The error code |
[in] | i_strErrorDescription | Complete description of the error (default: "") |
[in] | i_nLine | Line in source file the error was reported (default: -1) |
[in] | i_strFile | Source file the error was reported in (default: "") |
[in] | i_strFunction | Function the error was reported in (default: "") |
[in] | i_strErrorCode | String representation of error code (default: "") |
|
staticprivate |
Create a detailed object of type cResult
on the heap from an error code.
[in] | i_nErrorCode | The error code to create the result object from. |
[in] | i_strErrorDescription | Complete description of the error (default: "") |
[in] | i_nLine | Line in source file the error was reported (default: -1) |
[in] | i_strFile | Source file the error was reported in (default: "") |
[in] | i_strFunction | Function the error was reported in (default: "") |
cResult
containing detailed error information. const tChar* GetDescription | ( | ) | const |
Get user provided error description.
tErrorCode GetErrorCode | ( | ) | const |
const tChar* GetErrorString | ( | ) | const |
Get error code as string representation.
|
staticprivate |
Query the string representation of an error code.
[in] | i_oErrorCode | The error code to retrieve the string representation of. This only works for known error types listed in file error.h |
const tChar* GetFile | ( | ) | const |
Get name of the file the error was reported in.
const tChar* GetFunction | ( | ) | const |
Get name of the function the error was reported in.
tInt32 GetLine | ( | ) | const |
Get line in source file where the error was reported.
|
inline |
Check whether one of several error codes is equal to the contained one.
ErrorTypes | Compile time constant error code values |
[in] | i_oErrorVals | The error values to compare with. |
Definition at line 396 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
References cResult::sErrorEval< ErrorType, ErrorTypes >::dispatch(), and cResult::GetErrorCode().
Check whether an error code is equal to the contained one.
ErrorCode | Compile time constant error code value |
[in] | i_oErrorVal | The error value to compare with. |
Definition at line 390 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
References cResult::GetErrorCode().
Referenced by A_UTILS_NS::operator!=(), A_UTILS_NS::operator==(), and adtf::streaming::ant::operator==().
|
inline |
Check whether this result object contains an error != ERR_NOERROR
.
Definition at line 384 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
References cResult::IsOk().
Referenced by cBitSerializer::Read(), and cBitSerializer::Write().
|
inline |
Check whether this result object contains ERR_NOERROR
.
Definition at line 379 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
References cResult::GetErrorCode().
Referenced by cResult::IsFailed().
Assignment operator.
[in] | i_oOther | Result type being assigned to the this object. |
i_oOther
by value is fully intentional here! Definition at line 349 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
References cResult::swap.
|
inline |
Assign with ERR_NOERROR.
This assignments sole intention is to provide the best match during compilation time if a function call returns with ERR_NOERROR. With decltype(ERR_NOERROR) being another type than all other error codes the compiler deduces this assignment operator as best fit.
Definition at line 355 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.
References cResult::cResult().