UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VVMMarkStackVisitor.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
7#include "CoreTypes.h"
11#include "VerseVM/VVMRef.h"
13
14namespace Verse
15{
16struct VNativeStruct;
17
19{
21
22 static constexpr bool bIsAbstractVisitor = false;
23
26 {
27 }
28
29 void VisitNonNull(VCell* InCell, const TCHAR*)
30 {
31 MarkStack.MarkNonNull(InCell);
32 }
33
34 void VisitNonNull(UObject* InObject, const TCHAR*)
35 {
36 MarkStack.MarkNonNull(InObject);
37 }
38
39 void VisitAuxNonNull(void* InAux, const TCHAR*)
40 {
41 MarkStack.MarkAuxNonNull(InAux);
42 }
43
44 void Visit(VCell* InCell, const TCHAR* ElementName)
45 {
46 if (InCell != nullptr)
47 {
48 VisitNonNull(InCell, ElementName);
49 }
50 }
51
52 void Visit(UObject* InObject, const TCHAR* ElementName)
53 {
54 if (InObject != nullptr)
55 {
56 VisitNonNull(InObject, ElementName);
57 }
58 }
59
60 void VisitAux(void* Aux, const TCHAR*)
61 {
62 if (Aux != nullptr)
63 {
65 }
66 }
67
68 void Visit(VValue Value, const TCHAR*)
69 {
70 if (VCell* Cell = Value.ExtractCell())
71 {
72 Visit(Cell, TEXT(""));
73 }
74 else if (VRef* Ref = Value.ExtractTransparentRef())
75 {
76 Visit(static_cast<VCell*>(Ref), TEXT(""));
77 }
78 else if (UObject* Object = Value.ExtractUObject())
79 {
80 Visit(Object, TEXT(""));
81 }
82 }
83
84 // NOTE: The Value parameter can not be passed by value.
85
86 template <typename T>
87 void Visit(TWriteBarrier<T>& Value, const TCHAR*)
88 {
89 Visit(Value.Get(), TEXT(""));
90 }
91
92 template <typename T>
93 void Visit(T& Value, const TCHAR*);
94
95 template <typename T>
96 void Visit(T* Values, uint64 Count, const TCHAR*)
97 {
98 Visit(Values, Values + Count, TEXT(""));
99 }
100
101 template <typename T>
102 void Visit(T Begin, T End, const TCHAR*);
103
104 // Arrays
105 template <typename ElementType, typename AllocatorType>
106 void Visit(TArray<ElementType, AllocatorType>& Values, const TCHAR*);
107
108 // Sets
109 template <typename ElementType, typename KeyFuncs, typename Allocator>
111
112 // Maps
113 template <typename KeyType, typename ValueType, typename SetAllocator, typename KeyFuncs>
115
116 bool IsMarked(VCell* InCell, const TCHAR*)
117 {
118 return FHeap::IsMarked(InCell);
119 }
120
121 void ReportNativeBytes(size_t Bytes)
122 {
123 MarkStack.ReportNativeBytes(Bytes);
124 }
125
127 {
128 UE::GC::MarkNativeStructAsReachable(NativeStruct);
129 }
130
131 // Mimic FStructuredArchiveVisitor so Visit overloads can call these unconditionally.
132
133 void Visit(uint8 Value, const TCHAR* ElementName) {}
134 void Visit(uint32 Value, const TCHAR* ElementName) {}
135
136private:
138};
139
140} // namespace Verse
141#endif // WITH_VERSE_VM
#define UE_NONCOPYABLE(TypeName)
Definition CoreMiscDefines.h:457
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
decltype(auto) Visit(Func &&Callable, Variants &&... Args)
Definition TVariant.h:271
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition Object.h:95
Definition Archive.h:36