UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VVMProgram.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 "VVMPackage.h"
9#include "VVMTupleType.h"
11
12namespace Verse
13{
14struct VFunction;
15struct VIntrinsics;
16struct VMapBase;
17
18struct VProgram : VCell
19{
22
23 uint32 NumPackages() const { return PackageMap.Num(); }
24 const VUniqueString& GetPackageName(uint32 Index) const { return PackageMap.GetName(Index); }
25 VPackage& GetPackage(uint32 Index) const { return PackageMap.GetCell<VPackage>(Index); }
26 COREUOBJECT_API void AddPackage(FAllocationContext Context, VUniqueString& Name, VPackage& Package, bool bRegisterUsedTypes);
27 COREUOBJECT_API void RemovePackage(FUtf8StringView VersePackageName);
28 VPackage* LookupPackage(FUtf8StringView VersePackageName) const { return PackageMap.LookupCell<VPackage>(VersePackageName); }
29 VPackage* LookupPackageByFName(FName VersePackageName) const { return PackageMap.LookupCellByFName<VPackage>(VersePackageName); }
30
31 // Will overwrite existing entry if exists
34
35 // Will overwrite existing entry if exists
36 COREUOBJECT_API void AddImport(FAllocationContext Context, VNamedType& TypeWithImport, UField* ImportedType);
38 VPackage* LookupPackage(FAllocationContext Context, UPackage* Package);
39
40 VIntrinsics& GetIntrinsics() const { return *Intrinsics.Get(); }
41 void AddIntrinsics(FAllocationContext Context, VIntrinsics& InIntrinsics) { Intrinsics.Set(Context, InIntrinsics); }
42
45
46 COREUOBJECT_API void Reset(FAllocationContext Context);
47
48 static VProgram& New(FAllocationContext Context, uint32 Capacity)
49 {
50 return *new (Context.AllocateFastCell(sizeof(VProgram))) VProgram(Context, Capacity);
51 }
52
53private:
54 VProgram(FAllocationContext Context, uint32 Capacity)
56 , PackageMap(Context, Capacity)
57 {
58 }
59
60 VNameValueMap PackageMap;
62 TWriteBarrier<VMapBase> ImportMap; // For reverse lookup UField -> VNamedType
65};
66} // namespace Verse
67#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
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition NameTypes.h:617
Definition Class.h:181
Definition Package.h:216
FORCEINLINE T * Get(const FObjectPtr &ObjectPtr)
Definition ObjectPtr.h:426
UPackage * GetPackage(const UObject *Obj)
Definition ObjectFwd.cpp:33
Definition Archive.h:36
U16 Index
Definition radfft.cpp:71