Apparatus
Version 1.23
ECS data-oriented workflow for Unreal Engine.
|
Polite outcome with a status and a pointer type result. More...
#include <ApparatusStatus.h>
Public Types | |
using | PayloadType = PayloadT * |
The type of the payload pointer. | |
Public Member Functions | |
constexpr EApparatusStatus | ToStatus () const |
Convert to a status constant. | |
constexpr bool | IsNoop () const |
Check if the outcome is a noop. | |
TPoliteOutcome & | MapStatus (const EApparatusStatus From, const EApparatusStatus To) |
Map the status from a status to a status. | |
PayloadType | GetPayload () const |
Get the payload. | |
template<typename T > | |
TPoliteOutcome< T > | StaticCast () |
Cast the payload pointer statically. | |
template<typename T = PayloadT, more::enable_if_t<!std::is_void< std::decay_t< T > >::value, bool > = true> | |
TPoliteOutcome< T & > | Dereference () |
Dereference. | |
constexpr | operator EApparatusStatus () const |
Convert to a status. | |
operator PayloadType () const | |
Convert to a payload. | |
constexpr bool | IsOK () const |
Convert to success state for using in a conditional expression. | |
template<typename InPayloadT > | |
TPoliteOutcome & | operator+= (const THarshOutcome< InPayloadT > &) |
Accumulate a harsh outcome with an optional payload. | |
TPoliteOutcome & | operator+= (const EApparatusStatus InStatus) |
Accumulate a status within the outcome. | |
constexpr TPoliteOutcome | operator+ (const EApparatusStatus InStatus) const |
template<typename T = PayloadT, typename std::enable_if<!std::is_void< T >::value, int >::type = 0> | |
T * | operator-> () const |
template<typename T = PayloadT, typename std::enable_if<!std::is_void< T >::value, int >::type = 0> | |
T & | operator* () const |
bool | operator== (TYPE_OF_NULLPTR) const |
bool | operator!= (TYPE_OF_NULLPTR) const |
bool | operator== (PayloadT *const Other) const |
bool | operator!= (PayloadT *const Other) const |
bool | operator! () const |
operator bool () const | |
FString | ToString () const |
Initialization | |
constexpr | TPoliteOutcome () |
Initialize a default polite pointer outcome using a noop status and a null pointer. | |
template<typename InPayloadT > | |
constexpr | TPoliteOutcome (const InPayloadT InPayload) |
Initialize a polite pointer outcome using a payload only. | |
constexpr | TPoliteOutcome (const EApparatusStatus InStatus) |
Initialize a polite pointer outcome using a status and a null pointer. | |
template<typename InPayloadT > | |
constexpr | TPoliteOutcome (const EApparatusStatus InStatus, const InPayloadT InPayload) |
Initialize a polite pointer outcome using a status and a payload. | |
template<typename InPayloadT > | |
constexpr | TPoliteOutcome (const THarshOutcome< InPayloadT > &InOutcome) |
Initialize a polite outcome using a harsh outcome. | |
template<typename InPayloadT > | |
constexpr | TPoliteOutcome (const TPoliteOutcome< InPayloadT > &InOutcome) |
Initialize a copy of the polite outcome. | |
template<typename AnyPayloadT , typename InPayloadT > | |
constexpr | TPoliteOutcome (const THarshOutcome< AnyPayloadT > &InOutcome, InPayloadT *const InPayload) |
Initialize a polite outcome using a harsh outcome and a payload override. | |
template<typename AnyPayloadT , typename InPayloadT > | |
constexpr | TPoliteOutcome (const TPoliteOutcome< AnyPayloadT > &InOutcome, InPayloadT *const InPayload) |
Initialize a polite outcome copy with a payload override. | |
Static Public Member Functions | |
static constexpr TPoliteOutcome< PayloadT * > | Success (TYPE_OF_NULLPTR) |
A constant denoting a successful operation outcome. | |
static constexpr TPoliteOutcome< PayloadT * > | Noop (TYPE_OF_NULLPTR) |
A constant denoting a successful skip of any actions. | |
static constexpr TPoliteOutcome< PayloadT * > | Success (PayloadT *const InPayload) |
A constant denoting a successful operation outcome. | |
static constexpr TPoliteOutcome< PayloadT * > | Noop (PayloadT *const InPayload) |
A constant denoting a successful skip of any actions. | |
Public Attributes | |
EApparatusStatus | Status |
The embedded status of the outcome. | |
PayloadType | Payload |
The embedded payload pointer. | |
Polite outcome with a status and a pointer type result.
PayloadT | The pointed payload type. |
using TPoliteOutcome< PayloadT * >::PayloadType = PayloadT* |
The type of the payload pointer.
|
inlineconstexpr |
Initialize a default polite pointer outcome using a noop status and a null pointer.
|
inlineconstexpr |
Initialize a polite pointer outcome using a payload only.
Any payload is considered to be a success.
InPayloadT | The type of the payload to initialize with. |
InPayload | The payload to initialize with. |
|
inlineconstexpr |
Initialize a polite pointer outcome using a status and a null pointer.
InStatus | The status to initialize with. |
|
inlineconstexpr |
Initialize a polite pointer outcome using a status and a payload.
InPayloadT | The type of the payload to initialize with. |
InStatus | The status to initialize with. |
InPayload | The payload to initialize with. |
|
inlineconstexpr |
Initialize a polite outcome using a harsh outcome.
Any harsh outcome is considered to be a success.
InPayloadT | The type of the payload. |
InOutcome | The outcome to initialize from. |
|
inlineconstexpr |
Initialize a copy of the polite outcome.
InPayloadT | The type of the payload. |
InOutcome | The outcome to copy. |
|
inlineconstexpr |
Initialize a polite outcome using a harsh outcome and a payload override.
AnyPayloadT | The type of the harsh outcome payload. Used for deduction only. |
InPayloadT | The type of the payload override. |
InOutcome | The outcome to initialize from. This is basically ignored here. |
InPayload | The payload pointer to initialize with. |
|
inlineconstexpr |
Initialize a polite outcome copy with a payload override.
AnyPayloadT | The type of the polite outcome payload. Used for deduction only. |
InPayloadT | The pointed type of the payload override. |
InOutcome | The outcome to initialize from. This is basically ignored here. |
InPayload | The payload pointer to initialize with. |
|
inline |
Dereference.
|
inline |
Get the payload.
|
inlineconstexpr |
Check if the outcome is a noop.
|
inlineconstexpr |
Convert to success state for using in a conditional expression.
Returns true
for successful statuses, false
otherwise.
|
inline |
Map the status from a status to a status.
From | The status to map from. |
To | The status to map to. |
|
inlinestaticconstexpr |
A constant denoting a successful skip of any actions.
|
inlinestaticconstexpr |
A constant denoting a successful skip of any actions.
|
inline |
|
inlineconstexpr |
Convert to a status.
This is an explicit conversion for a polite outcome.
|
inline |
Convert to a payload.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
|
inline |
Accumulate a status within the outcome.
InStatus | The status to accumulate. |
|
inline |
Accumulate a harsh outcome with an optional payload.
This is semantically equivalent to accumulating a success status since any harsh outcome is already a success.
InPayloadT | The payload of the harsh outcome. |
|
inline |
|
inline |
|
inline |
|
inline |
Cast the payload pointer statically.
The | type to cast to. |
|
inlinestaticconstexpr |
A constant denoting a successful operation outcome.
|
inlinestaticconstexpr |
A constant denoting a successful operation outcome.
|
inlineconstexpr |
Convert to a status constant.
|
inline |
PayloadType TPoliteOutcome< PayloadT * >::Payload |
The embedded payload pointer.
EApparatusStatus TPoliteOutcome< PayloadT * >::Status |
The embedded status of the outcome.