UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VVMWeakCellMap.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 "Containers/Map.h"
8#include "CoreTypes.h"
9#include "VVMCell.h"
11
12namespace Verse
13{
14
15struct VWeakCellMap : VCell
16{
19
20 static VWeakCellMap& New(FAllocationContext Context)
21 {
22 return *new (Context.Allocate(FHeap::DestructorAndCensusSpace, sizeof(VWeakCellMap))) VWeakCellMap(Context);
23 }
24
27 COREUOBJECT_API void Remove(VCell* Key);
28 template <typename FunctorType> // FunctorType is (VCell*,VCell*) -> void
29 void ForEach(FunctorType&& Functor);
30
31 // This function is a test-only function because it has a very limited kind of meaning. Requesting the size (or
32 // checking the emptiness) of a weak map gives a kind of upper bound: it means that the map has at most this many
33 // entries. But we cannot tell you which of those entries are real. When you query them, you are likely to find
34 // fewer entries.
35 bool IsEmpty() const { return Map.IsEmpty(); }
36
37 size_t GetAllocatedSize() const
38 {
39 return Map.GetAllocatedSize();
40 }
41
42private:
43 COREUOBJECT_API VWeakCellMap(FAllocationContext Context);
45
47
49};
50
51} // namespace Verse
52#endif // WITH_VERSE_VM
EForEachResult ForEach(T &Array, const PREDICATE_CLASS &Predicate)
Definition AISense_Sight.cpp:60
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
Definition UnrealString.h.inl:34
SIZE_T GetAllocatedSize(const T &Value)
Definition ManagedArray.h:93
Definition Archive.h:36