UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
InstancedReferenceSubobjectHelper.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
8
15struct UE_DEPRECATED(5.6, "Deprecated; this type is no longer in use.") FInstancedPropertyPath
16{
17private:
18 struct FPropertyLink
19 {
22 {}
23
25 int32 ArrayIndex;
26 bool bIsMapValue;
27 };
28
29public:
30 //--------------------------------------------------------------------------
32 {
33 Push(RootProperty, ArrayIndex, bIsMapValue);
34 }
35
36 //--------------------------------------------------------------------------
37 void Push(const FProperty* Property, int32 ArrayIndex = INDEX_NONE, bool bIsMapValue = false)
38 {
39 PropertyChain.Add(FPropertyLink(Property, ArrayIndex, bIsMapValue));
40 }
41
42 //--------------------------------------------------------------------------
43 void Pop()
44 {
45 PropertyChain.RemoveAt(PropertyChain.Num() - 1);
46 }
47
48 //--------------------------------------------------------------------------
49 const FProperty* Head() const
50 {
51 return PropertyChain.Last().PropertyPtr;
52 }
53
54 //--------------------------------------------------------------------------
56
57private:
58 TArray<FPropertyLink> PropertyChain;
59};
60
62
68struct UE_DEPRECATED(5.6, "Deprecated; this type is no longer in use.") FInstancedSubObjRef
69{
73 {}
74
75 //--------------------------------------------------------------------------
76 operator UObject*() const
77 {
78 return SubObjInstance;
79 }
80
81 //--------------------------------------------------------------------------
82 UObject* operator->() const
83 {
84 return SubObjInstance;
85 }
86
87 //--------------------------------------------------------------------------
89 {
91 }
92
95};
96
102{
103public:
104 template<typename T>
105 UE_DEPRECATED(5.6, "Deprecated; use GetObjectsWithOuter() instead, or use TPropertyValueIterator<FObjectProperty> and check for the CPF_InstancedReference flag if you specifically need this functionality.")
107 {
109 for (FProperty* Prop = ContainerClass->RefLink; Prop; Prop = Prop->NextRef)
110 {
111 for (int32 ArrayIdx = 0; ArrayIdx < Prop->ArrayDim; ++ArrayIdx)
112 {
114 const uint8* ValuePtr = Prop->ContainerPtrToValuePtr<uint8>(Container, ArrayIdx);
115 ForEachInstancedSubObject<const void*>(RootPropertyPath, ValuePtr, [&OutObjects](const FInstancedSubObjRef& Ref, const void*){ OutObjects.Add(Ref); });
116 }
117 }
118 }
119
120 template<typename T>
121 UE_DEPRECATED(5.6, "Deprecated; use GetObjectsWithOuter() instead, or recursively use a TPropertyValueIterator<FObjectProperty> and check for the CPF_InstancedReference flag if you specifically need this functionality.")
123 {
125 for (FProperty* Prop = ContainerClass->RefLink; Prop; Prop = Prop->NextRef)
126 {
127 for (int32 ArrayIdx = 0; ArrayIdx < Prop->ArrayDim; ++ArrayIdx)
128 {
130 const uint8* ValuePtr = Prop->ContainerPtrToValuePtr<uint8>(Container, ArrayIdx);
132 {
133 if (!OutObjects.Contains(Ref))
134 {
135 OutObjects.Add(Ref);
136 GetInstancedSubObjectsRecursive(Ref.SubObjInstance, OutObjects);
137 }
138 });
139 }
140 }
141 }
142
143 UE_DEPRECATED(5.6, "Deprecated; this method was originally implemented for internal use only.")
147 TMap<UObject*, UObject*>& ReferenceReplacementMap,
148 TArray<UObject*>& DuplicatedObjects,
150
152 UE_DEPRECATED(5.6, "Deprecated; use a container helper (e.g. FScriptArrayHelper) instead if you need to iterate over the values of a container property given its value address.")
154};
155
EGLSurface EGLint const EGLint EGLnsecsANDROID * values
Definition AndroidOpenGLFunctions.h:11
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
if(Failed) console_printf("Failed.\n")
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition InstancedReferenceSubobjectHelper.h:102
static void ForEachInstancedSubObject(FInstancedPropertyPath &PropertyPath, T ContainerAddress, TFunctionRef< void(const FInstancedSubObjRef &Ref, T PropertyValueAddress)> ObjRefFunc)
static void GetInstancedSubObjectsRecursive(const UObject *Container, T &OutObjects)
Definition InstancedReferenceSubobjectHelper.h:122
static void GetInstancedSubObjects(const UObject *Container, T &OutObjects)
Definition InstancedReferenceSubobjectHelper.h:106
Definition UnrealType.h:3087
Definition UnrealType.h:174
Definition UnrealType.h:4175
Definition PropertyPath.Build.cs:6
Definition Array.h:670
Definition AssetRegistryState.h:50
Definition UnrealString.h.inl:34
Definition Class.h:3793
FORCEINLINE UClass * GetClass() const
Definition UObjectBase.h:217
Definition Object.h:95
uint32 GetTypeHash(const FKey &Key)
Definition BlackboardKey.h:35