UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VVMWeakKeyMapGuard.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#if WITH_VERSE_VM || defined(__INTELLISENSE__)
6
8#include "VVMWeakKeyMap.h"
9
10namespace Verse
11{
12
13struct FWeakKeyMapGuard final
14{
16 : Guard(Header)
17 {
18 }
19
20 FWeakKeyMap* TryGet()
21 {
22 return GetRef();
23 }
24
26 {
27 if (GetRef())
28 {
29 return GetRef();
30 }
31 else
32 {
33 return GetSlow();
34 }
35 }
36
37 // Returns true if this page no longer has a weak key map.
38 // If this returns false, then it also accounts for the native memory usage of this map.
39 bool ConductCensus();
40
41private:
43
44 FWeakKeyMap*& GetRef() const
45 {
46 return *reinterpret_cast<FWeakKeyMap**>(Guard.GetClientDataPtr());
47 }
48
50};
51
52} // namespace Verse
53#endif // WITH_VERSE_VM
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
FORCEINLINE T * Get(const FObjectPtr &ObjectPtr)
Definition ObjectPtr.h:426
Definition Archive.h:36