Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
Result< Type > Class Template Reference

Helper class that either contains a valid result or an error. More...

#include <Result.h>

Public Member Functions

 Result ()
 Default constructor.
 
 Result (const Result< Type > &inRHS)
 Copy constructor.
 
 Result (Result< Type > &&inRHS) noexcept
 Move constructor.
 
 ~Result ()
 Destructor.
 
Result< Type > & operator= (const Result< Type > &inRHS)
 Copy assignment.
 
Result< Type > & operator= (Result< Type > &&inRHS) noexcept
 Move assignment.
 
void Clear ()
 Clear result or error.
 
bool IsEmpty () const
 Checks if the result is still uninitialized.
 
bool IsValid () const
 Checks if the result is valid.
 
const Type & Get () const
 Get the result value.
 
void Set (const Type &inResult)
 Set the result value.
 
void Set (Type &&inResult)
 Set the result value (move value)
 
bool HasError () const
 Check if we had an error.
 
const StringGetError () const
 Get the error value.
 
void SetError (const char *inError)
 Set an error value.
 
void SetError (const string_view &inError)
 
void SetError (String &&inError)
 

Detailed Description

template<class Type>
class Result< Type >

Helper class that either contains a valid result or an error.

Constructor & Destructor Documentation

◆ Result() [1/3]

template<class Type >
Result< Type >::Result ( )
inline

Default constructor.

◆ Result() [2/3]

template<class Type >
Result< Type >::Result ( const Result< Type > &  inRHS)
inline

Copy constructor.

◆ Result() [3/3]

template<class Type >
Result< Type >::Result ( Result< Type > &&  inRHS)
inlinenoexcept

Move constructor.

◆ ~Result()

template<class Type >
Result< Type >::~Result ( )
inline

Destructor.

Member Function Documentation

◆ Clear()

template<class Type >
void Result< Type >::Clear ( )
inline

Clear result or error.

◆ Get()

template<class Type >
const Type & Result< Type >::Get ( ) const
inline

Get the result value.

◆ GetError()

template<class Type >
const String & Result< Type >::GetError ( ) const
inline

Get the error value.

◆ HasError()

template<class Type >
bool Result< Type >::HasError ( ) const
inline

Check if we had an error.

◆ IsEmpty()

template<class Type >
bool Result< Type >::IsEmpty ( ) const
inline

Checks if the result is still uninitialized.

◆ IsValid()

template<class Type >
bool Result< Type >::IsValid ( ) const
inline

Checks if the result is valid.

◆ operator=() [1/2]

template<class Type >
Result< Type > & Result< Type >::operator= ( const Result< Type > &  inRHS)
inline

Copy assignment.

◆ operator=() [2/2]

template<class Type >
Result< Type > & Result< Type >::operator= ( Result< Type > &&  inRHS)
inlinenoexcept

Move assignment.

◆ Set() [1/2]

template<class Type >
void Result< Type >::Set ( const Type &  inResult)
inline

Set the result value.

◆ Set() [2/2]

template<class Type >
void Result< Type >::Set ( Type &&  inResult)
inline

Set the result value (move value)

◆ SetError() [1/3]

template<class Type >
void Result< Type >::SetError ( const char *  inError)
inline

Set an error value.

◆ SetError() [2/3]

template<class Type >
void Result< Type >::SetError ( const string_view &  inError)
inline

◆ SetError() [3/3]

template<class Type >
void Result< Type >::SetError ( String &&  inError)
inline

Member Data Documentation

◆ mError

template<class Type >
String Result< Type >::mError

The error description if the result failed.

◆ mResult

template<class Type >
Type Result< Type >::mResult

The actual result object.


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