Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
TGuardValue< Type > Struct Template Reference

#include <UnrealTemplate.h>

+ Inheritance diagram for TGuardValue< Type >:
+ Collaboration diagram for TGuardValue< Type >:

Public Member Functions

 TGuardValue (Type &ReferenceValue, const Type &NewValue)
 
 ~TGuardValue ()
 
FORCEINLINE const Type & operator* () const
 

Private Attributes

Type & RefValue
 
Type OldValue
 

Additional Inherited Members

- Private Member Functions inherited from FNoncopyable
 FNoncopyable ()
 
 ~FNoncopyable ()
 

Detailed Description

template<typename Type>
struct TGuardValue< Type >

exception-safe guard around saving/restoring a value. Commonly used to make sure a value is restored even if the code early outs in the future. Usage: TGuardValue<bool> GuardSomeBool(bSomeBool, false); // Sets bSomeBool to false, and restores it in dtor.

Definition at line 248 of file UnrealTemplate.h.

Constructor & Destructor Documentation

◆ TGuardValue()

template<typename Type >
TGuardValue< Type >::TGuardValue ( Type & ReferenceValue,
const Type & NewValue )
inline

Definition at line 250 of file UnrealTemplate.h.

◆ ~TGuardValue()

template<typename Type >
TGuardValue< Type >::~TGuardValue ( )
inline

Definition at line 255 of file UnrealTemplate.h.

Member Function Documentation

◆ operator*()

template<typename Type >
FORCEINLINE const Type & TGuardValue< Type >::operator* ( ) const
inline

Overloaded dereference operator. Provides read-only access to the original value of the data being tracked by this struct

Returns
a const reference to the original data value

Definition at line 266 of file UnrealTemplate.h.

Member Data Documentation

◆ OldValue

template<typename Type >
Type TGuardValue< Type >::OldValue
private

Definition at line 273 of file UnrealTemplate.h.

◆ RefValue

template<typename Type >
Type& TGuardValue< Type >::RefValue
private

Definition at line 272 of file UnrealTemplate.h.


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