UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VVMRestValue.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 "VVMCell.h"
8#include "VVMValue.h"
9#include "VVMWriteBarrier.h"
10
11namespace Verse
12{
13struct VFrame;
14
15struct VRestValue
16{
17 VRestValue(const VRestValue&) = default;
18 VRestValue& operator=(const VRestValue&) = default;
19
20 explicit constexpr VRestValue(uint16 SplitDepth)
21 {
23 }
24
27 {
28 }
29
30 constexpr void Reset(uint16 SplitDepth)
31 {
33 }
34
35 void ResetTransactionally(FAllocationContext Context, uint16 SplitDepth)
36 {
38 }
39
40 void ResetTrailed(FAllocationContext Context, uint16 SplitDepth)
41 {
43 }
44
45 void Set(FAccessContext Context, VValue NewValue)
46 {
47 checkSlow(!NewValue.IsRoot());
48 Value.Set(Context, NewValue);
49 }
50
51 void SetTransactionally(FAllocationContext, VValue);
52
53 void SetTrailed(FAllocationContext, VValue);
54
55 constexpr void SetNonCellNorPlaceholder(VValue NewValue)
56 {
57 Value.SetNonCellNorPlaceholder(NewValue);
58 }
59
60 void SetNonCellNorPlaceholderTransactionally(FAllocationContext Context, VValue NewValue)
61 {
62 Value.SetNonCellNorPlaceholderTransactionally(Context, NewValue);
63 }
64
65 void SetNonCellNorPlaceholderTrailed(FAllocationContext Context, VValue NewValue)
66 {
67 Value.SetNonCellNorPlaceholderTrailed(Context, NewValue);
68 }
69
70 bool IsRoot() const
71 {
72 return Value.Get().IsRoot();
73 }
74
75 bool CanDefQuickly() const
76 {
77 return IsRoot();
78 }
79
80 VValue Get(FAllocationContext Context);
81
82 VValue GetRaw()
83 {
84 return Value.Get();
85 }
86
87 COREUOBJECT_API VValue GetSlow(FAllocationContext Context);
88
89 VValue GetTransactionally(FAllocationContext Context);
90
91 COREUOBJECT_API VValue GetSlowTransactionally(FAllocationContext Context);
92
93 bool IsUninitialized() const
94 {
95 return Value.Get().IsUninitialized();
96 }
97
98 bool operator==(const VRestValue& Other) const;
99
100 COREUOBJECT_API void AppendToString(FAllocationContext Context, FUtf8StringBuilderBase& Builder, EValueStringFormat Format, TSet<const void*>& VisitedObjects, uint32 RecursionDepth = 0) const;
101 COREUOBJECT_API FUtf8String ToString(FAllocationContext Context, EValueStringFormat Format, uint32 RecursionDepth = 0) const;
102 COREUOBJECT_API TSharedPtr<FJsonValue> ToJSON(FRunningContext Context, EValueJSONFormat Format, TMap<const void*, EVisitState>& VisitedObjects, const VerseVMToJsonCallback& Callback, uint32 RecursionDepth = 0, FJsonObject* Defs = nullptr) const;
103
104 template <typename TVisitor>
105 friend void Visit(TVisitor& Visitor, VRestValue& InValue)
106 {
107 Visitor.Visit(InValue.Value, TEXT(""));
108 }
109
111
112private:
113 VRestValue() = default;
115
116 friend struct VArray;
117 friend struct VFrame;
118 friend struct VObject;
119 friend struct VValue;
120 friend struct VValueObject;
121 friend struct FStructuredArchiveVisitor;
122 friend ::FReferenceCollector;
123};
124} // namespace Verse
125
126inline void FReferenceCollector::AddReferencedVerseValue(Verse::VRestValue& InValue, const UObject* ReferencingObject, const FProperty* ReferencingProperty)
127{
128 AddReferencedVerseValue(InValue.Value, ReferencingObject, ReferencingProperty);
129}
130#endif // WITH_VERSE_VM
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define TEXT(x)
Definition Platform.h:1272
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
void AppendToString(const FStringFormatArg &Arg, StringType &StringToAppendTo)
Definition StringFormatter.cpp:64
decltype(auto) Visit(Func &&Callable, Variants &&... Args)
Definition TVariant.h:271
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition JsonObject.h:23
Definition UnrealType.h:174
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition StringBuilder.h:79
Definition Object.h:95
@ Visitor
Definition XmppMultiUserChat.h:94
uint32 GetTypeHash(const FKey &Key)
Definition BlackboardKey.h:35
FString ToString(uint16 Value)
Definition PathFollowingComponent.cpp:82
FORCEINLINE T * Get(const FObjectPtr &ObjectPtr)
Definition ObjectPtr.h:426
bool operator==(const FCachedAssetKey &A, const FCachedAssetKey &B)
Definition AssetDataMap.h:501
Definition Archive.h:36
bool ToJSON(bool Value, JSONValue *JSON, JSONMemoryPoolAllocator &)
Definition JSON.h:211