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
THarshOutcome< PayloadT * > Struct Template Reference

Harsh outcome with a pointer-type outcome. More...

#include <ApparatusStatus.h>

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

Public Types

using PayloadType = PayloadT *
 The payload pointer type.
 

Public Member Functions

constexpr EApparatusStatus ToStatus () const
 Convert to a status constant.
 
constexpr bool IsNoop () const
 Check if the outcome is a noop.
 
THarshOutcomeMapStatus (const EApparatusStatus From, const EApparatusStatus To)
 Map the status from a status to a status.
 
PayloadType GetPayload () const
 Get the payload of the outcome.
 
constexpr operator EApparatusStatus () const
 Convert to a successful status.
 
 operator PayloadType () const
 Convert to a payload.
 
template<typename T >
THarshOutcome< TStaticCast ()
 Cast the pointer statically.
 
template<typename T = PayloadT, more::enable_if_t<!std::is_void< std::decay_t< T > >::value, bool > = true>
THarshOutcome< T & > Dereference ()
 Dereference.
 
constexpr bool IsOK () const
 Convert to successful state for using in a conditional expression.
 
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
 
THarshOutcomeoperator+= (const THarshOutcome &)
 
THarshOutcomeoperator+= (const EApparatusStatus InStatus)
 
THarshOutcome operator+ (const EApparatusStatus InStatus) const
 
FString ToString () const
 
constexpr THarshOutcome ()
 Initialize a default harsh outcome with a payload pointer to copy.
 
template<typename InPayloadT >
 THarshOutcome (InPayloadT &&InPayload)
 Initialize a harsh outcome with a payload pointer to copy.
 
template<typename InPayloadT >
 THarshOutcome (const EApparatusStatus InStatus, const InPayloadT InPayload)
 Initialize a harsh outcome with a status and a pointer to copy.
 
 THarshOutcome (const EApparatusStatus InStatus)
 Initialize a harsh outcome with a status and a nullptr.
 
template<typename InPayloadT >
 THarshOutcome (const TPoliteOutcome< InPayloadT * > &InOutcome)
 Convert from a polite outcome.
 
template<typename AnyPayloadT , typename InPayloadT >
constexpr THarshOutcome (const THarshOutcome< AnyPayloadT > &InOutcome, const InPayloadT InPayload)
 Initialize a harsh outcome using a harsh outcome and a payload override.
 

Static Public Member Functions

static constexpr THarshOutcome< PayloadT * > Success (TYPE_OF_NULLPTR)
 A constant denoting a successful operation outcome.
 
static constexpr THarshOutcome< PayloadT * > Noop (TYPE_OF_NULLPTR)
 A constant denoting a successful skip of any actions.
 
static constexpr THarshOutcome< PayloadT * > Success (PayloadT *const InPayload)
 A constant denoting a successful operation outcome.
 
static constexpr THarshOutcome< PayloadT * > Noop (PayloadT *const InPayload)
 A constant denoting a successful skip of any actions.
 

Public Attributes

PayloadT * Payload
 The payload pointer of the outcome.
 

Detailed Description

template<typename PayloadT>
struct THarshOutcome< PayloadT * >

Harsh outcome with a pointer-type outcome.

Template Parameters
PayloadTThe optional payload object to point.

Member Typedef Documentation

◆ PayloadType

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

The payload pointer type.

Constructor & Destructor Documentation

◆ THarshOutcome() [1/6]

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

Initialize a default harsh outcome with a payload pointer to copy.

◆ THarshOutcome() [2/6]

template<typename PayloadT >
template<typename InPayloadT >
THarshOutcome< PayloadT * >::THarshOutcome ( InPayloadT &&  InPayload)
inline

Initialize a harsh outcome with a payload pointer to copy.

Template Parameters
InPayloadTThe type of the passed-in payload. Must be assignable to the destination pointer type.
Parameters
InPayloadThe pointer to copy.

◆ THarshOutcome() [3/6]

template<typename PayloadT >
template<typename InPayloadT >
THarshOutcome< PayloadT * >::THarshOutcome ( const EApparatusStatus  InStatus,
const InPayloadT  InPayload 
)
inline

Initialize a harsh outcome with a status and a pointer to copy.

Template Parameters
InPayloadTThe type of the passed-in payload. Must be assignable to the destination pointer type.
Parameters
InStatusThe status to initialize with. Must be a successful one.
InPayloadThe pointer to copy. Isn't checked for being a nullptr.

◆ THarshOutcome() [4/6]

template<typename PayloadT >
THarshOutcome< PayloadT * >::THarshOutcome ( const EApparatusStatus  InStatus)
inline

Initialize a harsh outcome with a status and a nullptr.

Parameters
InStatusThe status to initialize with. Must be a successful one.

◆ THarshOutcome() [5/6]

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

Convert from a polite outcome.

Will assert the outcome is a successful one.

Template Parameters
InPayloadTThe type of the passed-in payload pointer type.
Parameters
InOutcomeThe polite outcome to convert from.

◆ THarshOutcome() [6/6]

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

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

Template Parameters
AnyPayloadTThe type of the payload of the incoming harsh outcome. Used for deduction only.
InPayloadTThe type of the payload to initialize with.
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>
THarshOutcome< T & > THarshOutcome< PayloadT * >::Dereference ( )
inline

Dereference.

◆ GetPayload()

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

Get the payload of the outcome.

◆ IsNoop()

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

Check if the outcome is a noop.

◆ IsOK()

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

Convert to successful state for using in a conditional expression.

This always return true, since every harsh result is already a success.

Returns
The state of examination.

◆ MapStatus()

template<typename PayloadT >
THarshOutcome & THarshOutcome< 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 THarshOutcome< PayloadT * > THarshOutcome< PayloadT * >::Noop ( PayloadT *const  InPayload)
inlinestaticconstexpr

A constant denoting a successful skip of any actions.

◆ Noop() [2/2]

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

A constant denoting a successful skip of any actions.

◆ operator bool()

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

◆ operator EApparatusStatus()

template<typename PayloadT >
constexpr THarshOutcome< PayloadT * >::operator EApparatusStatus ( ) const
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.

◆ operator PayloadType()

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

Convert to a payload.

◆ operator!()

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

◆ operator!=() [1/2]

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

◆ operator!=() [2/2]

template<typename PayloadT >
bool THarshOutcome< 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 & THarshOutcome< PayloadT * >::operator* ( ) const
inline

◆ operator+()

template<typename PayloadT >
THarshOutcome THarshOutcome< PayloadT * >::operator+ ( const EApparatusStatus  InStatus) const
inline

◆ operator+=() [1/2]

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

◆ operator+=() [2/2]

template<typename PayloadT >
THarshOutcome & THarshOutcome< PayloadT * >::operator+= ( const THarshOutcome< PayloadT * > &  )
inline

◆ operator->()

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

◆ operator==() [1/2]

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

◆ operator==() [2/2]

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

◆ StaticCast()

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

Cast the pointer statically.

Template Parameters
Thetype of the pointer to cast to.

◆ Success() [1/2]

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

A constant denoting a successful operation outcome.

◆ Success() [2/2]

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

A constant denoting a successful operation outcome.

◆ ToStatus()

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

Convert to a status constant.

Returns
EApparatusStatus::Success Every harsh outcome is considered to be a success by default.

◆ ToString()

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

Member Data Documentation

◆ Payload

template<typename PayloadT >
PayloadT* THarshOutcome< PayloadT * >::Payload

The payload pointer of the outcome.


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