UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VVMPackage.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 "Misc/Optional.h"
8#include "VVMCell.h"
11#include "VerseVM/VVMNames.h"
12
13class UPackage;
14struct FCoreRedirect;
15
16namespace Verse
17{
18struct VNamedType;
19struct VProgram;
20struct VTupleType;
21struct VMutableArray;
22struct VWeakCellMap;
23
24enum class EDigestVariant : uint8
25{
27 PublicOnly = 1,
28};
29
31{
35};
36
37struct VPackage : VCell
38{
41
42 TOptional<FVersionedDigest> DigestVariants[2]; // One for each variant
43
44 VUniqueString& GetName() const { return *Name; }
45 VUniqueString& GetRootPath() const { return *RootPath; }
46
47 uint32 NumDefinitions() const { return Definitions.Num(); }
48 VUniqueString& GetDefinitionName(uint32 Index) const { return Definitions.GetName(Index); }
49 VValue GetDefinition(uint32 Index) const { return Definitions.GetValue(Index).Follow(); }
50 void AddDefinition(FAllocationContext Context, VUniqueString& Path, VValue Definition) { Definitions.AddValue(Context, Path, Definition); }
51 VValue LookupDefinition(FUtf8StringView Path) const { return Definitions.Lookup(Path); }
52 template <typename CellType>
53 CellType* LookupDefinition(FUtf8StringView Path) const { return Definitions.LookupCell<CellType>(Path); }
54
56 template <typename FunctorType> // FunctorType is (VTupleType*) -> void
57 void ForEachUsedTupleType(FunctorType&& Functor);
58
60 template <typename FunctorType> // FunctorType is (VNamedType*) -> void
61 void ForEachUsedImport(FunctorType&& Functor);
62
68
69 static VPackage& New(FAllocationContext Context, VUniqueString& Name, VUniqueString& RootPath, uint32 Capacity)
70 {
71 return *new (Context.Allocate(FHeap::DestructorAndCensusSpace, sizeof(VPackage))) VPackage(Context, &Name, &RootPath, Capacity);
72 }
73
74 COREUOBJECT_API void RecordCells(FAllocationContext Context);
75
76 static void SerializeLayout(FAllocationContext Context, VPackage*& This, FStructuredArchiveVisitor& Visitor);
77 void SerializeImpl(FAllocationContext Context, FStructuredArchiveVisitor& Visitor);
78
79private:
80 friend struct VIntrinsics;
81
82 COREUOBJECT_API VPackage(FAllocationContext Context, VUniqueString* InName, VUniqueString* InRootPath, uint32 Capacity);
83 ~VPackage();
84
87
88 VNameValueMap Definitions;
89
90 // Keep track of tuple types and imports here in addition to the corresponding global maps in VProgram
91 // so that during incremental compilation we can populate the global maps with these
94
96 TArray<FCoreRedirect> Redirects;
97};
98} // namespace Verse
99#endif // WITH_VERSE_VM
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
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 Package.h:216
IMAGECORE_API const TCHAR * GetName(Type Format)
Definition ImageCore.cpp:1378
const FColor Path(255, 255, 255)
bool SerializeImpl(const UScriptStruct *InSourceEventType, const void *InSourceEventData, FLiveLinkSerializedFrameData &OutSerializedData)
Definition LiveLinkCompression.cpp:126
Definition Archive.h:36
U16 Index
Definition radfft.cpp:71
Definition CoreRedirects.h:220
Definition Optional.h:131