UDocumentation
UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ConfigAccessTracking.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
/*---------------------------------------------------------------------------------------------------------------------
4
Access tracking for Config cache. When compiled in, adds extra data to FConfigFile structures so that we can report
5
File,Section,Value names whenever an FConfigValue is read. The data about any accessed ConfigValue is reported to
6
callbacks registered via UE::ConfigAccessTracking::AddConfigValueReadCallback.
7
---------------------------------------------------------------------------------------------------------------------*/
8
#pragma once
9
10
#include "
HAL/Platform.h
"
11
#include "
UObject/NameTypes.h
"
12
13
#define UE_WITH_CONFIG_TRACKING (WITH_EDITOR || 0)
14
15
#if UE_WITH_CONFIG_TRACKING
16
#include <atomic>
17
#include "
Containers/StringView.h
"
18
#include "
Templates/Function.h
"
19
#include "
Templates/RefCounting.h
"
20
21
class
FConfigCacheIni
;
22
class
FConfigFile
;
23
class
FConfigSection
;
24
struct
FConfigValue
;
25
#endif
26
27
#if WITH_EDITOR || UE_WITH_CONFIG_TRACKING
28
29
namespace
UE::ConfigAccessTracking
30
{
31
36
enum class
ELoadType
:
uint8
37
{
38
ConfigSystem,
39
LocalIniFile
,
40
LocalSingleIniFile
,
41
ExternalIniFile
,
42
ExternalSingleIniFile
,
43
Manual
,
44
SuppressReporting
,
45
Uninitialized
,
46
};
47
48
}
// namespace UE::ConfigAccessTracking
49
50
#endif
// WITH_EDITOR || UE_WITH_CONFIG_TRACKING
51
52
#if UE_WITH_CONFIG_TRACKING
53
54
namespace
UE::ConfigAccessTracking
55
{
56
63
struct
FFile :
public
FRefCountBase
64
{
65
CORE_API
FFile(
const
FConfigFile
*
InConfigFile
);
66
CORE_API
FName
GetFilenameToLoad
()
const
;
67
CORE_API
FName
GetPlatformName();
68
CORE_API
void
SetAsLoadTypeConfigSystem
(
FConfigCacheIni
& ConfigSystem,
FConfigFile
& ConfigFile);
69
70
public
:
71
const
FConfigFile
* ConfigFile =
nullptr
;
72
FName
OverrideFilenameToLoad
;
73
private
:
74
FName
PlatformName =
NAME_None
;
75
FStringView
SavedConfigFilePlatformName
;
76
bool
bSavedHasConfigFile
: 1;
// = false;
77
bool
bSavedConfigFileHasPlatformName
: 1;
// = false;
78
bool
bPlatformNameInitialized
: 1;
// = false;
79
bool
bOverridePlatformName
: 1;
// = false;
80
bool
bSavedOverridePlatformName
: 1;
// = false;
81
};
82
91
struct
FSection
:
public
FRefCountBase
92
{
93
CORE_API
FSection
(FFile&
InFileAccess
,
FStringView
InSectionName
);
94
95
TRefCountPtr<FFile>
FileAccess
;
96
FNameEntryId
SectionName;
97
};
98
100
using
FConfigValueReadCallbackFunc
=
TFunction
<
void
(UE::ConfigAccessTracking::FSection* Section,
101
FMinimalName
ValueName,
const
FConfigValue
&
ConfigValue
)>;
102
104
struct
FConfigValueReadCallbackId
105
{
106
int32
Id
= -1;
107
bool
IsValid
() {
return
Id
!= -1; }
108
};
109
111
CORE_API
FConfigValueReadCallbackId
AddConfigValueReadCallback
(
FConfigValueReadCallbackFunc
Callback);
113
CORE_API
void
RemoveConfigValueReadCallback
(
FConfigValueReadCallbackId
DelegateHandle);
114
116
struct
FIgnoreScope
117
{
118
public
:
119
CORE_API
FIgnoreScope
();
120
CORE_API
~FIgnoreScope
();
121
122
private
:
123
bool
bPreviousIgnoreReads
=
false
;
124
};
125
126
namespace
Private
127
{
128
133
extern
CORE_API
std::atomic<int32>
ConfigValueReadCallbackQuantity
;
134
135
CORE_API
void
OnConfigValueReadInternal
(UE::ConfigAccessTracking::FSection* Section,
FMinimalName
ValueName,
136
const
FConfigValue
&
ConfigValue
);
137
138
inline
void
OnConfigValueRead(UE::ConfigAccessTracking::FSection* Section,
FMinimalName
ValueName,
139
const
FConfigValue
&
ConfigValue
)
140
{
141
if
(
ConfigValueReadCallbackQuantity
.load(std::memory_order_acquire) > 0)
142
{
143
OnConfigValueReadInternal
(Section, ValueName,
ConfigValue
);
144
}
145
}
146
147
}
// namespace Private
148
149
}
// namespace UE::ConfigAccessTracking
150
151
#else
// UE_WITH_CONFIG_TRACKING
152
153
namespace
UE::ConfigAccessTracking
154
{
155
156
// Declare FSection even though it is undefined so that we can pass FSection* as an argument to FConfigSection and FConfigValue
157
// constructors rather than having to create separate constructors under #ifdef UE_WITH_CONFIG_TRACKING
158
struct
FSection
;
159
160
// Define FIgnoreScope even when !UE_WITH_CONFIG_TRACKING so we don't need to wrap its use in a macro.
161
struct
FIgnoreScope
162
{
163
FIgnoreScope
(){}
164
~FIgnoreScope
(){}
165
};
166
167
}
// namespace UE::ConfigAccessTracking
168
169
#endif
// else !UE_WITH_CONFIG_TRACKING
170
void
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
EWarpingEvaluationMode::Manual
@ Manual
EChaosVDManifoldPointFlags::IsValid
@ IsValid
Platform.h
int32
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition
Platform.h:1125
Function.h
StaticCastSharedRef
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition
SharedPointer.h:127
CacheMode::Uninitialized
@ Uninitialized
NameTypes.h
RefCounting.h
ERemoteIdToStringVerbosity::Id
@ Id
StringView.h
uint8
uint8_t uint8
Definition
binka_ue_file_header.h:8
FConfigCacheIni
Definition
ConfigCacheIni.h:1240
FConfigFile
Definition
ConfigCacheIni.h:566
FConfigSection
Definition
ConfigCacheIni.h:407
FName
Definition
NameTypes.h:617
FRefCountBase
Definition
RefCounting.h:213
TFunction
Definition
AndroidPlatformMisc.h:14
TRefCountPtr
Definition
RefCounting.h:454
TStringView< TCHAR >
Private
Definition
OverriddenPropertySet.cpp:45
UE::ConfigAccessTracking
Definition
ConfigAccessTracking.h:154
FConfigValue
Definition
ConfigCacheIni.h:124
FMinimalName
Definition
NameTypes.h:439
FNameEntryId
Definition
NameTypes.h:69
UE::ConfigAccessTracking::FIgnoreScope
Definition
ConfigAccessTracking.h:162
UE::ConfigAccessTracking::FIgnoreScope::FIgnoreScope
FIgnoreScope()
Definition
ConfigAccessTracking.h:163
UE::ConfigAccessTracking::FIgnoreScope::~FIgnoreScope
~FIgnoreScope()
Definition
ConfigAccessTracking.h:164
Engine
Source
Runtime
Core
Public
Misc
ConfigAccessTracking.h
Generated by
1.9.8