Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
TOptional< OptionalType > Struct Template Reference

#include <Optional.h>

+ Collaboration diagram for TOptional< OptionalType >:

Public Types

using ElementType = OptionalType
 

Public Member Functions

 TOptional (const OptionalType &InValue)
 
 TOptional (OptionalType &&InValue)
 
template<typename... ArgTypes>
 TOptional (EInPlace, ArgTypes &&... Args)
 
 TOptional (FNullOpt)
 
 TOptional ()
 
 ~TOptional ()
 
 TOptional (const TOptional &InValue)
 
 TOptional (TOptional &&InValue)
 
TOptionaloperator= (const TOptional &InValue)
 
TOptionaloperator= (TOptional &&InValue)
 
TOptionaloperator= (const OptionalType &InValue)
 
TOptionaloperator= (OptionalType &&InValue)
 
void Reset ()
 
template<typename... ArgsType>
OptionalTypeEmplace (ArgsType &&... Args)
 
void Serialize (FArchive &Ar)
 
bool IsSet () const
 
FORCEINLINE operator bool () const
 
const OptionalTypeGetValue () const
 
OptionalTypeGetValue ()
 
const OptionalTypeoperator-> () const
 
OptionalTypeoperator-> ()
 
const OptionalTypeoperator* () const
 
OptionalTypeoperator* ()
 
const OptionalTypeGet (const OptionalType &DefaultValue) const
 
OptionalTypeGetPtrOrNull ()
 
const OptionalTypeGetPtrOrNull () const
 

Private Attributes

TTypeCompatibleBytes< OptionalTypeValue
 
bool bIsSet
 

Friends

bool operator== (const TOptional &lhs, const TOptional &rhs)
 
bool operator!= (const TOptional &lhs, const TOptional &rhs)
 

Detailed Description

template<typename OptionalType>
struct TOptional< OptionalType >

When we have an optional value IsSet() returns true, and GetValue() is meaningful. Otherwise GetValue() is not meaningful.

Definition at line 19 of file Optional.h.

Member Typedef Documentation

◆ ElementType

Definition at line 22 of file Optional.h.

Constructor & Destructor Documentation

◆ TOptional() [1/7]

Construct an OptionalType with a valid value.

Definition at line 25 of file Optional.h.

◆ TOptional() [2/7]

Definition at line 30 of file Optional.h.

◆ TOptional() [3/7]

template<typename OptionalType >
template<typename... ArgTypes>
TOptional< OptionalType >::TOptional ( EInPlace ,
ArgTypes &&... Args )
inlineexplicit

Definition at line 36 of file Optional.h.

◆ TOptional() [4/7]

Construct an OptionalType with an invalid value.

Definition at line 43 of file Optional.h.

◆ TOptional() [5/7]

Construct an OptionalType with no value; i.e. unset

Definition at line 49 of file Optional.h.

◆ ~TOptional()

Definition at line 54 of file Optional.h.

◆ TOptional() [6/7]

Copy/Move construction

Definition at line 60 of file Optional.h.

◆ TOptional() [7/7]

Definition at line 69 of file Optional.h.

Member Function Documentation

◆ Emplace()

template<typename OptionalType >
template<typename... ArgsType>
OptionalType & TOptional< OptionalType >::Emplace ( ArgsType &&... Args)
inline

Definition at line 140 of file Optional.h.

◆ Get()

template<typename OptionalType >
const OptionalType & TOptional< OptionalType >::Get ( const OptionalType & DefaultValue) const
inline
Returns
The optional value when set; DefaultValue otherwise.

Definition at line 209 of file Optional.h.

◆ GetPtrOrNull() [1/2]

template<typename OptionalType >
OptionalType * TOptional< OptionalType >::GetPtrOrNull ( )
inline
Returns
A pointer to the optional value when set, nullptr otherwise.

Definition at line 212 of file Optional.h.

◆ GetPtrOrNull() [2/2]

template<typename OptionalType >
const OptionalType * TOptional< OptionalType >::GetPtrOrNull ( ) const
inline

Definition at line 213 of file Optional.h.

◆ GetValue() [1/2]

template<typename OptionalType >
OptionalType & TOptional< OptionalType >::GetValue ( )
inline

Definition at line 200 of file Optional.h.

◆ GetValue() [2/2]

template<typename OptionalType >
const OptionalType & TOptional< OptionalType >::GetValue ( ) const
inline
Returns
The optional value; undefined when IsSet() returns false.

Definition at line 199 of file Optional.h.

◆ IsSet()

template<typename OptionalType >
bool TOptional< OptionalType >::IsSet ( ) const
inline
Returns
true when the value is meaningful; false if calling GetValue() is undefined.

Definition at line 195 of file Optional.h.

◆ operator bool()

template<typename OptionalType >
FORCEINLINE TOptional< OptionalType >::operator bool ( ) const
inlineexplicit

Definition at line 196 of file Optional.h.

◆ operator*() [1/2]

Definition at line 206 of file Optional.h.

◆ operator*() [2/2]

Definition at line 205 of file Optional.h.

◆ operator->() [1/2]

Definition at line 203 of file Optional.h.

◆ operator->() [2/2]

Definition at line 202 of file Optional.h.

◆ operator=() [1/4]

Definition at line 106 of file Optional.h.

◆ operator=() [2/4]

Definition at line 79 of file Optional.h.

◆ operator=() [3/4]

Definition at line 116 of file Optional.h.

◆ operator=() [4/4]

Definition at line 92 of file Optional.h.

◆ Reset()

template<typename OptionalType >
void TOptional< OptionalType >::Reset ( )
inline

Definition at line 127 of file Optional.h.

◆ Serialize()

template<typename OptionalType >
void TOptional< OptionalType >::Serialize ( FArchive & Ar)
inline

Definition at line 166 of file Optional.h.

Friends And Related Symbol Documentation

◆ operator!=

template<typename OptionalType >
bool operator!= ( const TOptional< OptionalType > & lhs,
const TOptional< OptionalType > & rhs )
friend

Definition at line 161 of file Optional.h.

◆ operator==

Definition at line 148 of file Optional.h.

Member Data Documentation

◆ bIsSet

template<typename OptionalType >
bool TOptional< OptionalType >::bIsSet
private

Definition at line 217 of file Optional.h.

◆ Value

Definition at line 216 of file Optional.h.


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