12#include "PropertyBag.generated.h"
14#define UE_API COREUOBJECT_API
87 if (
ensure(NumContainers < MaxNestedTypes))
112 return NumContainers == 0;
117 return NumContainers;
122 return NumContainers < MaxNestedTypes;
149 return !(
Other == *
this);
163 static constexpr uint8 MaxNestedTypes = 2;
252 static_assert(std::is_same_v<std::underlying_type_t<EPropertyFlags>,
uint64>,
"FPropertyBagPropertyDesc::PropertyFlag does not match EPropertyFlags type");
287 UE_API bool IsUnsignedNumericType()
const;
290 UE_API bool IsNumericFloatType()
const;
293 UE_API bool IsObjectType()
const;
296 UE_API bool IsClassType()
const;
327 UPROPERTY(EditAnywhere, Category=
"Default")
350#if WITH_EDITORONLY_DATA
352 UPROPERTY(EditAnywhere, Category=
"Default")
643 template <
typename T>
649 if (!Result.IsValid())
653 return MakeValue(
static_cast<T
>(Result.GetValue()));
657 template <
typename T>
661 if (!Result.IsValid())
665 if (T* ValuePtr = Result.GetValue().GetPtr<T>())
673 template <
typename T>
679 if (!Result.IsValid())
683 if (Result.GetValue() ==
nullptr)
716 template <
typename T>
722 if (!Result.IsValid())
726 return MakeValue(
static_cast<T
>(Result.GetValue()));
730 template <
typename T>
734 if (!Result.IsValid())
738 if (T* ValuePtr = Result.GetValue().GetPtr<T>())
746 template <
typename T>
752 if (!Result.IsValid())
756 if (Result.GetValue() ==
nullptr)
796 template <
typename T>
804 template <
typename T>
811 template <
typename T>
843 template <
typename T>
851 template <
typename T>
858 template <
typename T>
905 UE_API static bool IsPropertyNameValid(
const FString&
Name);
944 WithIdentical =
true,
945 WithSerializer =
true,
946 WithAddStructReferencedObjects =
true,
947 WithGetPreloadDependencies =
true,
974 const void* GetAddress(
const int32 Index)
const
985 void* GetMutableAddress(
const int32 Index)
const
1001 check(ArrayProperty);
1002 check(ArrayProperty->Inner);
1034 template <
typename T>
1040 if (!Result.IsValid())
1044 return MakeValue(
static_cast<T
>(Result.GetValue()));
1048 template <
typename T>
1052 if (!Result.IsValid())
1056 if (T* ValuePtr = Result.GetValue().GetPtr<T>())
1064 template <
typename T>
1070 if (!Result.IsValid())
1074 if (Result.GetValue() ==
nullptr)
1122 template <
typename T>
1130 template <
typename T>
1137 template <
typename T>
1170 check(SetProperty->ElementProp);
1198 template <
typename T>
1206 template <
typename T>
1213 template <
typename T>
1222 template <
typename T>
1237 template <
typename T>
1258 template <
typename T>
1299namespace UE::Private {
struct FJsonStringifyImpl; }
1351 UE_API void DecrementRefCount()
const;
1352 UE_API void IncrementRefCount()
const;
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;
#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
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
@ PropertyNameInvalidCharacters
@ TargetPropertyAlreadyExists
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
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 ArrayView.h:139
Definition StaticArray.h:26
Definition ValueOrError.h:58
Definition PropertyBag.h:1295
Definition PropertyBag.h:1309
TConstArrayView< FPropertyBagPropertyDesc > GetPropertyDescs() const
Definition PropertyBag.h:1324
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 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: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 UnrealTypeTraits.h:40
Definition ObjectPtr.h:488
Definition Optional.h:131
Definition StructOpsTypeTraits.h:11
Definition StructOpsTypeTraits.h:46