UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ManagedArrayTypes.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
7#include "Math/Color.h"
8#include "Math/IntVector.h"
9#include "Math/Quat.h"
10#include "Math/Transform.h"
11#include "Math/Vector.h"
12#include "Math/Vector2D.h"
13#include "Math/Box.h"
14
16#include "Chaos/BVHParticles.h"
19#include "Chaos/Convex.h"
20#include "Chaos/Matrix.h"
21#include "Chaos/Curve.h"
22
24{
25 check(false); //We don't serialize raw pointers to arrays. Use unique ptr
26 return Ar;
27}
28
30{
31 bool bExists = ValueIn.Get() != nullptr;
32 Ar << bExists;
33 if (bExists)
34 {
35 if (Ar.IsLoading())
36 {
38 }
39 Ar << *ValueIn;
40 }
41
42 return Ar;
43}
44
46{
47 check(false); //We don't serialize raw pointers to implicit objects. Use unique ptr
48 return Ar;
49}
50
51template <typename T, int d, bool bPersistent>
53{
54 verifyf(false, TEXT("TPBDRigidParticleHandleImp* should never be serialized! Use unique ptr."));
55 return Ar;
56}
57
58// ---------------------------------------------------------
59//
60// General purpose EManagedArrayType definition.
61// This defines things like
62// EManagedArrayType::FVectorType
63// see ManagedArrayTypeValues.inl for specific types.
64//
65#define MANAGED_ARRAY_TYPE(a,A) F##A##Type,
67{
70};
71#undef MANAGED_ARRAY_TYPE
72
73// ---------------------------------------------------------
74// ManagedArrayType<T>
75// Templated function to return a EManagedArrayType.
76//
77template<class T> inline EManagedArrayType ManagedArrayType();
78#define MANAGED_ARRAY_TYPE(a,A) template<> inline EManagedArrayType ManagedArrayType<a>() { return EManagedArrayType::F##A##Type; }
80#undef MANAGED_ARRAY_TYPE
81
82
83// ---------------------------------------------------------
84// ManagedArrayType<T>
85// Returns a new EManagedArray shared pointer based on
86// passed type.
87//
89{
90 switch (ArrayType)
91 {
92#define MANAGED_ARRAY_TYPE(a,A) case EManagedArrayType::F##A##Type:\
93 return new TManagedArray<a>();
95#undef MANAGED_ARRAY_TYPE
96 }
97 check(false);
98 return nullptr;
99}
#define check(expr)
Definition AssertionMacros.h:314
#define verifyf(expr, format,...)
Definition AssertionMacros.h:320
#define TEXT(x)
Definition Platform.h:1272
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
FManagedArrayBase * NewManagedTypedArray(EManagedArrayType ArrayType)
Definition ManagedArrayTypes.h:88
FArchive & operator<<(FArchive &Ar, TArray< FVector3f > *&ValueIn)
Definition ManagedArrayTypes.h:23
EManagedArrayType
Definition ManagedArrayTypes.h:67
EManagedArrayType ManagedArrayType()
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition ImplicitObject.h:111
Definition ParticleHandle.h:987
Definition Archive.h:1208
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
Definition ManagedArray.h:154
Definition Array.h:670
Definition UniquePtr.h:107