Ark Server API (ASA) - Wiki
|
#include <ValueOrError.h>
Classes | |
struct | FEmptyType |
struct | FWrapErrorType |
Public Member Functions | |
template<typename... ArgTypes> | |
TValueOrError (TValueOrError_ValueProxy< ArgTypes... > &&Proxy) | |
template<typename... ArgTypes> | |
TValueOrError (TValueOrError_ErrorProxy< ArgTypes... > &&Proxy) | |
bool | IsValid () const |
bool | HasError () const |
ErrorType & | GetError () & |
const ErrorType & | GetError () const & |
ErrorType | GetError () && |
ErrorType * | TryGetError () |
const ErrorType * | TryGetError () const |
ErrorType | StealError () |
bool | HasValue () const |
ValueType & | GetValue () & |
const ValueType & | GetValue () const & |
ValueType | GetValue () && |
ValueType * | TryGetValue () |
const ValueType * | TryGetValue () const |
ValueType | StealValue () |
Private Member Functions | |
template<typename... ArgTypes, uint32... ArgIndices> | |
TValueOrError (TValueOrError_ValueProxy< ArgTypes... > &&Proxy, TIntegerSequence< uint32, ArgIndices... >) | |
template<typename... ArgTypes, uint32... ArgIndices> | |
TValueOrError (TValueOrError_ErrorProxy< ArgTypes... > &&Proxy, TIntegerSequence< uint32, ArgIndices... >) | |
Private Attributes | |
TVariant< ValueType, FWrapErrorType, FEmptyType > | Variant |
Type used to return either a value or an error.
These must have a value or an error when newly constructed, but it is possible to have neither because of the functions to steal the value or error. This is critical for callers to consider since it means that HasValue() and HasError() must be checked independently; a return value of false from one does not imply that the other will return true.
The MakeValue and MakeError functions may be used to construct these conveniently.
Definition at line 48 of file ValueOrError.h.
|
inlineprivate |
Definition at line 64 of file ValueOrError.h.
|
inlineprivate |
Definition at line 70 of file ValueOrError.h.
|
inline |
Construct the value from a proxy from MakeValue.
Definition at line 78 of file ValueOrError.h.
|
inline |
Construct the error from a proxy from MakeError.
Definition at line 85 of file ValueOrError.h.
|
inline |
Access the error. Asserts if this does not have an error.
Definition at line 97 of file ValueOrError.h.
|
inline |
Definition at line 99 of file ValueOrError.h.
|
inline |
Definition at line 98 of file ValueOrError.h.
|
inline |
Access the value. Asserts if this does not have a value.
Definition at line 131 of file ValueOrError.h.
|
inline |
Definition at line 133 of file ValueOrError.h.
|
inline |
Definition at line 132 of file ValueOrError.h.
|
inline |
Whether the error is set. An error does imply no value. No error does not imply that a value is set.
Definition at line 94 of file ValueOrError.h.
|
inline |
Whether the value is set. A value does imply no error. No value does not imply that an error is set.
Definition at line 128 of file ValueOrError.h.
|
inline |
Check whether a value is set. Prefer HasValue and HasError to this. !IsValid() does not imply HasError().
Definition at line 91 of file ValueOrError.h.
|
inline |
Steal the error. Asserts if this does not have an error. This causes the error to be unset.
Definition at line 120 of file ValueOrError.h.
|
inline |
Steal the value. Asserts if this does not have a value. This causes the value to be unset.
Definition at line 140 of file ValueOrError.h.
|
inline |
Access the error if it is set.
Definition at line 102 of file ValueOrError.h.
|
inline |
Definition at line 110 of file ValueOrError.h.
|
inline |
Access the value if it is set.
Definition at line 136 of file ValueOrError.h.
|
inline |
Definition at line 137 of file ValueOrError.h.
|
private |
Definition at line 148 of file ValueOrError.h.