|
ADTF
|
A common result class usable as return value throughout. More...
#include <result.h>
Classes | |
| struct | sErrorEval< ErrorType > |
Used as exit point for comparison on the error codes used in IsEqual() More... | |
Public Member Functions | |
| constexpr | cResult () noexcept |
| Construct empty which basically means no error occurred. | |
| constexpr | cResult (decltype(ERR_NOERROR)) noexcept |
| Construct with ERR_NOERROR. | |
| template<tErrorCode::error_code_type ErrorCode> | |
| constexpr | cResult (const tError< ErrorCode > &i_oError) noexcept |
| Assign error code to result object. | |
| constexpr | cResult (tErrorCode i_oError) noexcept |
| Assign error code to result object. | |
| 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) noexcept | |
| Construct result object with complete set of error information. | |
| constexpr | cResult (tErrorCode::error_code_type i_nErrorCode) noexcept |
| Create result object with just the error code type. | |
| cResult (tErrorCode::error_code_type i_nErrorCode, const tChar *i_strErrorDescription, tInt32 i_nLine, const tChar *i_strFile, const tChar *i_strFunction) noexcept | |
| Create result object with complete set of error information from just an error code. | |
| cResult (const cResult &i_oResult, const tChar *i_strErrorDescription, tInt32 i_nLine, const tChar *i_strFile, const tChar *i_strFunction) noexcept | |
| Create result object from another result, creating new detailed information. | |
| ~cResult () noexcept | |
| Destructor. | |
| cResult (const cResult &i_oOther) noexcept | |
| Copy constructor. | |
| cResult & | operator= (decltype(ERR_NOERROR)) noexcept |
| Assign with ERR_NOERROR. | |
| cResult & | operator= (cResult i_oOther) noexcept |
| Assignment operator. | |
| constexpr | cResult (cResult &&i_oOther) noexcept |
| Move operator. | |
| tErrorCode | GetErrorCode () const noexcept |
| Get error code. | |
| const tChar * | GetErrorString () const noexcept |
| Get error code as string representation. | |
| const tChar * | GetDescription () const noexcept |
| Get user provided error description. | |
| tInt32 | GetLine () const noexcept |
| Get line in source file where the error was reported. | |
| const tChar * | GetFile () const noexcept |
| Get name of the file the error was reported in. | |
| const tChar * | GetFunction () const noexcept |
| Get name of the function the error was reported in. | |
| template<tErrorCode::error_code_type ErrorCode> | |
| tBool | IsEqual (const tError< ErrorCode > &i_oErrorVal) const noexcept |
| Check whether an error code is equal to the contained one. | |
| template<typename... ErrorTypes> | |
| tBool | IsEqual (const ErrorTypes &... i_oErrorVals) const noexcept |
| Check whether one of several error codes is equal to the contained one. | |
| tBool | IsOk () const noexcept |
Check whether this result object contains ERR_NOERROR. | |
| tBool | IsFailed () const noexcept |
Check whether this result object contains an error != ERR_NOERROR. | |
Friends | |
| void | swap (cResult &i_oLHS, cResult &i_oRHS) |
| Specialized friend swap function to enable ADL in std::swap later. | |
| tBool | operator== (const cResult &i_oLHS, const cResult &i_oRHS) |
| Comparison operator (shallow comparison) | |
A common result class usable as return value throughout.
|
inlineconstexprnoexcept |
Construct empty which basically means no error occurred.
|
inlineconstexprnoexcept |
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.
|
inlineconstexprnoexcept |
Assign error code to result object.
| [in] | i_oError | The error code |
|
inlineconstexprnoexcept |
Assign error code to result object.
| [in] | i_oError | The error code |
|
inlineexplicitnoexcept |
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: "") |
|
inlineexplicitconstexprnoexcept |
Create result object with just the error code type.
| [in] | i_nErrorCode | The error code |
|
inlineexplicitnoexcept |
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: "") |
|
inlineexplicitnoexcept |
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. |
|
noexcept |
Copy constructor.
| [in] | i_oOther | Where this gets copied from. |
i_oOther are safely referenced in the new created object of type cResult.
|
inlineconstexprnoexcept |
Move operator.
| [in] | i_oOther | rvalue of type cResult moved to *this. Left in an empty but valid state. |
|
noexcept |
Get user provided error description.
|
noexcept |
Get error code.
|
noexcept |
Get error code as string representation.
|
noexcept |
Get name of the file the error was reported in.
|
noexcept |
Get name of the function the error was reported in.
|
noexcept |
Get line in source file where the error was reported.
|
inlinenoexcept |
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. |
|
inlinenoexcept |
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. |
|
inlinenoexcept |
Check whether this result object contains an error != ERR_NOERROR.
|
inlinenoexcept |
Check whether this result object contains ERR_NOERROR.
Assignment operator.
| [in] | i_oOther | Result type being assigned to the this object. |
i_oOther by value is fully intentional here!
|
inlinenoexcept |
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.
Comparison operator (shallow comparison)
| [in,out] | i_oLHS | Left hand side result object. |
| [in,out] | i_oRHS | Right hand side result object. |
Specialized friend swap function to enable ADL in std::swap later.
| [in,out] | i_oLHS | Left hand side result object. |
| [in,out] | i_oRHS | Right hand side result object. |