UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
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"
7
8namespace UE { namespace AccessDetection {
9
10enum class EType : uint32
11{
12 None = 0,
13 File = 1 << 0,
14 Ini UE_DEPRECATED(5.4, "Use FConfigAccessTracking in ConfigAccessTracking instead") = 1 << 1,
15 CVar = 1 << 2,
16};
18
19#if WITH_EDITOR
20
21class FScope;
22
23namespace Private
24{
25 extern CORE_API volatile int32 GNumLiveScopes;
26
28 CORE_API void SetCurrentThreadScope(FScope* Scope);
29}
30
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
41class FScope
42{
43public:
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
50private:
51 EType AccessedTypes = EType::None;
52};
53
54#else
55
57
58#endif
59
60}}
#define FORCEINLINE
Definition AndroidPlatform.h:140
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
uint32_t uint32
Definition binka_ue_file_header.h:6
Type
Definition PawnAction_Move.h:11
Definition OverriddenPropertySet.cpp:45
EType
Definition AccessDetection.h:11
FORCEINLINE void ReportAccess(EType Type)
Definition AccessDetection.h:56
Definition AdvancedWidgetsModule.cpp:13