Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
TlsAutoCleanup.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
#
pragma
once
4
5
#
include
"CoreTypes.h"
6
7
/**
8
Base class for objects in TLS that support auto-cleanup.
9
Polymorphically deletes registered instances on thread exit.
10
*/
11
class
FTlsAutoCleanup
12
{
13
public
:
14
/** Virtual destructor. */
15
virtual
~
FTlsAutoCleanup
()
16
{}
17
18
/** Register this instance to be auto-cleanup. */
19
void
Register
();
20
};
21
22
/** Wrapper for values to be stored in TLS that support auto-cleanup. */
23
template
<
class
T >
24
class
TTlsAutoCleanupValue
25
:
public
FTlsAutoCleanup
26
{
27
public
:
28
29
/** Constructor. */
30
TTlsAutoCleanupValue
(
const
T& InValue)
31
:
Value
(
InValue
)
32
{ }
33
34
/** Gets the value. */
35
T
Get
()
const
36
{
37
return
Value
;
38
}
39
40
/* Sets the value. */
41
void
Set
(
const
T& InValue)
42
{
43
Value
=
InValue
;
44
}
45
46
/* Sets the value. */
47
void
Set
(T&& InValue)
48
{
49
Value
=
MoveTemp
(
InValue
);
50
}
51
52
private
:
53
54
/** The value. */
55
T
Value
;
56
};
FTlsAutoCleanup
Definition
TlsAutoCleanup.h:12
FTlsAutoCleanup::~FTlsAutoCleanup
virtual ~FTlsAutoCleanup()
Definition
TlsAutoCleanup.h:15
FTlsAutoCleanup::Register
void Register()
TTlsAutoCleanupValue
Definition
TlsAutoCleanup.h:26
TTlsAutoCleanupValue::Get
T Get() const
Definition
TlsAutoCleanup.h:35
TTlsAutoCleanupValue::Value
T Value
Definition
TlsAutoCleanup.h:55
TTlsAutoCleanupValue::Set
void Set(const T &InValue)
Definition
TlsAutoCleanup.h:41
TTlsAutoCleanupValue::TTlsAutoCleanupValue
TTlsAutoCleanupValue(const T &InValue)
Definition
TlsAutoCleanup.h:30
TTlsAutoCleanupValue::Set
void Set(T &&InValue)
Definition
TlsAutoCleanup.h:47
Downloads
ArkServerAPI_NEW
ASA
AsaApi
AsaApi
Core
Public
API
UE
HAL
TlsAutoCleanup.h
Generated by
1.10.0