Apparatus Version 1.23
ECS data-oriented workflow for Unreal Engine.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
TPoliteOutcome< PayloadT * > Struct Template Reference

Polite outcome with a status and a pointer type result. More...

#include <ApparatusStatus.h>

Inheritance diagram for TPoliteOutcome< PayloadT * >:
Inheritance graph
[legend]
Collaboration diagram for TPoliteOutcome< PayloadT * >:
Collaboration graph
[legend]

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.
 
TPoliteOutcomeMapStatus (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< TStaticCast ()
 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 >
TPoliteOutcomeoperator+= (const THarshOutcome< InPayloadT > &)
 Accumulate a harsh outcome with an optional payload.
 
TPoliteOutcomeoperator+= (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>
Toperator-> () const
 
template<typename T = PayloadT, typename std::enable_if<!std::is_void< T >::value, int >::type = 0>
Toperator* () 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.
 

Detailed Description

template<typename PayloadT>
struct TPoliteOutcome< PayloadT * >

Polite outcome with a status and a pointer type result.

Template Parameters
PayloadTThe pointed payload type.

Member Typedef Documentation

◆ PayloadType

template<typename PayloadT >
using TPoliteOutcome< PayloadT * >::PayloadType = PayloadT*

The type of the payload pointer.

Constructor & Destructor Documentation

◆ TPoliteOutcome() [1/8]

template<typename PayloadT >
constexpr TPoliteOutcome< PayloadT * >::TPoliteOutcome ( )
inlineconstexpr

Initialize a default polite pointer outcome using a noop status and a null pointer.

◆ TPoliteOutcome() [2/8]

template<typename PayloadT >
template<typename InPayloadT >
constexpr TPoliteOutcome< PayloadT * >::TPoliteOutcome ( const InPayloadT  InPayload)
inlineconstexpr

Initialize a polite pointer outcome using a payload only.

Any payload is considered to be a success.

Template Parameters
InPayloadTThe type of the payload to initialize with.
Parameters
InPayloadThe payload to initialize with.

◆ TPoliteOutcome() [3/8]

template<typename PayloadT >
constexpr TPoliteOutcome< PayloadT * >::TPoliteOutcome ( const EApparatusStatus  InStatus)
inlineconstexpr

Initialize a polite pointer outcome using a status and a null pointer.

Parameters
InStatusThe status to initialize with.

◆ TPoliteOutcome() [4/8]

template<typename PayloadT >
template<typename InPayloadT >
constexpr TPoliteOutcome< PayloadT * >::TPoliteOutcome ( const EApparatusStatus  InStatus,
const InPayloadT  InPayload 
)
inlineconstexpr

Initialize a polite pointer outcome using a status and a payload.

Template Parameters
InPayloadTThe type of the payload to initialize with.
Parameters
InStatusThe status to initialize with.
InPayloadThe payload to initialize with.

◆ TPoliteOutcome() [5/8]

template<typename PayloadT >
template<typename InPayloadT >
constexpr TPoliteOutcome< PayloadT * >::TPoliteOutcome ( const THarshOutcome< InPayloadT > &  InOutcome)
inlineconstexpr

Initialize a polite outcome using a harsh outcome.

Any harsh outcome is considered to be a success.

Template Parameters
InPayloadTThe type of the payload.
Parameters
InOutcomeThe outcome to initialize from.

◆ TPoliteOutcome() [6/8]

template<typename PayloadT >
template<typename InPayloadT >
constexpr TPoliteOutcome< PayloadT * >::TPoliteOutcome ( const TPoliteOutcome< InPayloadT > &  InOutcome)
inlineconstexpr

Initialize a copy of the polite outcome.

Template Parameters
InPayloadTThe type of the payload.
Parameters
InOutcomeThe outcome to copy.

◆ TPoliteOutcome() [7/8]

template<typename PayloadT >
template<typename AnyPayloadT , typename InPayloadT >
constexpr TPoliteOutcome< PayloadT * >::TPoliteOutcome ( const THarshOutcome< AnyPayloadT > &  InOutcome,
InPayloadT *const  InPayload 
)
inlineconstexpr

Initialize a polite outcome using a harsh outcome and a payload override.

Template Parameters
AnyPayloadTThe type of the harsh outcome payload. Used for deduction only.
InPayloadTThe type of the payload override.
Parameters
InOutcomeThe outcome to initialize from. This is basically ignored here.
InPayloadThe payload pointer to initialize with.

◆ TPoliteOutcome() [8/8]

template<typename PayloadT >
template<typename AnyPayloadT , typename InPayloadT >
constexpr TPoliteOutcome< PayloadT * >::TPoliteOutcome ( const TPoliteOutcome< AnyPayloadT > &  InOutcome,
InPayloadT *const  InPayload 
)
inlineconstexpr

Initialize a polite outcome copy with a payload override.

Template Parameters
AnyPayloadTThe type of the polite outcome payload. Used for deduction only.
InPayloadTThe pointed type of the payload override.
Parameters
InOutcomeThe outcome to initialize from. This is basically ignored here.
InPayloadThe payload pointer to initialize with.

Member Function Documentation

◆ Dereference()

template<typename PayloadT >
template<typename T = PayloadT, more::enable_if_t<!std::is_void< std::decay_t< T > >::value, bool > = true>
TPoliteOutcome< T & > TPoliteOutcome< PayloadT * >::Dereference ( )
inline

Dereference.

◆ GetPayload()

template<typename PayloadT >
PayloadType TPoliteOutcome< PayloadT * >::GetPayload ( ) const
inline

Get the payload.

◆ IsNoop()

template<typename PayloadT >
constexpr bool TPoliteOutcome< PayloadT * >::IsNoop ( ) const
inlineconstexpr

Check if the outcome is a noop.

◆ IsOK()

template<typename PayloadT >
constexpr bool TPoliteOutcome< PayloadT * >::IsOK ( ) const
inlineconstexpr

Convert to success state for using in a conditional expression.

Returns true for successful statuses, false otherwise.

Returns
The state of examination.

◆ MapStatus()

template<typename PayloadT >
TPoliteOutcome & TPoliteOutcome< PayloadT * >::MapStatus ( const EApparatusStatus  From,
const EApparatusStatus  To 
)
inline

Map the status from a status to a status.

Parameters
FromThe status to map from.
ToThe status to map to.
Returns
Returns itself.

◆ Noop() [1/2]

template<typename PayloadT >
static constexpr TPoliteOutcome< PayloadT * > TPoliteOutcome< PayloadT * >::Noop ( PayloadT *const  InPayload)
inlinestaticconstexpr

A constant denoting a successful skip of any actions.

◆ Noop() [2/2]

template<typename PayloadT >
static constexpr TPoliteOutcome< PayloadT * > TPoliteOutcome< PayloadT * >::Noop ( TYPE_OF_NULLPTR  )
inlinestaticconstexpr

A constant denoting a successful skip of any actions.

◆ operator bool()

template<typename PayloadT >
TPoliteOutcome< PayloadT * >::operator bool ( ) const
inline

◆ operator EApparatusStatus()

template<typename PayloadT >
constexpr TPoliteOutcome< PayloadT * >::operator EApparatusStatus ( ) const
inlineconstexpr

Convert to a status.

This is an explicit conversion for a polite outcome.

Returns
The embedded captured status.

◆ operator PayloadType()

template<typename PayloadT >
TPoliteOutcome< PayloadT * >::operator PayloadType ( ) const
inline

Convert to a payload.

◆ operator!()

template<typename PayloadT >
bool TPoliteOutcome< PayloadT * >::operator! ( ) const
inline

◆ operator!=() [1/2]

template<typename PayloadT >
bool TPoliteOutcome< PayloadT * >::operator!= ( PayloadT *const  Other) const
inline

◆ operator!=() [2/2]

template<typename PayloadT >
bool TPoliteOutcome< PayloadT * >::operator!= ( TYPE_OF_NULLPTR  ) const
inline

◆ operator*()

template<typename PayloadT >
template<typename T = PayloadT, typename std::enable_if<!std::is_void< T >::value, int >::type = 0>
T & TPoliteOutcome< PayloadT * >::operator* ( ) const
inline

◆ operator+()

template<typename PayloadT >
constexpr TPoliteOutcome TPoliteOutcome< PayloadT * >::operator+ ( const EApparatusStatus  InStatus) const
inlineconstexpr

◆ operator+=() [1/2]

template<typename PayloadT >
TPoliteOutcome & TPoliteOutcome< PayloadT * >::operator+= ( const EApparatusStatus  InStatus)
inline

Accumulate a status within the outcome.

Parameters
InStatusThe status to accumulate.
Returns
Returns itself.

◆ operator+=() [2/2]

template<typename PayloadT >
template<typename InPayloadT >
TPoliteOutcome & TPoliteOutcome< PayloadT * >::operator+= ( const THarshOutcome< InPayloadT > &  )
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.

Template Parameters
InPayloadTThe payload of the harsh outcome.
Returns
Returns itself as a result.

◆ operator->()

template<typename PayloadT >
template<typename T = PayloadT, typename std::enable_if<!std::is_void< T >::value, int >::type = 0>
T * TPoliteOutcome< PayloadT * >::operator-> ( ) const
inline

◆ operator==() [1/2]

template<typename PayloadT >
bool TPoliteOutcome< PayloadT * >::operator== ( PayloadT *const  Other) const
inline

◆ operator==() [2/2]

template<typename PayloadT >
bool TPoliteOutcome< PayloadT * >::operator== ( TYPE_OF_NULLPTR  ) const
inline

◆ StaticCast()

template<typename PayloadT >
template<typename T >
TPoliteOutcome< T > TPoliteOutcome< PayloadT * >::StaticCast ( )
inline

Cast the payload pointer statically.

Template Parameters
Thetype to cast to.

◆ Success() [1/2]

template<typename PayloadT >
static constexpr TPoliteOutcome< PayloadT * > TPoliteOutcome< PayloadT * >::Success ( PayloadT *const  InPayload)
inlinestaticconstexpr

A constant denoting a successful operation outcome.

◆ Success() [2/2]

template<typename PayloadT >
static constexpr TPoliteOutcome< PayloadT * > TPoliteOutcome< PayloadT * >::Success ( TYPE_OF_NULLPTR  )
inlinestaticconstexpr

A constant denoting a successful operation outcome.

◆ ToStatus()

template<typename PayloadT >
constexpr EApparatusStatus TPoliteOutcome< PayloadT * >::ToStatus ( ) const
inlineconstexpr

Convert to a status constant.

Returns
The embedded captured status.

◆ ToString()

template<typename PayloadT >
FString TPoliteOutcome< PayloadT * >::ToString ( ) const
inline

Member Data Documentation

◆ Payload

template<typename PayloadT >
PayloadType TPoliteOutcome< PayloadT * >::Payload

The embedded payload pointer.

◆ Status

template<typename PayloadT >
EApparatusStatus TPoliteOutcome< PayloadT * >::Status

The embedded status of the outcome.


The documentation for this struct was generated from the following file: