#include <resultbase.h>
Base class for Result.
Public Types | |
| using | ValueType = T |
Public Member Functions | |
| ResultBase () | |
| ResultBase (CopyType value) | |
| ResultBase (MoveType value) | |
| const MAXON_ATTRIBUTE_FORCE_INLINE T & | GetValue () const & |
| const MAXON_ATTRIBUTE_FORCE_INLINE T & | UncheckedGetValue () const & |
| MAXON_MEMBER_ACCESSORS (T, GetValue) | |
| MAXON_MEMBER_ACCESSORS (T, UncheckedGetValue) | |
| const MAXON_ATTRIBUTE_FORCE_INLINE T & | GetValueAndError (ThreadReferencedError &error) const & |
| MAXON_ATTRIBUTE_FORCE_INLINE T | GetValueAndError (ThreadReferencedError &error) && |
| const MAXON_ATTRIBUTE_FORCE_INLINE T & | GetValueAndError (Error &error) const & |
| MAXON_ATTRIBUTE_FORCE_INLINE T | GetValueAndError (Error &error) && |
| const MAXON_ATTRIBUTE_FORCE_INLINE ThreadReferencedError & | GetErrorStorage () const |
| MAXON_ATTRIBUTE_FORCE_INLINE ThreadReferencedError & | GetErrorStorage () |
Static Public Attributes | |
| static const Bool | HAS_ERROR |
Protected Types | |
| using | CopyType = typename ByValueParam< T >::type |
| using | MoveType = typename std::conditional< STD_IS_REPLACEMENT(reference, CopyType), T &&, DummyParamType & >::type |
| using | DeleteType = const DummyParamType && |
| template<typename T2 > | |
| using | ConstructibleFrom = std::enable_if< STD_IS_REPLACEMENT(constructible, T, T2)> |
Protected Attributes | |
| ThreadReferencedError | _error |
| T | _value |
|
protected |
|
protected |
|
protected |
|
protected |
| ResultBase | ( | ) |
|
explicit |
Constructs a new ResultBase with the given value and no error.
| [in] | value | Result value. |
|
explicit |
Constructs a new ResultBase with the given value and no error.
| [in] | value | Result value. |
| const MAXON_ATTRIBUTE_FORCE_INLINE T& GetValue | ( | ) | const & |
Returns the result value. A DebugAssert will trigger if this is invoked when there is an error.
| const MAXON_ATTRIBUTE_FORCE_INLINE T& UncheckedGetValue | ( | ) | const & |
Returns the result value. In case of an error there is no value, then this function returns a null value.
| MAXON_MEMBER_ACCESSORS | ( | T | , |
| GetValue | |||
| ) |
| MAXON_MEMBER_ACCESSORS | ( | T | , |
| UncheckedGetValue | |||
| ) |
| const MAXON_ATTRIBUTE_FORCE_INLINE T& GetValueAndError | ( | ThreadReferencedError & | error | ) | const & |
Returns the result value and error. If there is an error, the parameter #error will be set to the error and a null value is returned.
| [out] | error | This parameter receives the error (or a nullptr if there is no error). |
| MAXON_ATTRIBUTE_FORCE_INLINE T GetValueAndError | ( | ThreadReferencedError & | error | ) | && |
Returns the result value and error. If there is an error, the parameter #error will be set to the error and a null value is returned.
| [out] | error | This parameter receives the error (or a nullptr if there is no error). |
| const MAXON_ATTRIBUTE_FORCE_INLINE T& GetValueAndError | ( | Error & | error | ) | const & |
Returns the result value and error. If there is an error, the parameter #error will be set to the error and a null value is returned.
| [out] | error | This parameter receives the error (or a nullptr if there is no error). |
| MAXON_ATTRIBUTE_FORCE_INLINE T GetValueAndError | ( | Error & | error | ) | && |
Returns the result value and error. If there is an error, the parameter #error will be set to the error and a null value is returned.
| [out] | error | This parameter receives the error (or a nullptr if there is no error). |
| const MAXON_ATTRIBUTE_FORCE_INLINE ThreadReferencedError& GetErrorStorage | ( | ) | const |
Returns a reference to the ThreadReferencedError storage in which the Result stores its error.
| MAXON_ATTRIBUTE_FORCE_INLINE ThreadReferencedError& GetErrorStorage | ( | ) |
Returns a reference to the ThreadReferencedError storage in which the Result stores its error.
|
static |
|
protected |
|
protected |