15 #ifndef A_UTIL_UTIL_RESULT_RESULT_TYPE_DECL_HEADER_INCLUDED
16 #define A_UTIL_UTIL_RESULT_RESULT_TYPE_DECL_HEADER_INCLUDED
27 class IErrorDescription;
70 template <
typename ErrorType>
82 template <
typename ErrorType>
84 const char* error_description,
87 const char*
function);
93 Result(std::int32_t error_code);
103 explicit Result(std::int32_t error_code,
104 const char* error_description,
107 const char*
function);
118 const char* error_description,
121 const char*
function);
218 explicit operator bool()
const noexcept;
245 explicit Result(std::int32_t error_code,
246 const char* error_description,
249 const char*
function,
262 const char* error_description,
265 const char*
function);
288 template <
typename T>
298 template <
typename T>
308 template <
typename T>
318 template <
typename T>
A common result class usable as return value throughout.
const char * getFunction() const
Get name of the function the error was reported in.
const char * getFile() const
Get name of the file the error was reported in.
Result & operator=(const ResultInfo< void > &)
Assign with a_util::result::SUCCESS.
std::int32_t getLine() const
Get line in source file where the error was reported.
Result()
Construct empty which basically means no error occurred.
friend bool operator==(const Result &lhs, const Result &rhs)
Comparison operator (shallow comparison)
const char * getDescription() const
Get user provided error description.
friend void swap(Result &lhs, Result &rhs)
Specialized friend swap function to enable ADL in std::swap later.
std::int32_t getErrorCode() const
Get error code.
detail::ResultDescription< detail::IErrorDescription > DescriptionType
Error description type.
const char * getErrorLabel() const
Get error label as string representation.
static Result createFrom(std::int32_t error_code, const char *error_description, std::int32_t line, const char *file, const char *function)
Create a detailed object of type Result on the heap from an error code.
DescriptionType _result_handle
The result handler wrapper.
#define DEV_ESSENTIAL_DEPRECATED(msg)
Adds [[deprecated("msg")]] to allowed declarations.
bool operator==(const ResultInfo< ResultTypeLHS > &lhs, const ResultInfo< ResultTypeRHS > &rhs)
Compare two specialized result information objects for equality.
bool isOk(const ResultType &result)
Check whether a return value indicates a successful function execution.
bool operator!=(const ResultInfo< ResultTypeLHS > &lhs, const ResultInfo< ResultTypeRHS > &rhs)
Compare two specialized result information objects for inequality.
Serves as the root component, with common functionality documented in core functionality.
Private API for ResultDescription type and functions.
Common include for ResultInfo functionality.
Private implementation for Result type and functions.
Implements basic success result information for usage with a_util::result::Result.
Basic result information template, used by a_util::result::Result.