UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PropertyBag.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Misc/TVariantMeta.h"
11
12#include "PropertyBag.generated.h"
13
14#define UE_API COREUOBJECT_API
15
17UENUM(BlueprintType)
19{
21 Bool,
22 Byte,
23 Int32,
24 Int64,
25 Float,
26 Double,
27 Name,
28 String,
29 Text,
35 SoftClass UMETA(Hidden),
36 UInt32, // Type not fully supported at UI, will work with restrictions to type editing
37 UInt64, // Type not fully supported at UI, will work with restrictions to type editing
38
40};
41
43UENUM(BlueprintType)
45{
46 None,
47 Array,
48 Set,
49
51};
52
54{
55 COREUOBJECT_API extern const FGuid GUID;
56}
57
59USTRUCT()
61{
63
65
67 {
68 if (ContainerType != EPropertyBagContainerType::None)
69 {
70 Add(ContainerType);
71 }
72 }
73
74 FPropertyBagContainerTypes(const std::initializer_list<EPropertyBagContainerType>& InTypes)
75 {
76 for (const EPropertyBagContainerType ContainerType : InTypes)
77 {
78 if (ContainerType != EPropertyBagContainerType::None)
79 {
80 Add(ContainerType);
81 }
82 }
83 }
84
86 {
87 if (ensure(NumContainers < MaxNestedTypes))
88 {
90 {
91 Types[NumContainers] = PropertyBagContainerType;
92 NumContainers++;
93
94 return true;
95 }
96 }
97
98 return false;
99 }
100
101 void Reset()
102 {
103 for (EPropertyBagContainerType& Type : Types)
104 {
106 }
107 NumContainers = 0;
108 }
109
110 bool IsEmpty() const
111 {
112 return NumContainers == 0;
113 }
114
115 uint32 Num() const
116 {
117 return NumContainers;
118 }
119
120 bool CanAdd() const
121 {
122 return NumContainers < MaxNestedTypes;
123 }
124
126 {
127 return NumContainers > 0 ? Types[0] : EPropertyBagContainerType::None;
128 }
129
131 {
132 return ensure(Index < NumContainers) ? Types[Index] : EPropertyBagContainerType::None;
133 }
134
136
137 UE_API void Serialize(FArchive& Ar);
138
144
145 UE_API bool operator == (const FPropertyBagContainerTypes& Other) const;
146
148 {
149 return !(Other == *this);
150 }
151
156
157 EPropertyBagContainerType* begin() { return Types.GetData(); }
158 const EPropertyBagContainerType* begin() const { return Types.GetData(); }
159 EPropertyBagContainerType* end() { return Types.GetData() + NumContainers; }
160 const EPropertyBagContainerType* end() const { return Types.GetData() + NumContainers; }
161
162protected:
163 static constexpr uint8 MaxNestedTypes = 2;
164
166 uint8 NumContainers = 0;
167};
168
170UENUM()
172{
173 Success, // Operation succeeded.
174 TypeMismatch, // Tried to access mismatching type (e.g. setting a struct to bool)
175 OutOfBounds, // Tried to access an array property out of bounds.
176 PropertyNotFound, // Could not find property of specified name.
177 DuplicatedValue, // Tried to set an already existing Set Entry
178};
179
181UENUM()
183{
184 Success, // Operation succeeded.
185 NoOperation = Success UMETA(Hidden), // No operation was necessary to warrant a successful operation. Semantic alias.
186 InternalError, // The operation could not be completed, due to an internal property bag error.
187 PropertyNameEmpty, // The property name is empty.
188 PropertyNameInvalidCharacters, // The property name contains illegal characters. Consider using FInstancedPropertyBag::SanitizePropertyName.
189 SourcePropertyNotFound, // The source property or property name was not found.
190 TargetPropertyNotFound, // The target property or property name was not found.
191 TargetPropertyAlreadyExists // The target property or property name already exists.
192};
193
194USTRUCT()
196{
198
201 : Key(InKey)
202 , Value(InValue)
203 {
204 }
205
206 UPROPERTY()
207 FName Key;
208
209 UPROPERTY()
210 FString Value;
211
212 UE_API void Serialize(FArchive& Ar);
213
214 bool operator==(const FPropertyBagPropertyDescMetaData& Other) const
215 {
216 return Key == Other.Key && Value == Other.Value;
217 }
218
224
229
231 {
232 uint32 Hash = GetTypeHash(MetaData.Num());
234 {
235 Hash = HashCombine(Hash, GetTypeHash(PropertyDescMetaData));
236 }
237 return Hash;
238 }
239
244};
245
247USTRUCT()
249{
251
252 static_assert(std::is_same_v<std::underlying_type_t<EPropertyFlags>, uint64>, "FPropertyBagPropertyDesc::PropertyFlag does not match EPropertyFlags type");
253
257 : ValueTypeObject(InValueTypeObject)
258 , Name(InName)
259 , ValueType(InValueType)
260 {
261 }
263 : ValueTypeObject(InValueTypeObject)
264 , Name(InName)
265 , ValueType(InValueType)
266 , ContainerTypes(InContainerType)
267 , PropertyFlags((uint64)InPropertyFlags)
268 {
269 }
270
272 : ValueTypeObject(InValueTypeObject)
273 , Name(InName)
274 , ValueType(InValueType)
275 , ContainerTypes(InNestedContainers)
276 , PropertyFlags((uint64)InPropertyFlags)
277 {
278 }
279
281 UE_API bool CompatibleType(const FPropertyBagPropertyDesc& Other) const;
282
284 UE_API bool IsNumericType() const;
285
287 UE_API bool IsUnsignedNumericType() const;
288
290 UE_API bool IsNumericFloatType() const;
291
293 UE_API bool IsObjectType() const;
294
296 UE_API bool IsClassType() const;
297
299 int32 GetCachedIndex() const { return CachedIndex; }
300
302 UE_API bool operator==(const FPropertyBagPropertyDesc& OtherDesc) const;
303
311
312#if WITH_EDITOR
314 UE_API bool HasMetaData(FName SpecifierName) const;
315
317 UE_API void SetMetaData(FName SpecifierName, const FString& InValue);
318
320 UE_API FString GetMetaData(FName SpecifierName) const;
321
324#endif // WITH_EDITOR
325
327 UPROPERTY(EditAnywhere, Category="Default")
328 TObjectPtr<const UObject> ValueTypeObject = nullptr;
329
331 UPROPERTY(EditAnywhere, Category="Default")
333
335 UPROPERTY(EditAnywhere, Category="Default")
337
339 UPROPERTY(EditAnywhere, Category="Default")
341
343 UPROPERTY(EditAnywhere, Category="Default")
345
347 UPROPERTY(EditAnywhere, Category = "Default")
348 uint64 PropertyFlags = (uint64)CPF_Edit;
349
350#if WITH_EDITORONLY_DATA
352 UPROPERTY(EditAnywhere, Category="Default")
354
356 UPROPERTY(EditAnywhere, Category = "Default")
357 TObjectPtr<class UClass> MetaClass;
358#endif
359
361 const FProperty* CachedProperty = nullptr;
362
363private:
364 friend class UPropertyBag;
365
367 int32 CachedIndex = INDEX_NONE;
368};
369
412class UPropertyBag;
415
416USTRUCT()
418{
420
424
427
429 bool IsValid() const
430 {
431 return Value.IsValid();
432 }
433
435 void Reset()
436 {
437 Value.Reset();
438 }
439
441 UE_API void InitializeFromBagStruct(const UPropertyBag* NewBagStruct);
442
450
458
460 UE_API int32 GetNumPropertiesInBag() const;
461
470
480 UE_API EPropertyBagAlterationResult AddProperty(const FName InName, const EPropertyBagPropertyType InValueType, const UObject* InValueTypeObject = nullptr, bool bOverwrite = true);
481
492
503
512 UE_API EPropertyBagAlterationResult AddProperty(const FName InName, const FProperty* InSourceProperty, bool bOverwrite = true);
513
519 UE_API EPropertyBagAlterationResult DuplicateProperty(FName InName, FName* InOutNewName = nullptr);
520
528
535
542
550
559
568
574 UE_API void MigrateToNewBagStruct(const UPropertyBag* NewBagStruct);
575
582 UE_API void MigrateToNewBagInstance(const FInstancedPropertyBag& InNewBagInstance);
583
591 UE_API void MigrateToNewBagInstanceWithOverrides(const FInstancedPropertyBag& InNewBagInstance, TConstArrayView<FGuid> OverriddenPropertyIDs);
592
594 UE_API const UPropertyBag* GetPropertyBagStruct() const;
595
597 UE_API const FPropertyBagPropertyDesc* FindPropertyDescByID(const FGuid ID) const;
598
600 UE_API const FPropertyBagPropertyDesc* FindPropertyDescByName(const FName Name) const;
601
603 UE_API bool OwnsPropertyDesc(const FPropertyBagPropertyDesc& Desc) const;
604
606 UE_API bool HasSameLayout(const FInstancedPropertyBag& Other) const;
607
609 FConstStructView GetValue() const { return Value; };
610
613
615 UE_API FInstancedStruct Detach();
616
635 UE_API TValueOrError<UObject*, EPropertyBagResult> GetValueObject(const FName Name, const UClass* RequestedClass = nullptr) const;
638
640 UE_API TValueOrError<FString, EPropertyBagResult> GetValueSerializedString(const FName Name) const;
641
643 template <typename T>
645 {
646 static_assert(TIsEnum<T>::Value, "Should only call this with enum types");
647
649 if (!Result.IsValid())
650 {
651 return MakeError(Result.GetError());
652 }
653 return MakeValue(static_cast<T>(Result.GetValue()));
654 }
655
657 template <typename T>
659 {
661 if (!Result.IsValid())
662 {
663 return MakeError(Result.GetError());
664 }
665 if (T* ValuePtr = Result.GetValue().GetPtr<T>())
666 {
667 return MakeValue(ValuePtr);
668 }
670 }
671
673 template <typename T>
675 {
676 static_assert(TIsDerivedFrom<T, UObject>::Value, "Should only call this with object types");
677
678 TValueOrError<UObject*, EPropertyBagResult> Result = GetValueObject(Name, T::StaticClass());
679 if (!Result.IsValid())
680 {
681 return MakeError(Result.GetError());
682 }
683 if (Result.GetValue() == nullptr)
684 {
685 return MakeValue(nullptr);
686 }
687 if (T* Object = Cast<T>(Result.GetValue()))
688 {
689 return MakeValue(Object);
690 }
692 }
693
707 UE_API TValueOrError<UObject*, EPropertyBagResult> GetValueObject(const FPropertyBagPropertyDesc& Desc, const UClass* RequestedClass = nullptr) const;
714
716 template <typename T>
718 {
719 static_assert(TIsEnum<T>::Value, "Should only call this with enum types");
720
721 TValueOrError<uint8, EPropertyBagResult> Result = GetValueEnum(Desc, StaticEnum<T>());
722 if (!Result.IsValid())
723 {
724 return MakeError(Result.GetError());
725 }
726 return MakeValue(static_cast<T>(Result.GetValue()));
727 }
728
730 template <typename T>
732 {
734 if (!Result.IsValid())
735 {
736 return MakeError(Result.GetError());
737 }
738 if (T* ValuePtr = Result.GetValue().GetPtr<T>())
739 {
740 return MakeValue(ValuePtr);
741 }
743 }
744
746 template <typename T>
748 {
749 static_assert(TIsDerivedFrom<T, UObject>::Value, "Should only call this with object types");
750
751 TValueOrError<UObject*, EPropertyBagResult> Result = GetValueObject(Desc, T::StaticClass());
752 if (!Result.IsValid())
753 {
754 return MakeError(Result.GetError());
755 }
756 if (Result.GetValue() == nullptr)
757 {
758 return MakeValue(nullptr);
759 }
760 if (T* Object = Cast<T>(Result.GetValue()))
761 {
762 return MakeValue(Object);
763 }
765 }
766
771 UE_API EPropertyBagResult SetValueBool(const FName Name, const bool bInValue);
772 UE_API EPropertyBagResult SetValueByte(const FName Name, const uint8 InValue);
773 UE_API EPropertyBagResult SetValueInt32(const FName Name, const int32 InValue);
774 UE_API EPropertyBagResult SetValueUInt32(const FName Name, const uint32 InValue);
775 UE_API EPropertyBagResult SetValueInt64(const FName Name, const int64 InValue);
776 UE_API EPropertyBagResult SetValueUInt64(const FName Name, const uint64 InValue);
777 UE_API EPropertyBagResult SetValueFloat(const FName Name, const float InValue);
778 UE_API EPropertyBagResult SetValueDouble(const FName Name, const double InValue);
779 UE_API EPropertyBagResult SetValueName(const FName Name, const FName InValue);
780 UE_API EPropertyBagResult SetValueString(const FName Name, const FString& InValue);
781 UE_API EPropertyBagResult SetValueText(const FName Name, const FText& InValue);
782 UE_API EPropertyBagResult SetValueEnum(const FName Name, const uint8 InValue, const UEnum* Enum);
784 UE_API EPropertyBagResult SetValueObject(const FName Name, UObject* InValue);
785 UE_API EPropertyBagResult SetValueClass(const FName Name, UClass* InValue);
786 UE_API EPropertyBagResult SetValueSoftPath(const FName Name, const FSoftObjectPath& InValue);
787 UE_API EPropertyBagResult SetValueSoftPath(const FName Name, const UObject* InValue);
788
793 UE_API EPropertyBagResult SetValueSerializedString(const FName Name, const FString& InValue);
794
796 template <typename T>
798 {
799 static_assert(TIsEnum<T>::Value, "Should only call this with enum types");
800 return SetValueEnum(Name, static_cast<uint8>(InValue), StaticEnum<T>());
801 }
802
804 template <typename T>
806 {
807 return SetValueStruct(Name, FConstStructView::Make(InValue));
808 }
809
811 template <typename T>
813 {
814 static_assert(TIsDerivedFrom<T, UObject>::Value, "Should only call this with object types");
815 return SetValueObject(Name, (UObject*)InValue);
816 }
817
823
824 UE_API EPropertyBagResult SetValueBool(const FPropertyBagPropertyDesc& Desc, const bool bInValue);
825 UE_API EPropertyBagResult SetValueByte(const FPropertyBagPropertyDesc& Desc, const uint8 InValue);
826 UE_API EPropertyBagResult SetValueInt32(const FPropertyBagPropertyDesc& Desc, const int32 InValue);
827 UE_API EPropertyBagResult SetValueUInt32(const FPropertyBagPropertyDesc& Desc, const uint32 InValue);
828 UE_API EPropertyBagResult SetValueInt64(const FPropertyBagPropertyDesc& Desc, const int64 InValue);
829 UE_API EPropertyBagResult SetValueUInt64(const FPropertyBagPropertyDesc& Desc, const uint64 InValue);
830 UE_API EPropertyBagResult SetValueFloat(const FPropertyBagPropertyDesc& Desc, const float InValue);
831 UE_API EPropertyBagResult SetValueDouble(const FPropertyBagPropertyDesc& Desc, const double InValue);
832 UE_API EPropertyBagResult SetValueName(const FPropertyBagPropertyDesc& Desc, const FName InValue);
833 UE_API EPropertyBagResult SetValueString(const FPropertyBagPropertyDesc& Desc, const FString& InValue);
834 UE_API EPropertyBagResult SetValueText(const FPropertyBagPropertyDesc& Desc, const FText& InValue);
835 UE_API EPropertyBagResult SetValueEnum(const FPropertyBagPropertyDesc& Desc, const uint8 InValue, const UEnum* Enum);
839 UE_API EPropertyBagResult SetValueSoftPath(const FPropertyBagPropertyDesc& Desc, const FSoftObjectPath& InValue);
840 UE_API EPropertyBagResult SetValueSoftPath(const FPropertyBagPropertyDesc& Desc, const UObject* InValue);
841
843 template <typename T>
845 {
846 static_assert(TIsEnum<T>::Value, "Should only call this with enum types");
847 return SetValueEnum(Desc, static_cast<uint8>(InValue), StaticEnum<T>());
848 }
849
851 template <typename T>
853 {
854 return SetValueStruct(Desc, FConstStructView::Make(InValue));
855 }
856
858 template <typename T>
860 {
861 static_assert(TIsDerivedFrom<T, UObject>::Value, "Should only call this with object types");
862 return SetValueObject(Desc, (UObject*)InValue);
863 }
864
871
878
885
892
893 UE_API bool Identical(const FInstancedPropertyBag* Other, uint32 PortFlags) const;
894 UE_API bool Serialize(FArchive& Ar);
895 UE_API void AddStructReferencedObjects(FReferenceCollector& Collector);
896 UE_API void GetPreloadDependencies(TArray<UObject*>& OutDeps);
897
905 UE_API static bool IsPropertyNameValid(const FString& Name);
906
914 UE_API static bool IsPropertyNameValid(const FName Name);
915
922 UE_API static FName SanitizePropertyName(const FString& Name, const TCHAR ReplacementChar = TEXT('_'));
923
930 UE_API static FName SanitizePropertyName(FName Name, const TCHAR ReplacementChar = TEXT('_'));
931
932protected:
933 UE_API const void* GetValueAddress(const FPropertyBagPropertyDesc* Desc) const;
934 UE_API void* GetMutableValueAddress(const FPropertyBagPropertyDesc* Desc);
935
936 UPROPERTY(EditAnywhere, Category="", meta=(SequencerUseParentPropertyName=true))
938};
939
941{
942 enum
943 {
944 WithIdentical = true,
945 WithSerializer = true,
946 WithAddStructReferencedObjects = true,
947 WithGetPreloadDependencies = true,
948 };
949};
950
951
971{
972 FPropertyBagPropertyDesc ValueDesc;
973
974 const void* GetAddress(const int32 Index) const
975 {
976 if (IsValidIndex(Index) == false)
977 {
978 return nullptr;
979 }
980 // Ugly, but FScriptArrayHelper does not give us other option.
982 return static_cast<void*>(NonConstThis->GetRawPtr(Index));
983 }
984
985 void* GetMutableAddress(const int32 Index) const
986 {
987 if (IsValidIndex(Index) == false)
988 {
989 return nullptr;
990 }
991 // Ugly, but FScriptArrayHelper does not give us other option.
993 return (void*)NonConstThis->GetRawPtr(Index);
994 }
995
996public:
999 {
1000 const FArrayProperty* ArrayProperty = CastField<FArrayProperty>(InDesc.CachedProperty);
1001 check(ArrayProperty);
1002 check(ArrayProperty->Inner);
1003 // Create dummy desc for the inner property.
1004 ValueDesc.ValueType = InDesc.ValueType;
1005 ValueDesc.ValueTypeObject = InDesc.ValueTypeObject;
1006 ValueDesc.CachedProperty = ArrayProperty->Inner;
1007 ValueDesc.ContainerTypes = InDesc.ContainerTypes;
1008 ValueDesc.ContainerTypes.PopHead();
1009 }
1010
1032
1034 template <typename T>
1036 {
1037 static_assert(TIsEnum<T>::Value, "Should only call this with enum types");
1038
1040 if (!Result.IsValid())
1041 {
1042 return MakeError(Result.GetError());
1043 }
1044 return MakeValue(static_cast<T>(Result.GetValue()));
1045 }
1046
1048 template <typename T>
1050 {
1052 if (!Result.IsValid())
1053 {
1054 return MakeError(Result.GetError());
1055 }
1056 if (T* ValuePtr = Result.GetValue().GetPtr<T>())
1057 {
1058 return MakeValue(ValuePtr);
1059 }
1061 }
1062
1064 template <typename T>
1066 {
1067 static_assert(TIsDerivedFrom<T, UObject>::Value, "Should only call this with object types");
1068
1070 if (!Result.IsValid())
1071 {
1072 return MakeError(Result.GetError());
1073 }
1074 if (Result.GetValue() == nullptr)
1075 {
1076 return MakeValue(nullptr);
1077 }
1078 if (T* Object = Cast<T>(Result.GetValue()))
1079 {
1080 return MakeValue(Object);
1081 }
1083 }
1084
1091
1098
1120
1122 template <typename T>
1124 {
1125 static_assert(TIsEnum<T>::Value, "Should only call this with enum types");
1126 return SetValueEnum(Index, static_cast<uint8>(InValue), StaticEnum<T>());
1127 }
1128
1130 template <typename T>
1135
1137 template <typename T>
1139 {
1140 static_assert(TIsDerivedFrom<T, UObject>::Value, "Should only call this with object types");
1141 return SetValueObject(Index, static_cast<UObject*>(InValue));
1142 }
1143};
1144
1163{
1164public:
1167 {
1168 const FSetProperty* SetProperty = CastField<FSetProperty>(InDesc.CachedProperty);
1169 check(SetProperty);
1170 check(SetProperty->ElementProp);
1171 // Create dummy desc for the inner property.
1172 ValueDesc.ValueType = InDesc.ValueType;
1173 ValueDesc.ValueTypeObject = InDesc.ValueTypeObject;
1174 ValueDesc.CachedProperty = SetProperty->ElementProp;
1175 ValueDesc.ContainerTypes = InDesc.ContainerTypes;
1176 ValueDesc.ContainerTypes.PopHead();
1177 }
1178
1196
1198 template <typename T>
1200 {
1201 static_assert(TIsEnum<T>::Value, "Should only call this with enum types");
1202 return AddValueEnum(static_cast<uint8>(InValue), StaticEnum<T>());
1203 }
1204
1206 template <typename T>
1211
1213 template <typename T>
1215 {
1216 static_assert(TIsDerivedFrom<T, UObject>::Value, "Should only call this with object types");
1217 return AddValueObject(static_cast<UObject*>(InValue));
1218 }
1219
1220
1222 template <typename T>
1224 {
1225 int32 ElementIndex = FindElementIndex(&Value);
1226
1227 if (ElementIndex == INDEX_NONE)
1228 {
1230 }
1231
1232 RemoveAt(ElementIndex);
1234 }
1235
1237 template <typename T>
1239 {
1240 if (ValueDesc.CachedProperty == nullptr)
1241 {
1243 }
1244
1246 }
1247
1250 {
1251 return FScriptSetHelper::Num();
1252 }
1253
1254private:
1255
1256 FPropertyBagPropertyDesc ValueDesc;
1257
1258 template <typename T>
1259 EPropertyBagResult Add(const T& Value)
1260 {
1261 if (ValueDesc.CachedProperty == nullptr)
1262 {
1264 }
1265
1266 int32 ElementIndex = FindElementIndex(&Value);
1267
1268 if (ElementIndex != INDEX_NONE)
1269 {
1271 }
1272
1273 AddElement(&Value);
1275 }
1276};
1277
1281UENUM()
1283{
1284 Missing,
1285};
1286
1287USTRUCT()
1292
1293UCLASS(MinimalAPI)
1298
1299namespace UE::Private { struct FJsonStringifyImpl; }
1307UCLASS(Transient, MinimalAPI)
1309{
1310public:
1312
1313
1321 static UE_API const UPropertyBag* GetOrCreateFromDescs(const TConstArrayView<FPropertyBagPropertyDesc> InPropertyDescs, const TCHAR* PrefixName = nullptr);
1322
1325
1327 UE_API const FPropertyBagPropertyDesc* FindPropertyDescByID(const FGuid ID) const;
1328
1330 UE_API const FPropertyBagPropertyDesc* FindPropertyDescByName(const FName Name) const;
1331
1333 UE_API const FPropertyBagPropertyDesc* FindPropertyDescByPropertyName(const FName PropertyName) const;
1334
1336 UE_API const FPropertyBagPropertyDesc* FindPropertyDescByProperty(const FProperty* Property) const;
1337
1339 UE_API const FPropertyBagPropertyDesc* FindPropertyDescByIndex(int32 Index) const;
1340
1342 UE_API bool OwnsPropertyDesc(const FPropertyBagPropertyDesc& Desc) const;
1343
1344#if WITH_EDITOR
1347#endif // WITH_EDITOR
1348
1349protected:
1350
1351 UE_API void DecrementRefCount() const;
1352 UE_API void IncrementRefCount() const;
1353
1354 UE_API virtual void InitializeStruct(void* Dest, int32 ArrayDim = 1) const override;
1355 UE_API virtual void DestroyStruct(void* Dest, int32 ArrayDim = 1) const override;
1356 UE_API virtual void FinishDestroy() override;
1357
1358 UPROPERTY()
1360
1361 std::atomic<int32> RefCount = 0;
1362
1363 // both of these types need to serialize their property bag:
1365 friend struct ::UE::Private::FJsonStringifyImpl;
1366};
1367
1368#undef UE_API
#define check(expr)
Definition AssertionMacros.h:314
#define ensure( InExpression)
Definition AssertionMacros.h:464
@ INDEX_NONE
Definition CoreMiscDefines.h:150
@ InPlace
Definition CoreMiscDefines.h:162
UE_FORCEINLINE_HINT FieldType * CastField(FField *Src)
Definition Field.h:1106
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
FArchive & operator<<(FArchive &Ar, FEnvQueryDebugProfileData::FStep &Data)
Definition EnvQueryTypes.cpp:489
UE_FORCEINLINE_HINT bool operator!=(const FIndexedPointer &Other) const
Definition LockFreeList.h:76
bool IsNumericType(EMaterialValueType InType)
Definition MaterialShared.h:255
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
EPropertyFlags
Definition ObjectMacros.h:416
@ CPF_Edit
Property is user-settable in the editor.
Definition ObjectMacros.h:419
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
EPropertyBagAlterationResult
Definition PropertyBag.h:183
EPropertyBagPropertyType
Definition PropertyBag.h:19
EPropertyBagMissingEnum
Definition PropertyBag.h:1283
#define UE_API
Definition PropertyBag.h:14
EPropertyBagContainerType
Definition PropertyBag.h:45
EPropertyBagResult
Definition PropertyBag.h:172
constexpr uint32 HashCombine(uint32 A, uint32 C)
Definition TypeHash.h:36
uint32 GetArrayHash(const T *Ptr, uint64 Size, uint32 PreviousHash=0)
Definition TypeHash.h:200
UE_REWRITE TValueOrError_ErrorProxy< ArgTypes... > MakeError(ArgTypes &&... Args UE_LIFETIMEBOUND)
Definition ValueOrError.h:41
UE_REWRITE TValueOrError_ValueProxy< ArgTypes... > MakeValue(ArgTypes &&... Args UE_LIFETIMEBOUND)
Definition ValueOrError.h:35
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
virtual void Serialize(void *V, int64 Length)
Definition Archive.h:1689
Definition UnrealType.h:3702
Definition NameTypes.h:617
Definition PropertyBag.h:971
TValueOrError< T *, EPropertyBagResult > GetValueObject(const int32 Index) const
Definition PropertyBag.h:1065
UE_API TValueOrError< UObject *, EPropertyBagResult > GetValueObject(const int32 Index, const UClass *RequestedClass=nullptr) const
Definition PropertyBag.cpp:3630
UE_API EPropertyBagResult SetValueUInt32(const int32 Index, const uint32 InValue)
Definition PropertyBag.cpp:3723
UE_API TValueOrError< bool, EPropertyBagResult > GetValueBool(const int32 Index) const
Definition PropertyBag.cpp:3487
UE_API TValueOrError< FStructView, EPropertyBagResult > GetValueStruct(const int32 Index, const UScriptStruct *RequestedStruct=nullptr) const
Definition PropertyBag.cpp:3619
UE_API EPropertyBagResult SetValueStruct(const int32 Index, FConstStructView InValue)
Definition PropertyBag.cpp:3768
UE_API EPropertyBagResult SetValueClass(const int32 Index, UClass *InValue)
Definition PropertyBag.cpp:3778
UE_API EPropertyBagResult SetValueByte(const int32 Index, const uint8 InValue)
Definition PropertyBag.cpp:3713
UE_API TValueOrError< FText, EPropertyBagResult > GetValueText(const int32 Index) const
Definition PropertyBag.cpp:3597
UE_API EPropertyBagResult SetValueDouble(const int32 Index, const double InValue)
Definition PropertyBag.cpp:3743
UE_API EPropertyBagResult SetValueFloat(const int32 Index, const float InValue)
Definition PropertyBag.cpp:3738
UE_API TValueOrError< int32, EPropertyBagResult > GetValueInt32(const int32 Index) const
Definition PropertyBag.cpp:3509
UE_API TValueOrError< const FPropertyBagArrayRef, EPropertyBagResult > GetNestedArrayRef(const int32 Index=0) const
Definition PropertyBag.cpp:3677
UE_API EPropertyBagResult SetValueUInt64(const int32 Index, const uint64 InValue)
Definition PropertyBag.cpp:3733
TValueOrError< T *, EPropertyBagResult > GetValueStruct(const int32 Index) const
Definition PropertyBag.h:1049
UE_API TValueOrError< uint64, EPropertyBagResult > GetValueUInt64(const int32 Index) const
Definition PropertyBag.cpp:3542
UE_API TValueOrError< uint8, EPropertyBagResult > GetValueByte(const int32 Index) const
Definition PropertyBag.cpp:3498
UE_API TValueOrError< uint32, EPropertyBagResult > GetValueUInt32(const int32 Index) const
Definition PropertyBag.cpp:3520
UE_API TValueOrError< int64, EPropertyBagResult > GetValueInt64(const int32 Index) const
Definition PropertyBag.cpp:3531
UE_API EPropertyBagResult SetValueEnum(const int32 Index, const uint8 InValue, const UEnum *Enum)
Definition PropertyBag.cpp:3763
UE_API EPropertyBagResult SetValueName(const int32 Index, const FName InValue)
Definition PropertyBag.cpp:3748
UE_API EPropertyBagResult SetValueInt32(const int32 Index, const int32 InValue)
Definition PropertyBag.cpp:3718
EPropertyBagResult SetValueEnum(const int32 Index, const T InValue)
Definition PropertyBag.h:1123
UE_API TValueOrError< FString, EPropertyBagResult > GetValueString(const int32 Index) const
Definition PropertyBag.cpp:3586
UE_API TValueOrError< uint8, EPropertyBagResult > GetValueEnum(const int32 Index, const UEnum *RequestedEnum) const
Definition PropertyBag.cpp:3608
FPropertyBagArrayRef(const FPropertyBagPropertyDesc &InDesc, const void *InArray)
Definition PropertyBag.h:997
UE_API TValueOrError< FPropertyBagArrayRef, EPropertyBagResult > GetMutableNestedArrayRef(const int32 Index=0) const
Definition PropertyBag.cpp:3657
UE_API EPropertyBagResult SetValueObject(const int32 Index, UObject *InValue)
Definition PropertyBag.cpp:3773
UE_API EPropertyBagResult SetValueInt64(const int32 Index, const int64 InValue)
Definition PropertyBag.cpp:3728
UE_API EPropertyBagResult SetValueBool(const int32 Index, const bool bInValue)
Definition PropertyBag.cpp:3708
TValueOrError< T, EPropertyBagResult > GetValueEnum(const int32 Index) const
Definition PropertyBag.h:1035
UE_API TValueOrError< FName, EPropertyBagResult > GetValueName(const int32 Index) const
Definition PropertyBag.cpp:3575
UE_API TValueOrError< float, EPropertyBagResult > GetValueFloat(const int32 Index) const
Definition PropertyBag.cpp:3553
EPropertyBagResult SetValueStruct(const int32 Index, const T &InValue)
Definition PropertyBag.h:1131
UE_API EPropertyBagResult SetValueString(const int32 Index, const FString &InValue)
Definition PropertyBag.cpp:3753
UE_API EPropertyBagResult SetValueSoftPath(const int32 Index, const FSoftObjectPath &InValue)
Definition PropertyBag.cpp:3783
UE_API TValueOrError< double, EPropertyBagResult > GetValueDouble(const int32 Index) const
Definition PropertyBag.cpp:3564
UE_API TValueOrError< UClass *, EPropertyBagResult > GetValueClass(const int32 Index) const
Definition PropertyBag.cpp:3641
EPropertyBagResult SetValueObject(const int32 Index, T *InValue)
Definition PropertyBag.h:1138
UE_API EPropertyBagResult SetValueText(const int32 Index, const FText &InValue)
Definition PropertyBag.cpp:3758
UE_API TValueOrError< FSoftObjectPath, EPropertyBagResult > GetValueSoftPath(const int32 Index) const
Definition PropertyBag.cpp:3697
Definition PropertyBag.h:1163
UE_API EPropertyBagResult AddValueObject(UObject *InValue)
Definition PropertyBag.cpp:3887
UE_API EPropertyBagResult AddValueBool(const bool bInValue)
Definition PropertyBag.cpp:3797
UE_API EPropertyBagResult AddValueEnum(const int64 InValue, const UEnum *Enum)
Definition PropertyBag.cpp:3852
UE_API EPropertyBagResult AddValueName(const FName InValue)
Definition PropertyBag.cpp:3837
UE_API EPropertyBagResult AddValueText(const FText &InValue)
Definition PropertyBag.cpp:3847
UE_API EPropertyBagResult AddValueSoftPath(const FSoftObjectPath &InValue)
Definition PropertyBag.cpp:3939
UE_API EPropertyBagResult AddValueStruct(FConstStructView InValue)
Definition PropertyBag.cpp:3871
UE_API EPropertyBagResult AddValueByte(const uint8 InValue)
Definition PropertyBag.cpp:3802
EPropertyBagResult AddValueEnum(const T InValue)
Definition PropertyBag.h:1199
FPropertyBagSetRef(const FPropertyBagPropertyDesc &InDesc, const void *InSet)
Definition PropertyBag.h:1165
UE_API EPropertyBagResult AddValueInt32(const int32 InValue)
Definition PropertyBag.cpp:3807
UE_API EPropertyBagResult AddValueUInt32(const uint32 InValue)
Definition PropertyBag.cpp:3812
UE_API EPropertyBagResult AddValueInt64(const int64 InValue)
Definition PropertyBag.cpp:3817
UE_API EPropertyBagResult AddValueDouble(const double InValue)
Definition PropertyBag.cpp:3832
UE_API EPropertyBagResult AddValueClass(UClass *InValue)
Definition PropertyBag.cpp:3934
EPropertyBagResult AddValueStruct(const T &InValue)
Definition PropertyBag.h:1207
UE_FORCEINLINE_HINT int32 Num() const
Definition PropertyBag.h:1249
UE_API EPropertyBagResult AddValueString(const FString &InValue)
Definition PropertyBag.cpp:3842
EPropertyBagResult Remove(const T &Value)
Definition PropertyBag.h:1223
UE_API EPropertyBagResult AddValueFloat(const float InValue)
Definition PropertyBag.cpp:3827
EPropertyBagResult AddValueObject(T *InValue)
Definition PropertyBag.h:1214
UE_API EPropertyBagResult AddValueUInt64(const uint64 InValue)
Definition PropertyBag.cpp:3822
TValueOrError< bool, EPropertyBagResult > Contains(const T &Value) const
Definition PropertyBag.h:1238
Definition UnrealType.h:174
Definition UObjectGlobals.h:2492
Definition UnrealType.h:4175
uint8 * GetRawPtr(int32 Index=0)
Definition UnrealType.h:4236
UE_FORCEINLINE_HINT bool IsValidIndex(int32 Index) const
Definition UnrealType.h:4207
Definition UnrealType.h:5682
int32 FindElementIndex(const void *ElementToFind, int32 IndexHint=0) const
Definition UnrealType.h:6048
int32 Num() const
Definition UnrealType.h:5735
void RemoveAt(int32 InternalIndex, int32 Count=1)
Definition UnrealType.h:5932
Definition UnrealType.h:4028
Definition Text.h:385
Definition ArrayView.h:139
Definition Array.h:670
Definition StaticArray.h:26
Definition ValueOrError.h:58
Definition Class.h:3793
Definition Class.h:2791
Definition Object.h:95
Definition PropertyBag.h:1295
Definition PropertyBag.h:1309
TConstArrayView< FPropertyBagPropertyDesc > GetPropertyDescs() const
Definition PropertyBag.h:1324
Definition Class.h:1720
Definition UserDefinedStruct.h:61
Definition PropertyBag.cpp:36
COREUOBJECT_API const FGuid GUID
Definition OverriddenPropertySet.cpp:45
Definition PackageReader.cpp:44
void RemovePropertyByName(TArray< FPropertyBagPropertyDesc > &Descs, const FName PropertyName, const int32 StartIndex=0)
Definition PropertyBag.cpp:1491
EPropertyBagAlterationResult RenameProperty(TArray< FPropertyBagPropertyDesc > &Descs, const FName SourcePropertyName, const FName TargetPropertyName)
Definition PropertyBag.cpp:1504
EPropertyBagAlterationResult ReorderProperty(TArray< FPropertyBagPropertyDesc > &Descs, const int32 SourcePropertyIndex, const int32 TargetPropertyIndex, const bool bInsertBefore)
Definition PropertyBag.cpp:1554
Definition AdvancedWidgetsModule.cpp:13
U16 Index
Definition radfft.cpp:71
Definition StructView.h:217
static FConstStructView Make(const T &Struct)
Definition StructView.h:246
Definition Guid.h:109
Definition PropertyBag.h:418
FConstStructView GetValue() const
Definition PropertyBag.h:609
FStructView GetMutableValue()
Definition PropertyBag.h:612
TValueOrError< T *, EPropertyBagResult > GetValueObject(const FName Name) const
Definition PropertyBag.h:674
TValueOrError< T, EPropertyBagResult > GetValueEnum(const FPropertyBagPropertyDesc &Desc) const
Definition PropertyBag.h:717
void Reset()
Definition PropertyBag.h:435
EPropertyBagResult SetValueObject(const FName Name, T *InValue)
Definition PropertyBag.h:812
bool IsValid() const
Definition PropertyBag.h:429
EPropertyBagResult SetValueEnum(const FName Name, const T InValue)
Definition PropertyBag.h:797
EPropertyBagResult SetValueEnum(const FPropertyBagPropertyDesc &Desc, const T InValue)
Definition PropertyBag.h:844
TValueOrError< T *, EPropertyBagResult > GetValueObject(const FPropertyBagPropertyDesc &Desc) const
Definition PropertyBag.h:747
TValueOrError< T, EPropertyBagResult > GetValueEnum(const FName Name) const
Definition PropertyBag.h:644
EPropertyBagResult SetValueStruct(const FPropertyBagPropertyDesc &Desc, const T &InValue)
Definition PropertyBag.h:852
TValueOrError< T *, EPropertyBagResult > GetValueStruct(const FName Name) const
Definition PropertyBag.h:658
EPropertyBagResult SetValueObject(const FPropertyBagPropertyDesc &Desc, T *InValue)
Definition PropertyBag.h:859
EPropertyBagResult SetValueStruct(const FName Name, const T &InValue)
Definition PropertyBag.h:805
TValueOrError< T *, EPropertyBagResult > GetValueStruct(const FPropertyBagPropertyDesc &Desc) const
Definition PropertyBag.h:731
Definition InstancedStruct.h:32
Definition PropertyBag.h:61
bool Add(const EPropertyBagContainerType PropertyBagContainerType)
Definition PropertyBag.h:85
bool CanAdd() const
Definition PropertyBag.h:120
friend FArchive & operator<<(FArchive &Ar, FPropertyBagContainerTypes &ContainerTypesData)
Definition PropertyBag.h:139
EPropertyBagContainerType * begin()
Definition PropertyBag.h:157
EPropertyBagContainerType * end()
Definition PropertyBag.h:159
FPropertyBagContainerTypes(const std::initializer_list< EPropertyBagContainerType > &InTypes)
Definition PropertyBag.h:74
const EPropertyBagContainerType * end() const
Definition PropertyBag.h:160
EPropertyBagContainerType GetFirstContainerType() const
Definition PropertyBag.h:125
friend UE_FORCEINLINE_HINT uint32 GetTypeHash(const FPropertyBagContainerTypes &PropertyBagContainerTypes)
Definition PropertyBag.h:152
UE_API EPropertyBagContainerType PopHead()
Definition PropertyBag.cpp:1606
void Reset()
Definition PropertyBag.h:101
bool IsEmpty() const
Definition PropertyBag.h:110
uint32 Num() const
Definition PropertyBag.h:115
const EPropertyBagContainerType * begin() const
Definition PropertyBag.h:158
Definition PropertyBag.h:1289
Definition PropertyBag.h:196
friend UE_FORCEINLINE_HINT uint32 GetTypeHash(const FPropertyBagPropertyDescMetaData &PropertyDescMetaData)
Definition PropertyBag.h:225
friend uint32 GetTypeHash(const TArrayView< const FPropertyBagPropertyDescMetaData > &MetaData)
Definition PropertyBag.h:230
friend UE_FORCEINLINE_HINT uint32 GetTypeHash(const TArray< FPropertyBagPropertyDescMetaData > &MetaData)
Definition PropertyBag.h:240
friend FArchive & operator<<(FArchive &Ar, FPropertyBagPropertyDescMetaData &PropertyDescMetaData)
Definition PropertyBag.h:219
Definition PropertyBag.h:249
EPropertyBagPropertyType ValueType
Definition PropertyBag.h:340
FPropertyBagPropertyDesc()=default
TObjectPtr< const UObject > ValueTypeObject
Definition PropertyBag.h:328
FPropertyBagPropertyDesc(const FName InName, const EPropertyBagContainerType InContainerType, const EPropertyBagPropertyType InValueType, const UObject *InValueTypeObject=nullptr, EPropertyFlags InPropertyFlags=CPF_Edit)
Definition PropertyBag.h:262
FPropertyBagContainerTypes ContainerTypes
Definition PropertyBag.h:344
FPropertyBagPropertyDesc(const FName InName, const EPropertyBagPropertyType InValueType, const UObject *InValueTypeObject=nullptr)
Definition PropertyBag.h:256
const FProperty * CachedProperty
Definition PropertyBag.h:361
FPropertyBagPropertyDesc(const FName InName, const FPropertyBagContainerTypes &InNestedContainers, const EPropertyBagPropertyType InValueType, UObject *InValueTypeObject=nullptr, EPropertyFlags InPropertyFlags=CPF_Edit)
Definition PropertyBag.h:271
int32 GetCachedIndex() const
Definition PropertyBag.h:299
Definition SoftObjectPath.h:56
Definition StructView.h:24
Definition Class.h:5288
Definition UnrealTypeTraits.h:40
Definition IsEnum.h:7
Definition ObjectPtr.h:488
Definition Optional.h:131
Definition StructOpsTypeTraits.h:11
Definition StructOpsTypeTraits.h:46