ADTF
|
Serves as component for functionality handling error and return types. More...
Namespaces | |
detail | |
Serves as namespace for result implementation details. | |
Classes | |
struct | ResultInfo |
Basic result information template, used by a_util::result::Result . More... | |
struct | ResultInfo< void > |
Implements basic success result information for usage with a_util::result::Result . More... | |
class | Result |
A common result class usable as return value throughout. More... | |
Enumerations | |
enum | ResultFormatFlags { DisableNone = 0x00 , DisableCode = 0x01 , DisableName = 0x02 , DisableMessage = 0x04 , DisableFile = 0x08 , DisableLine = 0x10 , DisableFunction = 0x20 } |
Define flags. More... | |
Functions | |
template<typename ResultType > | |
bool | isOk (const ResultType &result) |
Check whether a return value indicates a successful function execution. More... | |
template<typename ResultType > | |
bool | isFailed (const ResultType &result) |
Check whether a return value indicates an unsuccessful function execution. More... | |
template<typename ResultTypeLHS , typename ResultTypeRHS > | |
bool | operator== (const ResultInfo< ResultTypeLHS > &lhs, const ResultInfo< ResultTypeRHS > &rhs) |
Compare two specialized result information objects for equality. More... | |
template<typename ResultTypeLHS , typename ResultTypeRHS > | |
bool | operator!= (const ResultInfo< ResultTypeLHS > &lhs, const ResultInfo< ResultTypeRHS > &rhs) |
Compare two specialized result information objects for inequality. More... | |
template<typename ResultTypeLHS , typename ResultTypeRHS > | |
bool | operator< (const ResultInfo< ResultTypeLHS > &lhs, const ResultInfo< ResultTypeRHS > &rhs) |
Less-than operator for two specialized result information objects. More... | |
template<typename ResultTypeLHS , typename ResultTypeRHS > | |
bool | operator> (const ResultInfo< ResultTypeLHS > &lhs, const ResultInfo< ResultTypeRHS > &rhs) |
Greater-than operator for two specialized result information objects. More... | |
template<typename ResultTypeLHS , typename ResultTypeRHS > | |
bool | operator<= (const ResultInfo< ResultTypeLHS > &lhs, const ResultInfo< ResultTypeRHS > &rhs) |
Less-than-or-equal operator for two specialized result information objects. More... | |
template<typename ResultTypeLHS , typename ResultTypeRHS > | |
bool | operator>= (const ResultInfo< ResultTypeLHS > &lhs, const ResultInfo< ResultTypeRHS > &rhs) |
Greater-than-or-equal operator for two specialized result information objects. More... | |
bool | operator== (const Result &lhs, const Result &rhs) |
bool | operator!= (const Result &lhs, const Result &rhs) |
Negated comparison operator (shallow comparison) More... | |
template<typename T > | |
bool | operator== (const Result &result, const ResultInfo< T > &error_code) |
Comparison operator (equality) for objects of type Result and ResultInfo. More... | |
template<typename T > | |
bool | operator!= (const Result &result, const ResultInfo< T > &error_code) |
Comparison operator (inequality) for objects of type Result and ResultInfo. More... | |
template<typename T > | |
bool | operator== (const ResultInfo< T > &error_code, const Result &result) |
Comparison operator (equality) for objects of type Result and ResultInfo. More... | |
template<typename T > | |
bool | operator!= (const ResultInfo< T > &error_code, const Result &result) |
Comparison operator (inequality) for objects of type Result and ResultInfo. More... | |
void | swap (Result &lhs, Result &rhs) |
template<> | |
bool | isOk< Result > (const Result &result) |
Specialization of a_util::result::isOk<typename ResultType>() for correct lookup. More... | |
std::string | toString (const Result &result, ResultFormatFlags formatting_flags=DisableNone, const char *format=nullptr) |
Copy all information of an assigned result object to a (formatted) string. More... | |
Serves as component for functionality handling error and return types.
enum ResultFormatFlags |
Define flags.
Definition at line 28 of file workspace/conan/dev_essential/1.5.0/dw/stable/package/aef85909f792a5a628750d25016a24323084963f/include/a_util/result/result_util.h.
|
inline |
Check whether a return value indicates an unsuccessful function execution.
ResultType | Type of the result value |
[in] | result | Value of the result type |
true
if result
indicates failure, false
otherwise. Definition at line 30 of file result_info_impl.h.
References isOk().
|
inline |
Check whether a return value indicates a successful function execution.
ResultType | Type of the result value |
[in] | result | Value of the result type |
true
if result
indicates success, false
otherwise. Definition at line 24 of file result_info_impl.h.
Referenced by isFailed().
Specialization of a_util::result::isOk<typename ResultType>()
for correct lookup.
[in] | result | Result instance to check for error |
true
, otherwise false
Definition at line 267 of file result_type_impl.h.
References Result::getErrorCode().
Negated comparison operator (shallow comparison)
[in,out] | lhs | Left hand side result object. |
[in,out] | rhs | Right hand side result object. |
true
if both result objects do not match, false
otherwise. Definition at line 230 of file result_type_impl.h.
|
inline |
Comparison operator (inequality) for objects of type Result and ResultInfo.
T | Error code type handled by ResultInfo<> |
[in] | result | Left hand side result object |
[in] | error_code | Right hand side error object |
true
if both objects contain different error codes, false
otherwise Definition at line 242 of file result_type_impl.h.
|
inline |
Compare two specialized result information objects for inequality.
ResultTypeLHS | Left hand side result type |
ResultTypeRHS | Right hand side result type |
[in] | lhs | Left hand side result information |
[in] | rhs | Right hand side result information |
false
if rhs and lhs are equal, true
otherwise. Definition at line 66 of file result_info_impl.h.
References operator==().
|
inline |
Comparison operator (inequality) for objects of type Result and ResultInfo.
T | Error code type handled by ResultInfo<> |
[in] | error_code | Left hand side error object |
[in] | result | Right hand side result object |
true
if both objects contain different error codes, false
otherwise Definition at line 254 of file result_type_impl.h.
|
inline |
Less-than operator for two specialized result information objects.
ResultTypeLHS | Left hand side result type |
ResultTypeRHS | Right hand side result type |
[in] | lhs | Left hand side result information |
[in] | rhs | Right hand side result information |
true
if lhs is less than rhs, false
otherwise. Definition at line 72 of file result_info_impl.h.
References ResultInfo< T >::getCode().
Referenced by operator>(), and operator>=().
|
inline |
Less-than-or-equal operator for two specialized result information objects.
ResultTypeLHS | Left hand side result type |
ResultTypeRHS | Right hand side result type |
[in] | lhs | Left hand side result information |
[in] | rhs | Right hand side result information |
true
if lhs is less than or equal rhs, false
otherwise. Definition at line 84 of file result_info_impl.h.
References operator>().
[in,out] | lhs | Left hand side result object. |
[in,out] | rhs | Right hand side result object. |
true
if both result objects match, false
otherwise. Definition at line 225 of file result_type_impl.h.
|
inline |
Comparison operator (equality) for objects of type Result and ResultInfo.
T | Error code type handled by ResultInfo<> |
[in] | result | Left hand side result object |
[in] | error_code | Right hand side error object |
true
if both objects contain the same error code, false
otherwise Definition at line 236 of file result_type_impl.h.
References ResultInfo< T >::getCode(), and Result::getErrorCode().
|
inline |
Compare two specialized result information objects for equality.
ResultTypeLHS | Left hand side result type |
ResultTypeRHS | Right hand side result type |
[in] | lhs | Left hand side result information |
[in] | rhs | Right hand side result information |
true
if rhs and lhs are equal, false
otherwise. Definition at line 58 of file result_info_impl.h.
References ResultInfo< T >::getCode(), ResultInfo< T >::getLabel(), and a_util::maybe_unused().
Referenced by operator!=().
|
inline |
Comparison operator (equality) for objects of type Result and ResultInfo.
T | Error code type handled by ResultInfo<> |
[in] | error_code | Left hand side error object |
[in] | result | Right hand side result object |
true
if both objects contain the same error code, false
otherwise Definition at line 248 of file result_type_impl.h.
|
inline |
Greater-than operator for two specialized result information objects.
ResultTypeLHS | Left hand side result type |
ResultTypeRHS | Right hand side result type |
[in] | lhs | Left hand side result information |
[in] | rhs | Right hand side result information |
false
if lhs is less than or equal rhs, true
otherwise. Definition at line 78 of file result_info_impl.h.
References operator<().
Referenced by operator<=().
|
inline |
Greater-than-or-equal operator for two specialized result information objects.
ResultTypeLHS | Left hand side result type |
ResultTypeRHS | Right hand side result type |
[in] | lhs | Left hand side result information |
[in] | rhs | Right hand side result information |
false
if lhs is less than rhs, true
otherwise. Definition at line 90 of file result_info_impl.h.
References operator<().
[in,out] | lhs | Left hand side result object. |
[in,out] | rhs | Right hand side result object. |
Definition at line 259 of file result_type_impl.h.
std::string a_util::result::toString | ( | const Result & | result, |
ResultFormatFlags | formatting_flags = DisableNone , |
||
const char * | format = nullptr |
||
) |
Copy all information of an assigned result object to a (formatted) string.
[in] | result | The result instance getting stringified |
[in] | formatting_flags | Flags to disable stringification of specific information offered by Result |
[in] | format | Optional format specifier - if left empty, the default format is used. Currently not implemented. |
Referenced by ddl::codec::detail::readBits(), and ddl::codec::detail::writeBits().