UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VVMTupleType.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#if WITH_VERSE_VM || defined(__INTELLISENSE__)
5
8#include "VerseVM/VVMType.h"
11
12class UVerseStruct;
13
14namespace Verse
15{
16
17struct VProgram;
18struct VPropertyType;
19
20struct VTupleType : VType
21{
24
25 VUniqueString& GetMangledName() const { return *MangledName.Get(); }
26 TArrayView<TWriteBarrier<VValue>> GetElements() { return {Elements, NumElements}; }
27
28 UVerseStruct* GetOrCreateUStruct(FAllocationContext Context, UPackage* Package, bool bIsInstanced);
29 COREUOBJECT_API void AddUStruct(FAllocationContext, UPackage* Package, UVerseStruct* Struct);
30
32
33 static constexpr bool SerializeIdentity = false;
34 static void SerializeLayout(FAllocationContext Context, VTupleType*& This, FStructuredArchiveVisitor& Visitor);
35 void SerializeImpl(FAllocationContext Context, FStructuredArchiveVisitor& Visitor);
36
37 COREUOBJECT_API TSharedPtr<FJsonValue> ToJSONImpl(FRunningContext Context, EValueJSONFormat Format, TMap<const void*, EVisitState>& VisitedObjects, const VerseVMToJsonCallback& Callback, uint32 RecursionDepth = 0, FJsonObject* Defs = nullptr);
39
40private:
44 , NumElements(InNumElements)
45 {
46 for (int32 Index = 0; Index < NumElements; ++Index)
47 {
48 new (&Elements[Index]) TWriteBarrier<VValue>();
49 }
50 }
51
52 COREUOBJECT_API UVerseStruct* CreateUStruct(FAllocationContext Context, UPackage* Package, bool bIsInstanced);
53
55
56 struct FUStructMapKeyFuncs : TDefaultMapKeyFuncs<TWriteBarrier<VValue>, TWriteBarrier<VValue>, /*bInAllowDuplicateKeys*/ false>
57 {
58 static bool Matches(KeyInitType A, KeyInitType B) { return A == B; }
59 static bool Matches(KeyInitType A, UPackage* B) { return A.Get() == B; }
60 static uint32 GetKeyHash(KeyInitType Key) { return ::PointerHash(Key.Get().AsUObject()); }
61 static uint32 GetKeyHash(UPackage* Key) { return ::PointerHash(Key); }
62 };
64
65 int32 NumElements;
66 TWriteBarrier<VValue> Elements[];
67};
68
69inline UVerseStruct* VTupleType::GetOrCreateUStruct(FAllocationContext Context, UPackage* Package, bool bIsInstanced)
70{
71 if (TWriteBarrier<VValue>* Entry = AssociatedUStructs.Find({Context, Package}))
72 {
73 return CastChecked<UVerseStruct>(Entry->Get().AsUObject());
74 }
75
76 return CreateUStruct(Context, Package, bIsInstanced);
77}
78
79} // namespace Verse
80#endif // WITH_VERSE_VM
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
T * New(FMemStackBase &Mem, int32 Count=1, int32 Align=DEFAULT_ALIGNMENT)
Definition MemStack.h:259
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition ContainerAllocationPolicies.h:1660
Definition JsonObject.h:23
Definition JsonValue.h:22
Definition ArrayView.h:139
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition Package.h:216
Definition VVMVerseStruct.h:33
FORCEINLINE T * Get(const FObjectPtr &ObjectPtr)
Definition ObjectPtr.h:426
bool SerializeImpl(const UScriptStruct *InSourceEventType, const void *InSourceEventData, FLiveLinkSerializedFrameData &OutSerializedData)
Definition LiveLinkCompression.cpp:126
Definition Archive.h:36
VERSECOMPILER_API bool Matches(const CTypeBase *PositiveType1, const CTypeBase *NegativeType2, const uint32_t UploadedAtFnVersion)
Determine if argument PositiveType1 is a match for parameter NegativeType2
Definition SemanticTypes.cpp:2971
U16 Index
Definition radfft.cpp:71
Definition Map.h:77