UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VVMMutableArray.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 "VVMArray.h"
8#include "VVMArrayBase.h"
11
12namespace Verse
13{
14struct FOp;
15struct FOpResult;
16struct VTask;
17
19{
22
23public:
24 void Reset(FAllocationContext Context);
25
27 void AddValue(FAllocationContext Context, VValue Value);
28
30 COREUOBJECT_API void RemoveRange(uint32 StartIndex, uint32 Count);
31
33 COREUOBJECT_API void RemoveSwap(uint32 RemoveIndex);
34
35 template <typename T>
36 void Append(FAllocationContext Context, VArrayBase& Array);
37 void Append(FAllocationContext Context, VArrayBase& Array);
38
39 static VMutableArray& Concat(FAllocationContext Context, VArrayBase& Lhs, VArrayBase& Rhs);
40
41 void InPlaceMakeImmutable(FAllocationContext Context)
42 {
43 static_assert(std::is_base_of_v<VArrayBase, VArray>);
44 static_assert(sizeof(VArray) == sizeof(VArrayBase));
45 SetEmergentType(Context, &VArray::GlobalTrivialEmergentType.Get(Context));
46 }
47
48 static VMutableArray& New(FAllocationContext Context, uint32 NumValues, uint32 InitialCapacity, EArrayType ArrayType)
49 {
50 return *new (Context.AllocateFastCell(sizeof(VMutableArray))) VMutableArray(Context, NumValues, InitialCapacity, ArrayType);
51 }
52
53 static VMutableArray& New(FAllocationContext Context, std::initializer_list<VValue> InitList)
54 {
55 return *new (Context.AllocateFastCell(sizeof(VMutableArray))) VMutableArray(Context, InitList);
56 }
57
58 template <typename InitIndexFunc, typename = std::enable_if_t<std::is_same_v<VValue, std::invoke_result_t<InitIndexFunc, uint32>>>>
59 static VMutableArray& New(FAllocationContext Context, uint32 InNumValues, InitIndexFunc&& InitFunc)
60 {
61 return *new (Context.AllocateFastCell(sizeof(VMutableArray))) VMutableArray(Context, InNumValues, InitFunc);
62 }
63
64 static VMutableArray& New(FAllocationContext Context, FUtf8StringView String)
65 {
66 return *new (Context.AllocateFastCell(sizeof(VMutableArray))) VMutableArray(Context, String);
67 }
68
69 static VMutableArray& New(FAllocationContext Context)
70 {
71 return VMutableArray::New(Context, 0, 0, EArrayType::None);
72 }
73
74 static void SerializeLayout(FAllocationContext Context, VMutableArray*& This, FStructuredArchiveVisitor& Visitor) { SerializeLayoutImpl<VMutableArray>(Context, This, Visitor); }
75
76 COREUOBJECT_API FOpResult FreezeImpl(FAllocationContext Context, VTask*, FOp* AwaitPC);
77
78private:
79 VMutableArray(FAllocationContext Context, uint32 NumValues, uint32 InitialCapacity, EArrayType ArrayType)
80 : VArrayBase(Context, NumValues, InitialCapacity, ArrayType, &GlobalTrivialEmergentType.Get(Context))
81 {
82 V_DIE_UNLESS(InitialCapacity >= NumValues);
83 }
84
85 VMutableArray(FAllocationContext Context, std::initializer_list<VValue> InitList)
87 {
88 }
89
90 template <typename InitIndexFunc, typename = std::enable_if_t<std::is_same_v<VValue, std::invoke_result_t<InitIndexFunc, uint32>>>>
93 {
94 }
95
96 VMutableArray(FAllocationContext Context, FUtf8StringView String)
98 {
99 }
100
102 void CopyRange(uint32 SrcIndex, uint32 DstIndex, uint32 Count);
103
106};
107
108} // namespace Verse
109#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
FORCEINLINE T * Get(const FObjectPtr &ObjectPtr)
Definition ObjectPtr.h:426
Definition Archive.h:36