Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
AccessDetection.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
#
include
"Misc/EnumClassFlags.h"
7
8
namespace
UE
{
namespace
AccessDetection
{
9
10
enum
class
EType
:
uint32
11
{
12
None
= 0,
13
File
= 1 << 0,
14
Ini
= 1 << 1,
15
CVar
= 1 << 2,
16
};
17
ENUM_CLASS_FLAGS
(
EType
);
18
19
#
if
WITH_EDITOR
20
21
class
FScope
;
22
23
namespace
Private
24
{
25
extern
volatile
int32
GNumLiveScopes
;
26
27
void
ReportCurrentThreadAccess
(
EType
Type
);
28
void
SetCurrentThreadScope
(
FScope
*
Scope
);
29
}
30
31
FORCEINLINE
void
ReportAccess
(
EType
Type
)
32
{
33
// Note unsynchronized access is fine - we only need to see writes by current thread
34
if
(
Private
::
GNumLiveScopes
> 0)
35
{
36
Private
::
ReportCurrentThreadAccess
(
Type
);
37
}
38
}
39
40
/** Detects access to global core systems while running deterministic code that should be isolated from the local environment */
41
class
FScope
42
{
43
public
:
44
FScope
() {
Private
::
SetCurrentThreadScope
(
this
); }
45
~
FScope
() {
Private
::
SetCurrentThreadScope
(
nullptr
); }
46
47
void
AddAccess
(
EType
Type
) {
AccessedTypes
|=
Type
; }
48
EType
GetAccesses
()
const
{
return
AccessedTypes
; }
49
50
private
:
51
EType
AccessedTypes
=
EType
::
None
;
52
};
53
54
#
else
55
56
FORCEINLINE
void
ReportAccess
(
EType
Type) {}
57
58
#
endif
59
60
}}
WITH_EDITOR
#define WITH_EDITOR
Definition
Build.h:7
ENUM_CLASS_FLAGS
#define ENUM_CLASS_FLAGS(Enum)
Definition
EnumClassFlags.h:6
FORCEINLINE
#define FORCEINLINE
Definition
Platform.h:644
UE::AccessDetection
Definition
AccessDetection.h:8
UE::AccessDetection::EType
EType
Definition
AccessDetection.h:11
UE::AccessDetection::EType::File
@ File
UE::AccessDetection::EType::Ini
@ Ini
UE::AccessDetection::EType::None
@ None
UE::AccessDetection::EType::CVar
@ CVar
UE::AccessDetection::ReportAccess
FORCEINLINE void ReportAccess(EType Type)
Definition
AccessDetection.h:56
UE
Definition
Vector.h:40
Downloads
ArkServerAPI_NEW
ASA
AsaApi
AsaApi
Core
Public
API
UE
Misc
AccessDetection.h
Generated by
1.10.0