Apparatus
Version 1.23
ECS data-oriented workflow for Unreal Engine.
|
Harsh outcome with no status but an optional payload. More...
#include <ApparatusStatus.h>
Public Types | |
using | PayloadType = PayloadT |
The type of the payload. | |
Public Member Functions | |
constexpr EApparatusStatus | ToStatus () const |
Convert to a status constant. | |
constexpr bool | IsNoop () const |
Check if the outcome is a noop. | |
THarshOutcome & | MapStatus (const EApparatusStatus From, const EApparatusStatus To) |
Map the status from a status to a status. | |
constexpr PayloadT | GetPayload () const |
Get the payload of the outcome. | |
template<typename T > | |
THarshOutcome< T > | StaticCast () |
Cast the payload statically. | |
THarshOutcome< PayloadT & > | Dereference () |
Dereference. | |
constexpr | operator EApparatusStatus () const |
Convert to a successful status. | |
constexpr | operator PayloadT () const |
Convert to a payload. | |
auto | operator-> () const |
A non-empty outcomes serves as a pointer to its payload by default. | |
constexpr const PayloadT & | operator* () const |
Get a constant reference to a payload. | |
constexpr PayloadT & | operator* () |
Get a reference to a payload. | |
constexpr bool | IsOK () const |
Convert to successful state for using in a conditional expression. | |
bool | operator== (const PayloadT &Other) const |
bool | operator!= (const PayloadT &Other) const |
THarshOutcome & | operator+= (const THarshOutcome &) |
THarshOutcome & | operator+= (const EApparatusStatus InStatus) |
THarshOutcome | operator+ (const EApparatusStatus InStatus) const |
FString | ToString () const |
template<typename InPayloadT > | |
constexpr | THarshOutcome (InPayloadT &&InPayload) |
Initialize a harsh outcome using payload only. | |
THarshOutcome (const EApparatusStatus InStatus) | |
Initialize a harsh outcome using a status and a default payload. | |
template<typename InPayloadT > | |
THarshOutcome (const EApparatusStatus InStatus, InPayloadT &&InPayload) | |
Initialize a harsh outcome using a status and moving a payload. | |
template<typename InPayloadT > | |
THarshOutcome (const TPoliteOutcome< InPayloadT > &InOutcome) | |
Convert from a polite outcome. | |
template<typename InPayloadT > | |
THarshOutcome (TPoliteOutcome< InPayloadT > &&InOutcome) | |
Move a polite outcome to a harsh one. | |
template<typename InAnyPayloadT , typename InPayloadT > | |
constexpr | THarshOutcome (const THarshOutcome< InAnyPayloadT > &InOutcome, InPayloadT &&InPayload) |
Initialize a harsh outcome using a harsh outcome and a payload override. | |
Static Public Member Functions | |
static constexpr THarshOutcome< PayloadT > | Success (const PayloadT &InPayload) |
A constant denoting a successful operation outcome. | |
static constexpr THarshOutcome< PayloadT > | Noop (const PayloadT &InPayload) |
A constant denoting a successful skip of any actions. | |
Public Attributes | |
PayloadT | Payload |
The payload of the outcome. | |
Harsh outcome with no status but an optional payload.
PayloadT | The optional payload to provide. |
using THarshOutcome< PayloadT >::PayloadType = PayloadT |
The type of the payload.
|
inlineconstexpr |
Initialize a harsh outcome using payload only.
InPayloadT | The payload type. |
InPayload | The payload to move. |
|
inline |
Initialize a harsh outcome using a status and a default payload.
InPayloadT | The payload type. |
InStatus | The status to initialize with. Must be a successful one. |
|
inline |
Initialize a harsh outcome using a status and moving a payload.
InPayloadT | The payload type. |
InStatus | The status to initialize with. Must be a successful one. |
InPayload | The payload to move. |
|
inline |
Convert from a polite outcome.
Will assert the outcome is a successful one.
InPayloadT | The type of the payload carried by the passed-in outcome. |
InOutcome | The polite outcome to convert from. Must be a successful one. |
|
inline |
Move a polite outcome to a harsh one.
Will assert the outcome is a successful one.
InPayloadT | The type of the payload carried by the passed-in outcome. |
InOutcome | The polite outcome to move. Must be a successful one. |
|
inlineconstexpr |
Initialize a harsh outcome using a harsh outcome and a payload override.
InAnyPayloadT | The payload type of the incoming outcome. This is used for deduction only ignored. |
InOutcome | The outcome to initialize from. This is basically ignored here. |
InPayload | The payload override to initialize with. |
|
inline |
Dereference.
|
inlineconstexpr |
Get the payload of the outcome.
|
inlineconstexpr |
Check if the outcome is a noop.
|
inlineconstexpr |
Convert to successful state for using in a conditional expression.
This always return true
, since every harsh result is already a success.
|
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.
InPayload | The payload to initialize with. |
|
inlineexplicitconstexpr |
Convert to a successful status.
This operation should always be an explicit one for a harsh outcome, since the user should absolutely be aware of what he's actually doing.
|
inlineconstexpr |
Convert to a payload.
This operator is an implicit one to be able to use the valuable outcome in place of a value itself.
|
inline |
|
inlineconstexpr |
Get a reference to a payload.
|
inlineconstexpr |
Get a constant reference to a payload.
|
inline |
|
inline |
|
inline |
|
inline |
A non-empty outcomes serves as a pointer to its payload by default.
|
inline |
|
inline |
Cast the payload statically.
The | type to cast to. |
|
inlinestaticconstexpr |
A constant denoting a successful operation outcome.
InPayload | The payload to initialize with. |
|
inlineconstexpr |
Convert to a status constant.
|
inline |
PayloadT THarshOutcome< PayloadT >::Payload |
The payload of the outcome.