UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UObjectGlobals.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 UObjectGlobals.h: Unreal object system globals.
5=============================================================================*/
6
7#pragma once
8
9#include "Concepts/SameAs.h"
10#include "Containers/Array.h"
14#include "Containers/Map.h"
15#include "Containers/Set.h"
20#include "CoreGlobals.h"
21#include "CoreTypes.h"
22#include "Delegates/Delegate.h"
24#include "Logging/LogMacros.h"
27#include "Misc/EnumClassFlags.h"
29#include "Misc/PackagePath.h"
32#include "Stats/Stats.h"
33#include "Templates/Function.h"
36#include "Templates/UniquePtr.h"
41#include "UObject/NameTypes.h"
45#include "UObject/Script.h"
48#include "UObject/UnrealNames.h"
49#include "VerseTypesFwd.h"
50
51class FArchive;
52class FCbWriter;
55class FOutputDevice;
56class FPackagePath;
57class FProperty;
58class ITargetPlatform;
59class UClass;
60class UEnum;
61class UFunction;
62class UObject;
63class UObjectBase;
64class UPackage;
65class UPackageMap;
66class UScriptStruct;
67class UWorld;
69struct FGuid;
72struct FObjectPtr;
73struct FPrimaryAssetId;
76struct FWorldContext;
77template <typename T>
78struct TObjectPtr;
79
81
93
96
97#define INVALID_OBJECT (UObject*)-1
98#define PERF_TRACK_DETAILED_ASYNC_STATS (0)
99
100#ifndef UE_GC_RUN_WEAKPTR_BARRIERS
101#define UE_GC_RUN_WEAKPTR_BARRIERS 0
102#endif
103
104#if UE_REFERENCE_COLLECTOR_REQUIRE_OBJECTPTR
105#define UE_REFERENCE_COLLECTOR_REQUIRE_OBJECTPTR_DEPRECATED() UE_DEPRECATED(5.3, "WARNING: Your program will randomly crash if this function is called when incremental gc is enabled. Pass TObjectPtr<...> instead of UObject* to AddReferencedObject(s) API's.")
106#else
107#define UE_REFERENCE_COLLECTOR_REQUIRE_OBJECTPTR_DEPRECATED(...)
108#endif
109
110// Private system wide variables.
111
117//UE_DEPRECATED(5.0, "Use the IsSavingPackage() function instead.")
123
126{
127 enum Type
128 {
134 PIE
135 };
136};
137
138/*-----------------------------------------------------------------------------
139 FObjectDuplicationParameters.
140-----------------------------------------------------------------------------*/
141
233
234// @note: should we start putting the code in the UE namespace?
235namespace UE
236{
244
245} // namespace UE
246
248{
249 class FRemoteObjectConstructionOverrides;
250} // namespace UE::RemoteObject::Serialization
251
254
258
261
268
278COREUOBJECT_API FString ResolveIniObjectsReference(const FString& ObjectReference, const FString* IniFilename = nullptr, bool bThrow = false);
279
292COREUOBJECT_API bool ResolveName(UObject*& Outer, FString& ObjectsReferenceString, bool Create, bool Throw, uint32 LoadFlags = LOAD_None, const FLinkerInstancingContext* InstancingContext = nullptr);
293
295COREUOBJECT_API bool SafeLoadError( UObject* Outer, uint32 LoadFlags, const TCHAR* ErrorMessage);
296
299
314template <UE::CSameAs<bool> ExactClassType>
315UE_EXACTCLASS_BOOL_DEPRECATED("StaticFindObjectFast")
320
336template <UE::CSameAs<bool> ExactClassType>
337UE_EXACTCLASS_BOOL_DEPRECATED("StaticFindObjectFastSafe")
342
354template <UE::CSameAs<bool> ExactClassType>
355UE_EXACTCLASS_BOOL_DEPRECATED("StaticFindObject")
360
371template <UE::CSameAs<bool> ExactClassType>
372UE_EXACTCLASS_BOOL_DEPRECATED("StaticFindObject")
377
380template <UE::CSameAs<bool> ExactClassType>
381UE_EXACTCLASS_BOOL_DEPRECATED("StaticFindObjectChecked")
386
389template <UE::CSameAs<bool> ExactClassType>
390UE_EXACTCLASS_BOOL_DEPRECATED("StaticFindObjectSafe")
395
407template <UE::CSameAs<bool> ExactClassType>
408UE_EXACTCLASS_BOOL_DEPRECATED("StaticFindObjectSafe")
413
428template <UE::CSameAs<bool> ExactClassType>
429UE_EXACTCLASS_BOOL_DEPRECATED("StaticFindAllObjectsFast")
434
450template <UE::CSameAs<bool> ExactClassType>
451UE_EXACTCLASS_BOOL_DEPRECATED("StaticFindAllObjectsFastSafe")
456
468template <UE::CSameAs<bool> ExactClassType>
469UE_EXACTCLASS_BOOL_DEPRECATED("StaticFindAllObjects")
474
487template <UE::CSameAs<bool> ExactClassType>
488UE_EXACTCLASS_BOOL_DEPRECATED("StaticFindAllObjectsSafe")
493
494
496{
497 None = 0, // Unused / defaults to Quiet
498 ExactClass = 1 << 1, // Whether to require an exact match with the passed in class
499 NativeFirst = 1 << 2, // If multiple results are found, prioritize native classes or native class instances
500 EnsureIfAmbiguous = 1 << 3 // Ensure if multiple results are found
501};
503
518
534
537{
539 Find,
542};
543
557COREUOBJECT_API bool ParseObject( const TCHAR* Stream, const TCHAR* Match, UClass* Class, UObject*& DestRes, UObject* InParent, EParseObjectLoadingPolicy LoadingPolicy, bool* bInvalidObject=nullptr );
558inline bool ParseObject( const TCHAR* Stream, const TCHAR* Match, UClass* Class, UObject*& DestRes, UObject* InParent, bool* bInvalidObject=nullptr )
559{
561}
562
578COREUOBJECT_API UObject* StaticLoadObject( UClass* Class, UObject* InOuter, FStringView Name, FStringView Filename = {}, uint32 LoadFlags = LOAD_None, UPackageMap* Sandbox = nullptr, bool bAllowObjectReconciliation = true, const FLinkerInstancingContext* InstancingContext = nullptr);
579
581COREUOBJECT_API UClass* StaticLoadClass(UClass* BaseClass, UObject* InOuter, FStringView Name, FStringView Filename = {}, uint32 LoadFlags = LOAD_None, UPackageMap* Sandbox = nullptr);
582
594
605
624
629
640
651
659COREUOBJECT_API void StaticTick( float DeltaTime, bool bUseFullTimeLimit = true, float AsyncLoadingTime = 0.005f );
660
673COREUOBJECT_API UPackage* LoadPackage( UPackage* InOuter, const TCHAR* InLongPackageName, uint32 LoadFlags, FArchive* InReaderOverride = nullptr, const FLinkerInstancingContext* InstancingContext = nullptr);
674
688COREUOBJECT_API UPackage* LoadPackage(UPackage* InOuter, const FPackagePath& InPackagePath, uint32 LoadFlags, FArchive* InReaderOverride = nullptr, const FLinkerInstancingContext* InstancingContext = nullptr, const FPackagePath* DiffPackagePath = nullptr);
689
709
712{
714 Failed,
716 Started,
718 Read,
723};
724
727
735
736
740{
741 /* Name of the package. */
742 const FName PackageName { NAME_None };
743 /* Pointer to UPackage being loaded, can be nullptr depending on async loading progress. */
744 const UPackage* LoadedPackage { nullptr };
745 /* Progress of async loading. */
747};
748
753{
754public:
756
761
762 constexpr static inline uint32 BuildMask(EAsyncLoadingProgress Progress)
763 {
764 return 1 << (uint32)Progress;
765 }
766
767 constexpr static inline uint32 BuildMask(auto... Types)
768 {
769 return (0 | ... | BuildMask(Types));
770 }
771
773 {
774 if (Mask & BuildMask(Params.ProgressType))
775 {
776 Delegate.ExecuteIfBound(Params);
777 }
778 }
779
780private:
782 const uint32 Mask { MAX_uint32 };
783};
784
807
818
835
844COREUOBJECT_API int32 LoadPackageAsync(const FString& InName, const FGuid* InGuid = nullptr);
845
858
868
869
877
878
882{
886 int32 PackagePriority { 0 };
888 const FLinkerInstancingContext* InstancingContext { nullptr };
890 uint32 LoadFlags { LOAD_None };
891};
892
903
904
909
914
922COREUOBJECT_API float GetAsyncLoadPercentage( const FName& PackageName );
923
930COREUOBJECT_API void CollectGarbage(EObjectFlags KeepFlags, bool bPerformFullPurge = true);
931
940COREUOBJECT_API bool TryCollectGarbage(EObjectFlags KeepFlags, bool bPerformFullPurge = true);
941
950COREUOBJECT_API bool UnhashUnreachableObjects(bool bUseTimeLimit, double TimeLimit = 0.0);
951
958
965
972
979
986
991
1001COREUOBJECT_API void IncrementalPurgeGarbage( bool bUseTimeLimit, double TimeLimit = 0.002 );
1002
1003
1005{
1006 None = 0,
1007 GloballyUnique = 1 << 1, // Whether to make the object name unique globally (across all objects that currently exist in the current session)
1008 UniversallyUnique = 1 << 2 // Whether to make the object name unique universally (across all objects that currently exist in all sessions)
1009};
1011
1012
1013#if WITH_EDITOR
1026#endif
1027
1041
1053
1065
1074
1088
1100
1108
1115
1120
1127
1134
1139{
1149}
1150
1160COREUOBJECT_API EAsyncPackageState::Type ProcessAsyncLoading( bool bUseTimeLimit, bool bUseFullTimeLimit, double TimeLimit);
1161
1170
1172COREUOBJECT_API void BeginLoad(FUObjectSerializeContext* LoadContext, const TCHAR* DebugContext = nullptr);
1174
1183
1184#if WITH_EDITOR
1190
1196#endif
1197
1203COREUOBJECT_API UPackage* CreatePackage(const TCHAR* PackageName);
1204
1207
1221
1232
1233
1247
1258
1276
1279{
1280 None = 0,
1281 CopyTransientsFromClassDefaults = 1 << 0, // copy transient from the class defaults instead of the pass in archetype ptr
1282 InitializeProperties = 1 << 1, // initialize property values with the archetype values
1283};
1285
1286class FGCObject;
1287
1292{
1293public:
1298
1307
1310
1311 UE_DEPRECATED(5.7, "FObjectInitializer constructor that takes remote object overrides is deprecated. Use FRemoteObjectConstructionOverridesScope instead.")
1314 {
1315 }
1316
1317private:
1319 COREUOBJECT_API void Construct_Internal();
1320
1321public:
1323
1328 {
1329 return ObjectArchetype;
1330 }
1331
1336 {
1337 return Obj;
1338 }
1339
1341 {
1342 return InstanceGraph;
1343 }
1344
1346 {
1347 PropertyPostInitCallbacks.Add(MoveTemp(Callback));
1348 }
1349
1354
1362 template<class TReturnType>
1364 {
1365 UClass* ReturnType = TReturnType::StaticClass();
1366 return static_cast<TReturnType*>(CreateDefaultSubobject(Outer, SubobjectName, ReturnType, ReturnType, /*bIsRequired =*/ true, bTransient));
1367 }
1368
1377 template<class TReturnType>
1379 {
1380 UClass* ReturnType = TReturnType::StaticClass();
1381 return static_cast<TReturnType*>(CreateDefaultSubobject(Outer, SubobjectName, ReturnType, ReturnType, /*bIsRequired =*/ false, bTransient));
1382 }
1383
1392 template<class TReturnType, class TClassToConstructByDefault>
1394 {
1395 return static_cast<TReturnType*>(CreateDefaultSubobject(Outer, SubobjectName, TReturnType::StaticClass(), TClassToConstructByDefault::StaticClass(), /*bIsRequired =*/ true, bTransient));
1396 }
1397
1405 template<class TReturnType>
1407 {
1408 const UClass* ReturnType = TReturnType::StaticClass();
1409 return static_cast<TReturnType*>(CreateEditorOnlyDefaultSubobject(Outer, SubobjectName, ReturnType, bTransient));
1410 }
1411
1419 COREUOBJECT_API UObject* CreateEditorOnlyDefaultSubobject(UObject* Outer, FName SubobjectName, const UClass* ReturnType, bool bTransient = false) const;
1420
1430 COREUOBJECT_API UObject* CreateDefaultSubobject(UObject* Outer, FName SubobjectFName, const UClass* ReturnType, const UClass* ClassToCreateByDefault, bool bIsRequired = true, bool bIsTransient = false) const;
1431
1438 {
1439 AssertIfSubobjectSetupIsNotAllowed(SubobjectName);
1440 SubobjectOverrides.Add(SubobjectName, Class);
1441 return *this;
1442 }
1443
1448 template<class T>
1453
1459 {
1460 AssertIfSubobjectSetupIsNotAllowed(SubobjectName);
1461 SubobjectOverrides.Add(SubobjectName, nullptr);
1462 return *this;
1463 }
1464
1471 {
1472 AssertIfSubobjectSetupIsNotAllowed(SubobjectName);
1473 SubobjectOverrides.Add(SubobjectName, Class);
1474 return *this;
1475 }
1476
1483 {
1484 AssertIfSubobjectSetupIsNotAllowed(SubobjectNames);
1485 SubobjectOverrides.Add(SubobjectNames, Class);
1486 return *this;
1487 }
1488
1493 template<class T>
1498
1503 template<class T>
1508
1514 {
1515 AssertIfSubobjectSetupIsNotAllowed(SubobjectName);
1516 SubobjectOverrides.Add(SubobjectName, nullptr);
1517 return *this;
1518 }
1519
1525 {
1526 AssertIfSubobjectSetupIsNotAllowed(SubobjectNames);
1527 SubobjectOverrides.Add(SubobjectNames, nullptr);
1528 return *this;
1529 }
1530
1534 static COREUOBJECT_API void AssertIfInConstructor(UObject* Outer, const TCHAR* ErrorMessage);
1535
1537 {
1538 bSubobjectClassInitializationAllowed = false;
1539 }
1540
1543
1544private:
1545
1546 friend class UObject;
1548
1549 template<class T>
1550 friend void InternalConstructor(const class FObjectInitializer& X);
1551
1560 static COREUOBJECT_API void InitProperties(UObject* Obj, UClass* DefaultsClass, UObject* DefaultData, bool bCopyTransientsFromClassDefaults);
1561
1562 COREUOBJECT_API bool IsInstancingAllowed() const;
1563
1569 COREUOBJECT_API bool InitSubobjectProperties(bool bAllowInstancing) const;
1570
1577 COREUOBJECT_API void InstanceSubobjects(UClass* Class, bool bNeedInstancing, bool bNeedSubobjectInstancing) const;
1578
1586 static COREUOBJECT_API bool InitNonNativeProperty(FProperty* Property, UObject* Data);
1587
1592 COREUOBJECT_API void PostConstructInit();
1593
1594private:
1595
1597 struct FOverrides
1598 {
1601
1604
1607
1609 {
1610 const UClass* Class = nullptr;
1611 FOverrides* SubOverrides = nullptr;
1612 };
1613
1615 FOverrideDetails Get(FName InComponentName, const UClass* ReturnType, const UClass* ClassToConstructByDefault, bool bOptional) const;
1616
1617 private:
1618 static bool IsLegalOverride(const UClass* DerivedComponentClass, const UClass* BaseComponentClass);
1619
1622 {
1623 for (int32 Index = 0 ; Index < Overrides.Num(); Index++)
1624 {
1625 if (Overrides[Index].ComponentName == InComponentName)
1626 {
1627 return Index;
1628 }
1629 }
1630 return INDEX_NONE;
1631 }
1633 struct FOverride
1634 {
1635 FName ComponentName;
1636 const UClass* ComponentClass = nullptr;
1637 TUniquePtr<FOverrides> SubOverrides;
1638 bool bDoNotCreate = false;
1639 FOverride(FName InComponentName)
1640 : ComponentName(InComponentName)
1641 {
1642 }
1643
1644 FOverride& operator=(const FOverride& Other)
1645 {
1646 ComponentName = Other.ComponentName;
1647 ComponentClass = Other.ComponentClass;
1648 SubOverrides = (Other.SubOverrides ? MakeUnique<FOverrides>(*Other.SubOverrides) : nullptr);
1649 bDoNotCreate = Other.bDoNotCreate;
1650 return *this;
1651 }
1652
1653 FOverride(const FOverride& Other)
1654 {
1655 *this = Other;
1656 }
1657
1658 FOverride(FOverride&&) = default;
1659 FOverride& operator=(FOverride&&) = default;
1660 };
1663 };
1665 struct FSubobjectsToInit
1666 {
1668 void Add(UObject* Subobject, UObject* Template)
1669 {
1670 for (int32 Index = 0; Index < SubobjectInits.Num(); Index++)
1671 {
1672 check(SubobjectInits[Index].Subobject != Subobject);
1673 }
1674 SubobjectInits.Emplace(Subobject, Template);
1675 }
1689 };
1690
1692 COREUOBJECT_API void AssertIfSubobjectSetupIsNotAllowed(const FName SubobjectName) const;
1693
1695 COREUOBJECT_API void AssertIfSubobjectSetupIsNotAllowed(FStringView SubobjectName) const;
1696
1698 COREUOBJECT_API void AssertIfSubobjectSetupIsNotAllowed(TArrayView<const FName> SubobjectNames) const;
1699
1701 UObject* Obj;
1703 UObject* ObjectArchetype;
1705 bool bCopyTransientsFromClassDefaults;
1707 bool bShouldInitializePropsFromArchetype;
1709 bool bSubobjectClassInitializationAllowed = true;
1710#if USE_CIRCULAR_DEPENDENCY_LOAD_DEFERRING
1712 bool bIsDeferredInitializer = false;
1713#endif // USE_CIRCULAR_DEPENDENCY_LOAD_DEFERRING
1715 struct FObjectInstancingGraph* InstanceGraph;
1717 mutable FOverrides SubobjectOverrides;
1719 mutable FSubobjectsToInit ComponentInits;
1720#if !UE_BUILD_SHIPPING
1722 mutable TArray<FName, TInlineAllocator<8>> ConstructedSubobjects;
1723#endif
1725 UObject* LastConstructedObject = nullptr;
1726
1728 TFunction<void()> PropertyInitCallback;
1729 TArray<TFunction<void()>> PropertyPostInitCallbacks;
1730
1732
1733#if WITH_EDITORONLY_DATA
1736
1741#endif // WITH_EDITORONLY_DATA
1742
1743#if UE_WITH_REMOTE_OBJECT_HANDLE
1744public:
1745 UE_DEPRECATED(5.7, "Use FRemoteObjectConstructionOverridesScope instead.")
1746 UE::RemoteObject::Serialization::FRemoteObjectConstructionOverrides* GetRemoteSubObjectOverrides() const
1747 {
1748 return nullptr;
1749 }
1750#endif // UE_WITH_REMOTE_OBJECT_HANDLE
1751};
1752
1758{
1761
1764
1767
1770
1773
1776
1779
1784 UObject* Template = nullptr;
1785
1788
1791
1794
1797
1798#if UE_WITH_REMOTE_OBJECT_HANDLE
1800 FRemoteObjectId RemoteId;
1801
1802 UE_DEPRECATED(5.7, "Use FRemoteObjectConstructionOverridesScope instead.")
1803 UE::RemoteObject::Serialization::FRemoteObjectConstructionOverrides* RemoteSubObjectOverrides = nullptr;
1804#endif // UE_WITH_REMOTE_OBJECT_HANDLE
1805
1806private:
1807 FObjectInitializer::FOverrides* SubobjectOverrides = nullptr;
1808
1809public:
1810
1812
1814};
1815
1820{
1821public:
1831 {
1832 FObjectInitializer::InitProperties(Obj, DefaultsClass, DefaultData, ObjectInitializer.bCopyTransientsFromClassDefaults);
1833 }
1834
1841 {
1842 return ObjectInitializer.InitSubobjectProperties(ObjectInitializer.IsInstancingAllowed());
1843 }
1844
1856
1864 {
1865 ObjectInitializer.PostConstructInit();
1866 }
1867};
1868
1869#if DO_CHECK
1872#endif
1873
1889template< class T >
1891 T* NewObject(UObject* Outer, const UClass* Class, FName Name = NAME_None, EObjectFlags Flags = RF_NoFlags, UObject* Template = nullptr, bool bCopyTransientsFromClassDefaults = false, FObjectInstancingGraph* InInstanceGraph = nullptr, UPackage* InExternalPackage = nullptr)
1893{
1894 if (Name == NAME_None)
1895 {
1896 FObjectInitializer::AssertIfInConstructor(Outer, TEXT("NewObject with empty name can't be used to create default subobjects (inside of UObject derived class constructor) as it produces inconsistent object names. Use ObjectInitializer.CreateDefaultSubobject<> instead."));
1897 }
1898
1899#if DO_CHECK
1900 // Class was specified explicitly, so needs to be validated
1901 CheckIsClassChildOf_Internal(T::StaticClass(), Class);
1902#endif
1903
1905 Params.Outer = Outer;
1906 Params.Name = Name;
1907 Params.SetFlags = Flags;
1908 Params.Template = Template;
1909 Params.bCopyTransientsFromClassDefaults = bCopyTransientsFromClassDefaults;
1910 Params.InstanceGraph = InInstanceGraph;
1911 Params.ExternalPackage = InExternalPackage;
1912
1913 T* Result = static_cast<T*>(StaticConstructObject_Internal(Params));
1914 return Result;
1915}
1916
1917template< class T >
1921{
1922 // Name is always None for this case
1923 FObjectInitializer::AssertIfInConstructor(Outer, TEXT("NewObject with empty name can't be used to create default subobjects (inside of UObject derived class constructor) as it produces inconsistent object names. Use ObjectInitializer.CreateDefaultSubobject<> instead."));
1924
1925 FStaticConstructObjectParameters Params(T::StaticClass());
1926 Params.Outer = Outer;
1927
1928 T* Result = static_cast<T*>(StaticConstructObject_Internal(Params));
1929 return Result;
1930}
1931
1932template< class T >
1934 T* NewObject(UObject* Outer, FName Name, EObjectFlags Flags = RF_NoFlags, UObject* Template = nullptr, bool bCopyTransientsFromClassDefaults = false, FObjectInstancingGraph* InInstanceGraph = nullptr, UPackage* InExternalPackage = nullptr)
1936{
1937 if (Name == NAME_None)
1938 {
1939 FObjectInitializer::AssertIfInConstructor(Outer, TEXT("NewObject with empty name can't be used to create default subobjects (inside of UObject derived class constructor) as it produces inconsistent object names. Use ObjectInitializer.CreateDefaultSubobject<> instead."));
1940 }
1941
1942 FStaticConstructObjectParameters Params(T::StaticClass());
1943 Params.Outer = Outer;
1944 Params.Name = Name;
1945 Params.SetFlags = Flags;
1946 Params.Template = Template;
1947 Params.bCopyTransientsFromClassDefaults = bCopyTransientsFromClassDefaults;
1948 Params.InstanceGraph = InInstanceGraph;
1949 Params.ExternalPackage = InExternalPackage;
1950
1951 T* Result = static_cast<T*>(StaticConstructObject_Internal(Params));
1952 return Result;
1953}
1954
1966
1976template< class T >
1977T* DuplicateObject(T const* SourceObject,UObject* Outer, const FName Name = NAME_None)
1978{
1979 return static_cast<T*>(DuplicateObject_Internal(T::StaticClass(), SourceObject, Outer, Name));
1980}
1981
1982template <typename T>
1984{
1985 return static_cast<T*>(DuplicateObject_Internal(T::StaticClass(), SourceObject, Outer, Name));
1986}
1987
1991COREUOBJECT_API bool UsesPerObjectConfig( UObject* SourceObject );
1992
1996COREUOBJECT_API FString GetConfigFilename( UObject* SourceObject );
1997
1998/*----------------------------------------------------------------------------
1999 Core templates.
2000----------------------------------------------------------------------------*/
2001
2003template< class T >
2004inline bool ParseObject( const TCHAR* Stream, const TCHAR* Match, T*& Obj, UObject* Outer, EParseObjectLoadingPolicy LoadingPolicy, bool* bInvalidObject=nullptr )
2005{
2006 return ParseObject( Stream, Match, T::StaticClass(), (UObject*&)Obj, Outer, LoadingPolicy, bInvalidObject );
2007}
2008template< class T >
2009inline bool ParseObject( const TCHAR* Stream, const TCHAR* Match, T*& Obj, UObject* Outer, bool* bInvalidObject=nullptr )
2010{
2011 return ParseObject( Stream, Match, T::StaticClass(), (UObject*&)Obj, Outer, EParseObjectLoadingPolicy::Find, bInvalidObject );
2012}
2013
2018template< class T >
2023template <typename T, UE::CSameAs<bool> ExactClassType>
2024UE_EXACTCLASS_BOOL_DEPRECATED("FindObjectFast")
2029
2034template< class T >
2036{
2037 return (T*)StaticFindObject( T::StaticClass(), Outer, Name, Flags );
2038}
2039template <typename T, UE::CSameAs<bool> ExactClassType>
2045
2050template< class T >
2055template <typename T, UE::CSameAs<bool> ExactClassType>
2061
2066template< class T >
2071template <typename T, UE::CSameAs<bool> ExactClassType>
2072UE_EXACTCLASS_BOOL_DEPRECATED("FindObjectChecked")
2077
2082template< class T >
2084{
2085 return (T*)StaticFindObjectSafe( T::StaticClass(), Outer, Name, Flags );
2086}
2087template <typename T, UE::CSameAs<bool> ExactClassType>
2088UE_EXACTCLASS_BOOL_DEPRECATED("FindObjectSafe")
2093
2098template< class T >
2103template <typename T, UE::CSameAs<bool> ExactClassType>
2104UE_EXACTCLASS_BOOL_DEPRECATED("FindObjectSafe")
2109
2114template< class T >
2116{
2117 return (T*)StaticFindFirstObject(T::StaticClass(), Name, Options, AmbiguousMessageVerbosity, CurrentOperation);
2118}
2119
2124template< class T >
2126{
2127 return (T*)StaticFindFirstObjectSafe(T::StaticClass(), Name, Options, AmbiguousMessageVerbosity, CurrentOperation);
2128}
2129
2134template< class T >
2135inline T* LoadObject( UObject* Outer, FStringView Name, FStringView Filename={}, uint32 LoadFlags=LOAD_None, UPackageMap* Sandbox=nullptr, const FLinkerInstancingContext* InstancingContext=nullptr )
2136{
2137 return (T*)StaticLoadObject( T::StaticClass(), Outer, Name, Filename, LoadFlags, Sandbox, true, InstancingContext );
2138}
2139
2144template< class T >
2145inline UClass* LoadClass( UObject* Outer, FStringView Name, FStringView Filename={}, uint32 LoadFlags=LOAD_None, UPackageMap* Sandbox=nullptr )
2146{
2147 return StaticLoadClass( T::StaticClass(), Outer, Name, Filename, LoadFlags, Sandbox );
2148}
2149
2154template< class T >
2155inline const T* GetDefault()
2156{
2157 return (const T*)T::StaticClass()->GetDefaultObject();
2158}
2159
2164template< class T >
2165inline const T* GetDefault(const UClass* Class);
2166
2168template< class T >
2170{
2171 return (T*)T::StaticClass()->GetDefaultObject();
2172}
2173
2175template< class T >
2176inline T* GetMutableDefault(UClass *Class);
2177
2179template< class T >
2180inline bool IsClassLoaded()
2181{
2182 return T::StaticClass()->GetDefaultObject(false) != nullptr;
2183}
2184
2189
2198template <class T>
2200{
2201 bool bResult = false;
2202 for ( int32 ArrayIndex = 0; ArrayIndex < ObjectArray.Num(); ArrayIndex++ )
2203 {
2204 if ( ObjectArray[ArrayIndex] != nullptr )
2205 {
2207 ? ObjectArray[ArrayIndex]->GetClass() == ClassToCheck
2208 : ObjectArray[ArrayIndex]->IsA(ClassToCheck);
2209
2211 {
2212 bResult = true;
2213 if ( out_Objects != nullptr )
2214 {
2215 out_Objects->Add(ObjectArray[ArrayIndex]);
2216 }
2217 else
2218 {
2219 // if we don't need a list of objects that match the search criteria, we can stop as soon as we find at least one object of that class
2220 break;
2221 }
2222 }
2223 }
2224 }
2225
2226 return bResult;
2227}
2228template <typename T, UE::CSameAs<bool> ExactClassType>
2229UE_EXACTCLASS_BOOL_DEPRECATED("ContainsObjectOfClass")
2234
2239{
2240 struct FStoredObjectFlags
2241 {
2242 FStoredObjectFlags()
2243 : Flags(RF_NoFlags)
2244 , InternalFlags(EInternalObjectFlags::None)
2245 {}
2247 : Flags(InFlags)
2248 , InternalFlags(InInternalFlags)
2249 {}
2250 EObjectFlags Flags;
2251 EInternalObjectFlags InternalFlags;
2252 };
2253
2258 TMap<UObject*, FStoredObjectFlags> StoredObjectFlags;
2259
2263 void SaveObjectFlags();
2264
2268 void RestoreObjectFlags();
2269
2270public:
2273 {
2274 SaveObjectFlags();
2275 }
2276
2279 {
2280 RestoreObjectFlags();
2281 }
2282};
2283
2284
2289template<class TObjectClass>
2291{
2292 /* sample code
2293 TArray<APawn *> TestPawns;
2294 ...
2295 // test iterator, all items
2296 for ( TObjectArrayIterator<APawn> It(TestPawns); It; ++It )
2297 {
2298 UE_LOG(LogUObjectGlobals, Log, TEXT("Item %s"),*It->GetFullName());
2299 }
2300 */
2301public:
2309 Array(InArray),
2310 Index(-1),
2311 ClassToCheck(InClassToCheck),
2312 Flags(InFlags)
2313 {
2314 Advance();
2315 }
2316 template <UE::CSameAs<bool> ExactClassType>
2317 UE_EXACTCLASS_BOOL_DEPRECATED("TObjectArrayIterator")
2326 {
2327 Advance();
2328 }
2330 UE_FORCEINLINE_HINT explicit operator bool() const
2331 {
2332 return Index < Array.Num();
2333 }
2336 {
2337 return !(bool)*this;
2338 }
2339
2344 inline TObjectClass& operator*() const
2345 {
2347 return *GetObject();
2348 }
2353 inline TObjectClass* operator->() const
2354 {
2356 return GetObject();
2357 }
2358
2364 {
2365 Array.RemoveAt(Index--);
2366 }
2372 {
2373 Array.RemoveSwap(Index--);
2374 }
2375
2376protected:
2382 {
2383 return Array(Index);
2384 }
2389 inline bool Advance()
2390 {
2391 while(++Index < Array.Num())
2392 {
2393 TObjectClass* At = GetObject();
2394 if (
2395 IsValid(At) &&
2396 (!ClassToCheck ||
2397 (!!(Flags & EFindObjectFlags::ExactClass)
2398 ? At->GetClass() == ClassToCheck
2399 : At->IsA(ClassToCheck)))
2400 )
2401 {
2402 return true;
2403 }
2404 }
2405 return false;
2406 }
2407private:
2409 TArray<TObjectClass*>& Array;
2411 int32 Index;
2413 UClass* ClassToCheck;
2415 EFindObjectFlags Flags;
2416};
2417
2420{
2422 const UObject* SerializingObject = nullptr;
2424 const UObject* SerializedDataContainer = nullptr;
2426 class FReferenceCollector& Collector;
2427
2428protected:
2430 {
2431 return Collector;
2432 }
2433
2434public:
2435 // Constructor not COREUOBJECT-exported because constructing this class is for internal use only
2437
2439 {
2440 SerializingObject = InSerializingObject;
2441 }
2443 {
2444 return SerializingObject;
2445 }
2447 {
2448 SerializedDataContainer = InDataContainer;
2449 }
2451 {
2452 return SerializedDataContainer;
2453 }
2454
2455 COREUOBJECT_API virtual FArchive& operator<<(UObject*& Object) override;
2457};
2458
2461{
2463 const UObject* OldSerializingObject;
2464 FProperty* OldSerializedProperty;
2465 const UObject* OldSerializedDataContainer;
2466
2467public:
2469 : Archive(InArchive)
2470 , OldSerializingObject(InArchive.GetSerializingObject())
2471 , OldSerializedProperty(InArchive.GetSerializedProperty())
2472 , OldSerializedDataContainer(InArchive.GetSerializedDataContainer())
2473 {
2477 }
2479 {
2480 Archive.SetSerializingObject(OldSerializingObject);
2481 Archive.SetSerializedProperty(OldSerializedProperty);
2482 Archive.SetSerializedDataContainer(OldSerializedDataContainer);
2483 }
2485 {
2486 return Archive;
2487 }
2488};
2489
2492{
2493public:
2495
2498
2501
2503 COREUOBJECT_API virtual void AddStableReferenceSet(TSet<TObjectPtr<UObject>>* Objects);
2504
2505 template <typename KeyType, typename ValueType, typename Allocator, typename KeyFuncs>
2507 {
2508#if UE_REFERENCE_COLLECTOR_REQUIRE_OBJECTPTR
2509 static constexpr bool bKeyReference = TIsTObjectPtr<KeyType>::Value;
2510 static constexpr bool bValueReference = TIsTObjectPtr<ValueType>::Value;
2511 static_assert(bKeyReference || bValueReference);
2512 static_assert(!(std::is_pointer_v<KeyType> && std::is_convertible_v<KeyType, const UObjectBase*>));
2513 static_assert(!(std::is_pointer_v<ValueType> && std::is_convertible_v<ValueType, const UObjectBase*>));
2514#else
2515 static constexpr bool bKeyReference = std::is_convertible_v<KeyType, const UObjectBase*>;
2516 static constexpr bool bValueReference = std::is_convertible_v<ValueType, const UObjectBase*>;
2517 static_assert(bKeyReference || bValueReference, "Key or value must be pointer to fully-defined UObject type");
2518#endif
2519
2520 for (TPair<KeyType, ValueType>& Pair : Map)
2521 {
2522 if constexpr (bKeyReference)
2523 {
2524 AddStableReference(&Pair.Key);
2525 }
2526 if constexpr (bValueReference)
2527 {
2528 AddStableReference(&Pair.Value);
2529 }
2530 }
2531 }
2532
2536
2540
2544
2545 template<class UObjectType>
2548 {
2549 static_assert(sizeof(UObjectType) > 0, "Element must be a pointer to a fully-defined type");
2550 static_assert(std::is_convertible_v<UObjectType*, const UObjectBase*>, "Element must be a pointer to a type derived from UObject");
2551 AddStableReference(reinterpret_cast<UObject**>(Object));
2552 }
2553
2554 template<class UObjectType>
2556 inline void AddStableReferenceArray(TArray<UObjectType*>* Objects)
2557 {
2558 static_assert(sizeof(UObjectType) > 0, "Element must be a pointer to a fully-defined type");
2559 static_assert(std::is_convertible_v<UObjectType*, const UObjectBase*>, "Element must be a pointer to a type derived from UObject");
2560 AddStableReferenceArray(reinterpret_cast<TArray<UObject*>*>(Objects));
2561 }
2562
2563 template<class UObjectType>
2565 inline void AddStableReferenceSet(TSet<UObjectType*>* Objects)
2566 {
2567 static_assert(sizeof(UObjectType) > 0, "Element must be a pointer to a fully-defined type");
2568 static_assert(std::is_convertible_v<UObjectType*, const UObjectBase*>, "Element must be a pointer to a type derived from UObject");
2569 AddStableReferenceSet(reinterpret_cast<TSet<UObject*>*>(Objects));
2570 }
2571
2572 template<class UObjectType>
2574 {
2575 AddStableReferenceFwd(reinterpret_cast<FObjectPtr*>(Object));
2576 }
2577
2578 template<class UObjectType>
2580 {
2581 AddStableReferenceArrayFwd(reinterpret_cast<TArray<FObjectPtr>*>(Objects));
2582 }
2583
2584 template<class UObjectType>
2586 {
2587 AddStableReferenceSetFwd(reinterpret_cast<TSet<FObjectPtr>*>(Objects));
2588 }
2589
2597 template<class UObjectType>
2599 void AddReferencedObject(UObjectType*& Object, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2600 {
2601 AROPrivate::AddReferencedObject<UObjectType>(*this, Object, ReferencingObject, ReferencingProperty);
2602 }
2603
2611 template<class UObjectType>
2613 void AddReferencedObject(const UObjectType*& Object, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2614 {
2615 AROPrivate::AddReferencedObject<UObjectType>(*this, Object, ReferencingObject, ReferencingProperty);
2616 }
2617
2625 template<class UObjectType>
2627 void AddReferencedObjects(TArray<UObjectType*>& ObjectArray, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2628 {
2629 AROPrivate::AddReferencedObjects<UObjectType>(*this, ObjectArray, ReferencingObject, ReferencingProperty);
2630 }
2631
2639 template<class UObjectType>
2641 void AddReferencedObjects(TArray<const UObjectType*>& ObjectArray, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2642 {
2643 AROPrivate::AddReferencedObjects<UObjectType>(*this, ObjectArray, ReferencingObject, ReferencingProperty);
2644 }
2645
2653 template<class UObjectType>
2655 void AddReferencedObjects(TSet<UObjectType*>& ObjectSet, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2656 {
2657 AROPrivate::AddReferencedObjects<UObjectType>(*this, ObjectSet, ReferencingObject, ReferencingProperty);
2658 }
2659
2667 template <typename KeyType, typename ValueType, typename Allocator, typename KeyFuncs>
2669 void AddReferencedObjects(TMapBase<KeyType*, ValueType, Allocator, KeyFuncs>& Map, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2670 {
2671 AROPrivate::AddReferencedObjects<KeyType, ValueType, Allocator, KeyFuncs>(*this, Map, ReferencingObject, ReferencingProperty);
2672 }
2673
2674 template <typename KeyType, typename ValueType, typename Allocator, typename KeyFuncs>
2676 void AddReferencedObjects(TMapBase<KeyType, ValueType*, Allocator, KeyFuncs>& Map, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2677 {
2678 AROPrivate::AddReferencedObjects<KeyType, ValueType, Allocator, KeyFuncs>(*this, Map, ReferencingObject, ReferencingProperty);
2679 }
2680
2681 template <typename KeyType, typename ValueType, typename Allocator, typename KeyFuncs>
2683 void AddReferencedObjects(TMapBase<KeyType*, ValueType*, Allocator, KeyFuncs>& Map, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2684 {
2685 AROPrivate::AddReferencedObjects<KeyType, ValueType, Allocator, KeyFuncs>(*this, Map, ReferencingObject, ReferencingProperty);
2686 }
2687
2695 template<class UObjectType>
2696 void AddReferencedObject(TObjectPtr<UObjectType>& Object, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2697 {
2698 if (IsObjectHandleResolved_ForGC(Object.GetHandle()))
2699 {
2700 HandleObjectReference(*reinterpret_cast<UObject**>(&Object), ReferencingObject, ReferencingProperty);
2701 }
2702 }
2703
2711 template<class UObjectType>
2712 void AddReferencedObject(TObjectPtr<const UObjectType>& Object, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2713 {
2714 static_assert(sizeof(UObjectType) > 0, "AddReferencedObject: Element must be a pointer to a fully-defined type");
2715 static_assert(TPointerIsConvertibleFromTo<UObjectType, const UObjectBase>::Value, "AddReferencedObject: Element must be a pointer to a type derived from UObject");
2716 if (IsObjectHandleResolved_ForGC(Object.GetHandle()))
2717 {
2718 HandleObjectReference(*reinterpret_cast<UObject**>(&Object), ReferencingObject, ReferencingProperty);
2719 }
2720 }
2721
2722#if WITH_VERSE_VM || defined(__INTELLISENSE__)
2730 template<class VCellType>
2731 void AddReferencedVerseValue(Verse::TWriteBarrier<VCellType>& Value, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr);
2732
2740 void AddReferencedVerseValue(Verse::VRestValue& Value, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr);
2741#endif
2742
2750 template<class UObjectType>
2751 void AddReferencedObjects(TArray<TObjectPtr<UObjectType>>& ObjectArray, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2752 {
2753 static_assert(sizeof(UObjectType) > 0, "AddReferencedObjects: Elements must be pointers to a fully-defined type");
2754 static_assert(TPointerIsConvertibleFromTo<UObjectType, const UObjectBase>::Value, "AddReferencedObjects: Elements must be pointers to a type derived from UObject");
2755 // Cannot use a reinterpret_cast due to MSVC (and not Clang) emitting a warning:
2756 // C4946: reinterpret_cast used between related classes: ...
2757 HandleObjectReferences((FObjectPtr*)(ObjectArray.GetData()), ObjectArray.Num(), ReferencingObject, ReferencingProperty);
2758 }
2759
2767 template<class UObjectType>
2768 void AddReferencedObjects(TArray<TObjectPtr<const UObjectType>>& ObjectArray, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2769 {
2770 static_assert(sizeof(UObjectType) > 0, "AddReferencedObjects: Elements must be pointers to a fully-defined type");
2771 static_assert(TPointerIsConvertibleFromTo<UObjectType, const UObjectBase>::Value, "AddReferencedObjects: Elements must be pointers to a type derived from UObject");
2772 // Cannot use a reinterpret_cast due to MSVC (and not Clang) emitting a warning:
2773 // C4946: reinterpret_cast used between related classes: ...
2774 HandleObjectReferences((FObjectPtr*)(ObjectArray.GetData()), ObjectArray.Num(), ReferencingObject, ReferencingProperty);
2775 }
2776
2784 template<class UObjectType>
2785 void AddReferencedObjects(TSet<TObjectPtr<UObjectType>>& ObjectSet, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2786 {
2787 static_assert(sizeof(UObjectType) > 0, "AddReferencedObjects: Elements must be pointers to a fully-defined type");
2788 static_assert(TPointerIsConvertibleFromTo<UObjectType, const UObjectBase>::Value, "AddReferencedObjects: Elements must be pointers to a type derived from UObject");
2789 for (auto& Object : ObjectSet)
2790 {
2791 if (IsObjectHandleResolved_ForGC(Object.GetHandle()))
2792 {
2793 HandleObjectReference(*reinterpret_cast<UObject**>(&Object), ReferencingObject, ReferencingProperty);
2794 }
2795 }
2796 }
2797
2805 template <typename KeyType, typename ValueType, typename Allocator, typename KeyFuncs>
2806 void AddReferencedObjects(TMapBase<TObjectPtr<KeyType>, ValueType, Allocator, KeyFuncs>& Map, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2807 {
2808 static_assert(sizeof(KeyType) > 0, "AddReferencedObjects: Keys must be pointers to a fully-defined type");
2809 static_assert(TPointerIsConvertibleFromTo<KeyType, const UObjectBase>::Value, "AddReferencedObjects: Keys must be pointers to a type derived from UObject");
2811 !(std::is_pointer_v<ValueType> && std::is_convertible_v<ValueType, const UObjectBase*>));
2812 for (auto& It : Map)
2813 {
2814 if (IsObjectHandleResolved_ForGC(It.Key.GetHandle()))
2815 {
2816 HandleObjectReference(*reinterpret_cast<UObject**>(&It.Key), ReferencingObject, ReferencingProperty);
2817 }
2818 }
2819 }
2820 template <typename KeyType, typename ValueType, typename Allocator, typename KeyFuncs>
2821 void AddReferencedObjects(TMapBase<KeyType, TObjectPtr<ValueType>, Allocator, KeyFuncs>& Map, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2822 {
2823 static_assert(sizeof(ValueType) > 0, "AddReferencedObjects: Values must be pointers to a fully-defined type");
2824 static_assert(TPointerIsConvertibleFromTo<ValueType, const UObjectBase>::Value, "AddReferencedObjects: Values must be pointers to a type derived from UObject");
2826 !(std::is_pointer_v<KeyType> && std::is_convertible_v<KeyType, const UObjectBase*>));
2827 for (auto& It : Map)
2828 {
2829 if (IsObjectHandleResolved_ForGC(It.Value.GetHandle()))
2830 {
2831 HandleObjectReference(*reinterpret_cast<UObject**>(&It.Value), ReferencingObject, ReferencingProperty);
2832 }
2833 }
2834 }
2835 template <typename KeyType, typename ValueType, typename Allocator, typename KeyFuncs>
2836 void AddReferencedObjects(TMapBase<TObjectPtr<KeyType>, TObjectPtr<ValueType>, Allocator, KeyFuncs>& Map, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2837 {
2838 static_assert(sizeof(KeyType) > 0, "AddReferencedObjects: Keys must be pointers to a fully-defined type");
2839 static_assert(sizeof(ValueType) > 0, "AddReferencedObjects: Values must be pointers to a fully-defined type");
2840 static_assert(TPointerIsConvertibleFromTo<KeyType, const UObjectBase>::Value, "AddReferencedObjects: Keys must be pointers to a type derived from UObject");
2841 static_assert(TPointerIsConvertibleFromTo<ValueType, const UObjectBase>::Value, "AddReferencedObjects: Values must be pointers to a type derived from UObject");
2842 for (auto& It : Map)
2843 {
2844 if (IsObjectHandleResolved_ForGC(It.Key.GetHandle()))
2845 {
2846 HandleObjectReference(*reinterpret_cast<UObject**>(&It.Key), ReferencingObject, ReferencingProperty);
2847 }
2848 if (IsObjectHandleResolved_ForGC(It.Value.GetHandle()))
2849 {
2850 HandleObjectReference(*reinterpret_cast<UObject**>(&It.Value), ReferencingObject, ReferencingProperty);
2851 }
2852 }
2853 }
2854
2855 template <typename T>
2857 const UObject* ReferencingObject = nullptr,
2858 const FProperty* ReferencingProperty = nullptr)
2859 {
2860 AddReferencedObject(reinterpret_cast<FWeakObjectPtr&>(P),
2861 ReferencingObject,
2863 }
2864
2866 const UObject* ReferencingObject = nullptr,
2867 const FProperty* ReferencingProperty = nullptr);
2868
2881 COREUOBJECT_API void AddReferencedObjects(const UScriptStruct*& ScriptStruct, void* Instance, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr);
2882
2883 COREUOBJECT_API void AddReferencedObjects(TObjectPtr<const UScriptStruct>& ScriptStruct, void* Instance, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr);
2884 COREUOBJECT_API void AddReferencedObjects(TWeakObjectPtr<const UScriptStruct>& ScriptStruct, void* Instance, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr);
2885
2887 COREUOBJECT_API void AddPropertyReferences(const UStruct* Struct, void* Instance, const UObject* ReferencingObject = nullptr);
2888
2890 COREUOBJECT_API void AddPropertyReferencesWithStructARO(const UScriptStruct* Struct, void* Instance, const UObject* ReferencingObject = nullptr);
2891
2893 COREUOBJECT_API void AddPropertyReferencesWithStructARO(const UClass* Class, void* Instance, const UObject* ReferencingObject = nullptr);
2894
2896 COREUOBJECT_API void AddPropertyReferencesLimitedToObjectProperties(const UStruct* Struct, void* Instance, const UObject* ReferencingObject = nullptr);
2897
2904 virtual bool NeedsPropertyReferencer() const { return true; }
2905
2909 virtual bool IsIgnoringArchetypeRef() const = 0;
2913 virtual bool IsIgnoringTransient() const = 0;
2918
2919
2927 virtual class FProperty* GetSerializedProperty() const { return nullptr; }
2932 virtual bool MarkWeakObjectReferenceForClearing(UObject** WeakReference, UObject* ReferenceOwner) { return false; }
2940 virtual bool IsProcessingNativeReferences() const { return true; }
2941
2943 virtual bool NeedsInitialReferences() const { return true; }
2944
2951 {
2952 if (!DefaultReferenceCollectorArchive)
2953 {
2954 CreateVerySlowReferenceCollectorArchive();
2955 }
2956 return *DefaultReferenceCollectorArchive;
2957 }
2958
2959
2960 struct AROPrivate final // nb: internal use only
2961 {
2962 template<class UObjectType>
2964 UObjectType*& Object, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr)
2965 {
2966 // @todo: should be uncommented when proper usage is fixed everywhere
2967 // static_assert(sizeof(UObjectType) > 0, "AddReferencedObject: Element must be a pointer to a fully-defined type");
2968 // static_assert(TPointerIsConvertibleFromTo<UObjectType, const UObjectBase>::Value, "AddReferencedObject: Element must be a pointer to a type derived from UObject");
2969 Coll.HandleObjectReference(*(UObject**)&Object, ReferencingObject, ReferencingProperty);
2970 }
2971
2972 template<class UObjectType>
2974 const UObjectType*& Object,
2975 const UObject* ReferencingObject = nullptr,
2976 const FProperty* ReferencingProperty = nullptr)
2977 {
2978 // @todo: should be uncommented when proper usage is fixed everywhere
2979 // static_assert(sizeof(UObjectType) > 0, "AddReferencedObject: Element must be a pointer to a fully-defined type");
2980 // static_assert(TPointerIsConvertibleFromTo<UObjectType, const UObjectBase>::Value, "AddReferencedObject: Element must be a pointer to a type derived from UObject");
2981 Coll.HandleObjectReference(*(UObject**)const_cast<UObjectType**>(&Object), ReferencingObject, ReferencingProperty);
2982 }
2983
2984 template<class UObjectType>
2986 TArray<UObjectType*>& ObjectArray,
2987 const UObject* ReferencingObject = nullptr,
2988 const FProperty* ReferencingProperty = nullptr)
2989 {
2990 static_assert(sizeof(UObjectType) > 0, "AddReferencedObjects: Elements must be pointers to a fully-defined type");
2991 static_assert(TPointerIsConvertibleFromTo<UObjectType, const UObjectBase>::Value, "AddReferencedObjects: Elements must be pointers to a type derived from UObject");
2992 Coll.HandleObjectReferences(reinterpret_cast<UObject**>(ObjectArray.GetData()), ObjectArray.Num(), ReferencingObject, ReferencingProperty);
2993 }
2994
3002 template<class UObjectType>
3004 TArray<const UObjectType*>& ObjectArray,
3005 const UObject* ReferencingObject = nullptr,
3006 const FProperty* ReferencingProperty = nullptr)
3007 {
3008 static_assert(sizeof(UObjectType) > 0, "AddReferencedObjects: Elements must be pointers to a fully-defined type");
3009 static_assert(TPointerIsConvertibleFromTo<UObjectType, const UObjectBase>::Value, "AddReferencedObjects: Elements must be pointers to a type derived from UObject");
3010 Coll.HandleObjectReferences(reinterpret_cast<UObject**>(const_cast<UObjectType**>(ObjectArray.GetData())), ObjectArray.Num(), ReferencingObject, ReferencingProperty);
3011 }
3012
3013 template<class UObjectType>
3015 TSet<UObjectType*>& ObjectSet,
3016 const UObject* ReferencingObject = nullptr,
3017 const FProperty* ReferencingProperty = nullptr)
3018 {
3019 static_assert(sizeof(UObjectType) > 0, "AddReferencedObjects: Elements must be pointers to a fully-defined type");
3020 static_assert(TPointerIsConvertibleFromTo<UObjectType, const UObjectBase>::Value, "AddReferencedObjects: Elements must be pointers to a type derived from UObject");
3021 for (auto& Object : ObjectSet)
3022 {
3023 Coll.HandleObjectReference(*(UObject**)&Object, ReferencingObject, ReferencingProperty);
3024 }
3025 }
3026
3027 template <typename KeyType, typename ValueType, typename Allocator, typename KeyFuncs>
3030 const UObject* ReferencingObject = nullptr,
3031 const FProperty* ReferencingProperty = nullptr)
3032 {
3033 static_assert(sizeof(KeyType) > 0, "AddReferencedObjects: Keys must be pointers to a fully-defined type");
3034 static_assert(TPointerIsConvertibleFromTo<KeyType, const UObjectBase>::Value, "AddReferencedObjects: Keys must be pointers to a type derived from UObject");
3035 for (auto& It : Map)
3036 {
3037 Coll.HandleObjectReference(*(UObject**)&It.Key, ReferencingObject, ReferencingProperty);
3038 }
3039 }
3040
3041 template <typename KeyType, typename ValueType, typename Allocator, typename KeyFuncs>
3044 const UObject* ReferencingObject = nullptr,
3045 const FProperty* ReferencingProperty = nullptr)
3046 {
3047 static_assert(sizeof(ValueType) > 0, "AddReferencedObjects: Values must be pointers to a fully-defined type");
3048 static_assert(TPointerIsConvertibleFromTo<ValueType, const UObjectBase>::Value, "AddReferencedObjects: Values must be pointers to a type derived from UObject");
3049 for (auto& It : Map)
3050 {
3051 Coll.HandleObjectReference(*(UObject**)&It.Value, ReferencingObject, ReferencingProperty);
3052 }
3053 }
3054
3055 template <typename KeyType, typename ValueType, typename Allocator, typename KeyFuncs>
3057 {
3058 static_assert(sizeof(KeyType) > 0, "AddReferencedObjects: Keys must be pointers to a fully-defined type");
3059 static_assert(sizeof(ValueType) > 0, "AddReferencedObjects: Values must be pointers to a fully-defined type");
3060 static_assert(TPointerIsConvertibleFromTo<KeyType, const UObjectBase>::Value, "AddReferencedObjects: Keys must be pointers to a type derived from UObject");
3061 static_assert(TPointerIsConvertibleFromTo<ValueType, const UObjectBase>::Value, "AddReferencedObjects: Values must be pointers to a type derived from UObject");
3062 for (auto& It : Map)
3063 {
3064 Coll.HandleObjectReference(*(UObject**)&It.Key, ReferencingObject, ReferencingProperty);
3065 Coll.HandleObjectReference(*(UObject**)&It.Value, ReferencingObject, ReferencingProperty);
3066 }
3067 }
3068
3070 const UScriptStruct*& ScriptStruct,
3071 void* Instance, const UObject* ReferencingObject = nullptr, const FProperty* ReferencingProperty = nullptr);
3072 };
3073
3074protected:
3083
3093 {
3094 for (int32 ObjectIndex = 0; ObjectIndex < ObjectNum; ++ObjectIndex)
3095 {
3096 UObject*& Object = InObjects[ObjectIndex];
3098 }
3099 }
3100
3110
3111#if WITH_VERSE_VM || defined(__INTELLISENSE__)
3119 virtual void HandleVCellReference(Verse::VCell* InCell, const UObject* InReferencingObject, const FProperty* InReferencingProperty)
3120 {
3121 // Ignore VCells by default, like `FSimpleReferenceProcessorBase::HandleTokenStreamVerseCellReference`.
3122 }
3123#endif
3124
3125private:
3127 COREUOBJECT_API void CreateVerySlowReferenceCollectorArchive();
3128
3130 TUniquePtr<FReferenceCollectorArchive> DefaultReferenceCollectorArchive;
3131
3132 COREUOBJECT_API void AddStableReferenceSetFwd(TSet<FObjectPtr>* Objects);
3133 COREUOBJECT_API void AddStableReferenceArrayFwd(TArray<FObjectPtr>* Objects);
3134 COREUOBJECT_API void AddStableReferenceFwd(FObjectPtr* Object);
3135};
3136
3142{
3143public:
3144
3158
3167 COREUOBJECT_API virtual void FindReferences(UObject* Object, UObject* ReferencingObject = nullptr, FProperty* ReferencingProperty = nullptr);
3168
3169 // FReferenceCollector interface.
3170 COREUOBJECT_API virtual void HandleObjectReference(UObject*& Object, const UObject* ReferencingObject, const FProperty* InReferencingProperty) override;
3171 virtual bool IsIgnoringArchetypeRef() const override { return bShouldIgnoreArchetype; }
3172 virtual bool IsIgnoringTransient() const override { return bShouldIgnoreTransient; }
3173 virtual void SetSerializedProperty(class FProperty* Inproperty) override
3174 {
3176 }
3177 virtual class FProperty* GetSerializedProperty() const override
3178 {
3179 return SerializedProperty;
3180 }
3181protected:
3182
3199};
3200
3202enum class EPackageReloadPhase : uint8;
3205
3207{
3208 None = 0,
3209
3210 // Set when the hot reloaded class has been detected as changed
3211 Changed = 0x01
3212};
3213
3215
3222
3229
3231{
3232
3233 // Registration for the given module has been delayed and will be registered with a layer notification where the package name is NAME_None.
3234 // Calls to FindObject<> for any delayed registrations will return nullptr.
3235 Delayed,
3236
3237 // All pending registrations have been done but CDOs have not been created. This may be invoked multiple times for the same package name.
3238 // Calls to FindObject<> for all pending registrations will return the UObject in question.
3239 PreCDO,
3240
3241 // All pending registrations and CDO creation has been done. Calls to FindObject<> for all pending registrations will return the UObject
3242 // in question. The CDO will also be available for any registered UClasses.
3243 PostCDO,
3244};
3245
3250{
3251#if WITH_EDITOR
3254 static COREUOBJECT_API FOnObjectPropertyChanged OnObjectPropertyChanged;
3255
3259
3263
3267
3270
3273 {
3274 if (OnObjectModified.IsBound() && !ObjectsModifiedThisFrame.Contains(Object))
3275 {
3277 OnObjectModified.Broadcast(Object);
3278 }
3279 }
3280
3284
3287 {
3288 OnObjectRenamed.Broadcast(Object, OldOuter, OldName);
3289 }
3290
3294
3300 using FReplacementObjectMap = TMap<UObject*, UObject*>; // Alias for use in the macro
3302 static COREUOBJECT_API FOnObjectsReplaced OnObjectsReplaced;
3303
3311
3315 DECLARE_MULTICAST_DELEGATE_ThreeParams(FOnVerseDeadReferences, const TSet<UClass*>& /*DeadClasses*/, const TSet<UObject*>& /*ActiveInstances*/, const TSet<UObject*>& /*TemplateInstances*/);
3317
3325
3329
3333
3336
3340#endif // WITH_EDITOR
3341
3345
3349
3353
3357
3361
3365
3369
3371 UE_DEPRECATED(all, "RegisterClassForHotReloadReinstancingDelegate is for internal use only.")
3373
3375 UE_DEPRECATED(all, "ReinstanceHotReloadedClassesDelegate is for internal use only")
3377
3387
3388 /* Multicast delegate that is executed when any UObjects in packages need destroying before modules are unloaded. */
3391
3395
3397 DECLARE_MULTICAST_DELEGATE_TwoParams(FPreLoadMapWithContextDelegate, const FWorldContext& /*WorldContext*/, const FString& /* MapName */);
3399
3403
3406
3409
3412
3415
3418
3421
3424
3425#if !UE_BUILD_SHIPPING
3429#endif
3430
3433
3436
3439
3443
3447
3451
3455};
3456
3459
3462
3465
3468
3471
3472namespace UE
3473{
3474
3476{
3477public:
3478 inline explicit FAssetLog(const TCHAR* InPath UE_LIFETIMEBOUND) : Path(InPath) {}
3479 inline explicit FAssetLog(const FPackagePath& InPath UE_LIFETIMEBOUND) : PackagePath(&InPath) {}
3480 inline explicit FAssetLog(const UObject* InObject UE_LIFETIMEBOUND) : Object(InObject) {}
3481
3482 friend void SerializeForLog(FCbWriter& Writer, const FAssetLog& AssetLog) { AssetLog.SerializeForLog(Writer); }
3483
3484private:
3485 COREUOBJECT_API void SerializeForLog(FCbWriter& Writer) const;
3486 const TCHAR* Path = nullptr;
3487 const FPackagePath* PackagePath = nullptr;
3488 const UObject* Object = nullptr;
3489};
3490
3491} // UE
3492
3493namespace UE::Core::Private
3494{
3495COREUOBJECT_API void RecordAssetLog(
3496 const FName& CategoryName,
3497 ELogVerbosity::Type Verbosity,
3498 const FAssetLog& AssetLog,
3499 const FString& Message,
3500 const ANSICHAR* File,
3501 int32 Line);
3502} // UE::Core::Private
3503
3509{
3511 static COREUOBJECT_API FString FormatPathForAssetLog(const TCHAR* Path);
3512
3514 static COREUOBJECT_API FString FormatPathForAssetLog(const FPackagePath& Path);
3515
3517 static COREUOBJECT_API FString FormatPathForAssetLog(const UObject* Object);
3518
3519 static COREUOBJECT_API FString GetAssetLogString(const TCHAR* Path, const FString& Message);
3520 static COREUOBJECT_API FString GetAssetLogString(const FPackagePath& Path, const FString& Message);
3521 static COREUOBJECT_API FString GetAssetLogString(const UObject* Object, const FString& Message);
3522};
3523
3524#define ASSET_LOG_FORMAT_STRING_ANSI "[AssetLog] %s: "
3525#define ASSET_LOG_FORMAT_STRING TEXT(ASSET_LOG_FORMAT_STRING_ANSI)
3526
3527#if NO_LOGGING
3528 #define UE_ASSET_LOG(...)
3529#else
3537 #define UE_ASSET_LOG(CategoryName, Verbosity, Asset, Format, ...) \
3538 { \
3539 static_assert(TIsArrayOrRefOfTypeByPredicate<decltype(Format), TIsCharEncodingCompatibleWithTCHAR>::Value, "Formatting string must be a TCHAR array."); \
3540 static_assert((ELogVerbosity::Verbosity & ELogVerbosity::VerbosityMask) < ELogVerbosity::NumVerbosity && ELogVerbosity::Verbosity > 0, "Verbosity must be constant and in range."); \
3541 CA_CONSTANT_IF((ELogVerbosity::Verbosity & ELogVerbosity::VerbosityMask) <= ELogVerbosity::COMPILED_IN_MINIMUM_VERBOSITY && (ELogVerbosity::Warning & ELogVerbosity::VerbosityMask) <= FLogCategory##CategoryName::CompileTimeVerbosity) \
3542 { \
3543 UE_LOG_EXPAND_IS_FATAL(Verbosity, PREPROCESSOR_NOTHING, if (!CategoryName.IsSuppressed(ELogVerbosity::Verbosity))) \
3544 { \
3545 ::UE::Core::Private::RecordAssetLog(CategoryName.GetCategoryName(), ELogVerbosity::Verbosity, ::UE::FAssetLog(Asset), FString::Printf(Format, ##__VA_ARGS__), __FILE__, __LINE__); \
3546 UE_LOG_EXPAND_IS_FATAL(Verbosity, \
3547 { \
3548 UE_DEBUG_BREAK_AND_PROMPT_FOR_REMOTE(); \
3549 FDebug::AssertFailed("", __FILE__, __LINE__, TEXT("%s: %s"), *FAssetMsg::FormatPathForAssetLog(Asset), *FString::Printf(Format, ##__VA_ARGS__)); \
3550 CA_ASSUME(false); \
3551 }, \
3552 PREPROCESSOR_NOTHING \
3553 ) \
3554 } \
3555 } \
3556 }
3557#endif // NO_LOGGING
3558
3559#if WITH_EDITORONLY_DATA
3561{
3562enum class EEditorOnlyObjectResult
3563{
3565 EditorOnly,
3567};
3568}// namespace UE::SavePackageUtilities
3569#endif // WITH_EDITORONLY_DATA
3570
3571#if WITH_EDITOR
3582COREUOBJECT_API bool IsEditorOnlyObject(const UObject* InObject, bool bCheckRecursive = true);
3584 TFunctionRef<UE::SavePackageUtilities::EEditorOnlyObjectResult(const UObject* Object)> LookupInCache,
3585 TFunctionRef<void(const UObject* Object, bool bEditorOnly)> AddToCache);
3586
3587#endif //WITH_EDITOR
3588
3589class FFieldClass;
3592
3594typedef void (*SetterFuncPtr)(void* InContainer, const void* InValue);
3595typedef void (*GetterFuncPtr)(const void* InContainer, void* OutValue);
3596
3598namespace UECodeGen_Private
3599{
3600 enum class EPropertyGenFlags : uint8
3601 {
3602 None = 0x00,
3603
3604 // First 6 bits are the property type
3605 Byte = 0x00,
3606 Int8 = 0x01,
3607 Int16 = 0x02,
3608 Int = 0x03,
3609 Int64 = 0x04,
3610 UInt16 = 0x05,
3611 UInt32 = 0x06,
3612 UInt64 = 0x07,
3613 // = 0x08,
3614 // = 0x09,
3615 Float = 0x0A,
3616 Double = 0x0B,
3617 Bool = 0x0C,
3618 SoftClass = 0x0D,
3619 WeakObject = 0x0E,
3620 LazyObject = 0x0F,
3621 SoftObject = 0x10,
3622 Class = 0x11,
3623 Object = 0x12,
3624 Interface = 0x13,
3625 Name = 0x14,
3626 Str = 0x15,
3627 Array = 0x16,
3628 Map = 0x17,
3629 Set = 0x18,
3630 Struct = 0x19,
3631 Delegate = 0x1A,
3634 Text = 0x1D,
3635 Enum = 0x1E,
3636 FieldPath = 0x1F,
3638 Optional = 0x21,
3639 VerseValue = 0x22,
3640 Utf8Str = 0x23,
3641 AnsiStr = 0x24,
3642 VerseString = 0x25,
3643 VerseCell = 0x26,
3644 VerseType = 0x27,
3645
3646 // Property-specific flags
3647 NativeBool = 0x40,
3648 ObjectPtr = 0x40,
3649
3650 };
3651
3652 static_assert(std::is_same_v<int32, int >, "CoreUObject property system expects int32 to be an int");
3653 static_assert(std::is_same_v<uint32, unsigned int>, "CoreUObject property system expects uint32 to be an unsigned int");
3654
3656
3657 // Value which masks out the type of combined EPropertyGenFlags.
3658 inline constexpr EPropertyGenFlags PropertyTypeMask = (EPropertyGenFlags)0x3F;
3659
3660#if WITH_METADATA
3661 struct FMetaDataPairParam
3662 {
3663 const char* NameUTF8;
3664 const char* ValueUTF8;
3665 };
3666#endif
3667
3668 struct FEnumeratorParam
3669 {
3670 const char* NameUTF8;
3671 int64 Value;
3672 };
3673
3674 // This is not a base class but is just a common initial sequence of all of the F*PropertyParams types below.
3675 // We don't want to use actual inheritance because we want to construct aggregated compile-time tables of these things.
3676 struct FPropertyParamsBase
3677 {
3678 const char* NameUTF8;
3679 const char* RepNotifyFuncUTF8;
3680 EPropertyFlags PropertyFlags;
3682 EObjectFlags ObjectFlags;
3683 SetterFuncPtr SetterFunc;
3684 GetterFuncPtr GetterFunc;
3685 uint16 ArrayDim;
3686 };
3687
3688 struct FPropertyParamsBaseWithoutOffset // : FPropertyParamsBase
3689 {
3690 const char* NameUTF8;
3691 const char* RepNotifyFuncUTF8;
3692 EPropertyFlags PropertyFlags;
3694 EObjectFlags ObjectFlags;
3695 SetterFuncPtr SetterFunc;
3696 GetterFuncPtr GetterFunc;
3697 uint16 ArrayDim;
3698 };
3699
3700 struct FPropertyParamsBaseWithOffset // : FPropertyParamsBase
3701 {
3702 const char* NameUTF8;
3703 const char* RepNotifyFuncUTF8;
3704 EPropertyFlags PropertyFlags;
3706 EObjectFlags ObjectFlags;
3707 SetterFuncPtr SetterFunc;
3708 GetterFuncPtr GetterFunc;
3709 uint16 ArrayDim;
3710 uint16 Offset;
3711 };
3712
3713 struct FGenericPropertyParams // : FPropertyParamsBaseWithOffset
3714 {
3715 const char* NameUTF8;
3716 const char* RepNotifyFuncUTF8;
3717 EPropertyFlags PropertyFlags;
3719 EObjectFlags ObjectFlags;
3720 SetterFuncPtr SetterFunc;
3721 GetterFuncPtr GetterFunc;
3722 uint16 ArrayDim;
3723 uint16 Offset;
3724#if WITH_METADATA
3726 const FMetaDataPairParam* MetaDataArray;
3727#endif
3728 };
3729
3730 struct FBytePropertyParams // : FPropertyParamsBaseWithOffset
3731 {
3732 const char* NameUTF8;
3733 const char* RepNotifyFuncUTF8;
3734 EPropertyFlags PropertyFlags;
3736 EObjectFlags ObjectFlags;
3737 SetterFuncPtr SetterFunc;
3738 GetterFuncPtr GetterFunc;
3739 uint16 ArrayDim;
3740 uint16 Offset;
3741 UEnum* (*EnumFunc)();
3742#if WITH_METADATA
3744 const FMetaDataPairParam* MetaDataArray;
3745#endif
3746 };
3747
3748 struct FBoolPropertyParams // : FPropertyParamsBaseWithoutOffset
3749 {
3750 const char* NameUTF8;
3751 const char* RepNotifyFuncUTF8;
3752 EPropertyFlags PropertyFlags;
3754 EObjectFlags ObjectFlags;
3755 SetterFuncPtr SetterFunc;
3756 GetterFuncPtr GetterFunc;
3757 uint16 ArrayDim;
3758 uint16 ElementSize;
3760 void (*SetBitFunc)(void* Obj);
3761#if WITH_METADATA
3763 const FMetaDataPairParam* MetaDataArray;
3764#endif
3765 };
3766
3767 struct FObjectPropertyParamsWithoutClass // : FPropertyParamsBaseWithOffset
3768 {
3769 const char* NameUTF8;
3770 const char* RepNotifyFuncUTF8;
3771 EPropertyFlags PropertyFlags;
3773 EObjectFlags ObjectFlags;
3774 SetterFuncPtr SetterFunc;
3775 GetterFuncPtr GetterFunc;
3776 uint16 ArrayDim;
3777 uint16 Offset;
3778#if WITH_METADATA
3780 const FMetaDataPairParam* MetaDataArray;
3781#endif
3782 };
3783
3784 struct FObjectPropertyParamsWithClass // : FPropertyParamsBaseWithOffset
3785 {
3786 const char* NameUTF8;
3787 const char* RepNotifyFuncUTF8;
3788 EPropertyFlags PropertyFlags;
3790 EObjectFlags ObjectFlags;
3791 SetterFuncPtr SetterFunc;
3792 GetterFuncPtr GetterFunc;
3793 uint16 ArrayDim;
3794 uint16 Offset;
3795 UClass* (*ClassFunc)();
3796#if WITH_METADATA
3798 const FMetaDataPairParam* MetaDataArray;
3799#endif
3800 };
3801
3802 struct FObjectPropertyParams // : FObjectPropertyParamsWithClass
3803 {
3804 const char* NameUTF8;
3805 const char* RepNotifyFuncUTF8;
3806 EPropertyFlags PropertyFlags;
3808 EObjectFlags ObjectFlags;
3809 SetterFuncPtr SetterFunc;
3810 GetterFuncPtr GetterFunc;
3811 uint16 ArrayDim;
3812 uint16 Offset;
3813 UClass* (*ClassFunc)();
3814#if WITH_METADATA
3816 const FMetaDataPairParam* MetaDataArray;
3817#endif
3818 };
3819
3820 struct FClassPropertyParams // : FObjectPropertyParams
3821 {
3822 const char* NameUTF8;
3823 const char* RepNotifyFuncUTF8;
3824 EPropertyFlags PropertyFlags;
3826 EObjectFlags ObjectFlags;
3827 SetterFuncPtr SetterFunc;
3828 GetterFuncPtr GetterFunc;
3829 uint16 ArrayDim;
3830 uint16 Offset;
3831 UClass* (*ClassFunc)();
3832 UClass* (*MetaClassFunc)();
3833#if WITH_METADATA
3835 const FMetaDataPairParam* MetaDataArray;
3836#endif
3837 };
3838
3839 struct FVerseClassPropertyParams // : FClassPropertyParams
3840 {
3841 const char* NameUTF8;
3842 const char* RepNotifyFuncUTF8;
3843 EPropertyFlags PropertyFlags;
3845 EObjectFlags ObjectFlags;
3846 SetterFuncPtr SetterFunc;
3847 GetterFuncPtr GetterFunc;
3848 uint16 ArrayDim;
3849 uint16 Offset;
3850 UClass* (*ClassFunc)();
3851 UClass* (*MetaClassFunc)();
3852 bool bRequiresConcrete;
3853 bool bRequiresCastable;
3854#if WITH_METADATA
3856 const FMetaDataPairParam* MetaDataArray;
3857#endif
3858 };
3859
3860 struct FSoftClassPropertyParams // : FObjectPropertyParamsWithoutClass
3861 {
3862 const char* NameUTF8;
3863 const char* RepNotifyFuncUTF8;
3864 EPropertyFlags PropertyFlags;
3866 EObjectFlags ObjectFlags;
3867 SetterFuncPtr SetterFunc;
3868 GetterFuncPtr GetterFunc;
3869 uint16 ArrayDim;
3870 uint16 Offset;
3871 UClass* (*MetaClassFunc)();
3872#if WITH_METADATA
3874 const FMetaDataPairParam* MetaDataArray;
3875#endif
3876 };
3877
3878 struct FInterfacePropertyParams // : FPropertyParamsBaseWithOffset
3879 {
3880 const char* NameUTF8;
3881 const char* RepNotifyFuncUTF8;
3882 EPropertyFlags PropertyFlags;
3884 EObjectFlags ObjectFlags;
3885 SetterFuncPtr SetterFunc;
3886 GetterFuncPtr GetterFunc;
3887 uint16 ArrayDim;
3888 uint16 Offset;
3889 UClass* (*InterfaceClassFunc)();
3890#if WITH_METADATA
3892 const FMetaDataPairParam* MetaDataArray;
3893#endif
3894 };
3895
3896 struct FStructPropertyParams // : FPropertyParamsBaseWithOffset
3897 {
3898 const char* NameUTF8;
3899 const char* RepNotifyFuncUTF8;
3900 EPropertyFlags PropertyFlags;
3902 EObjectFlags ObjectFlags;
3903 SetterFuncPtr SetterFunc;
3904 GetterFuncPtr GetterFunc;
3905 uint16 ArrayDim;
3906 uint16 Offset;
3907 UScriptStruct* (*ScriptStructFunc)();
3908#if WITH_METADATA
3910 const FMetaDataPairParam* MetaDataArray;
3911#endif
3912 };
3913
3914 struct FDelegatePropertyParams // : FPropertyParamsBaseWithOffset
3915 {
3916 const char* NameUTF8;
3917 const char* RepNotifyFuncUTF8;
3918 EPropertyFlags PropertyFlags;
3920 EObjectFlags ObjectFlags;
3921 SetterFuncPtr SetterFunc;
3922 GetterFuncPtr GetterFunc;
3923 uint16 ArrayDim;
3924 uint16 Offset;
3925 UFunction* (*SignatureFunctionFunc)();
3926#if WITH_METADATA
3928 const FMetaDataPairParam* MetaDataArray;
3929#endif
3930 };
3931
3932 struct FMulticastDelegatePropertyParams // : FPropertyParamsBaseWithOffset
3933 {
3934 const char* NameUTF8;
3935 const char* RepNotifyFuncUTF8;
3936 EPropertyFlags PropertyFlags;
3938 EObjectFlags ObjectFlags;
3939 SetterFuncPtr SetterFunc;
3940 GetterFuncPtr GetterFunc;
3941 uint16 ArrayDim;
3942 uint16 Offset;
3943 UFunction* (*SignatureFunctionFunc)();
3944#if WITH_METADATA
3946 const FMetaDataPairParam* MetaDataArray;
3947#endif
3948 };
3949
3950 struct FEnumPropertyParams // : FPropertyParamsBaseWithOffset
3951 {
3952 const char* NameUTF8;
3953 const char* RepNotifyFuncUTF8;
3954 EPropertyFlags PropertyFlags;
3956 EObjectFlags ObjectFlags;
3957 SetterFuncPtr SetterFunc;
3958 GetterFuncPtr GetterFunc;
3959 uint16 ArrayDim;
3960 uint16 Offset;
3961 UEnum* (*EnumFunc)();
3962#if WITH_METADATA
3964 const FMetaDataPairParam* MetaDataArray;
3965#endif
3966 };
3967
3968 struct FFieldPathPropertyParams // : FPropertyParamsBaseWithOffset
3969 {
3970 const char* NameUTF8;
3971 const char* RepNotifyFuncUTF8;
3972 EPropertyFlags PropertyFlags;
3974 EObjectFlags ObjectFlags;
3975 SetterFuncPtr SetterFunc;
3976 GetterFuncPtr GetterFunc;
3977 uint16 ArrayDim;
3978 uint16 Offset;
3979 FFieldClass* (*PropertyClassFunc)();
3980#if WITH_METADATA
3982 const FMetaDataPairParam* MetaDataArray;
3983#endif
3984 };
3985
3986 struct FArrayPropertyParams // : FPropertyParamsBaseWithOffset
3987 {
3988 const char* NameUTF8;
3989 const char* RepNotifyFuncUTF8;
3990 EPropertyFlags PropertyFlags;
3992 EObjectFlags ObjectFlags;
3993 SetterFuncPtr SetterFunc;
3994 GetterFuncPtr GetterFunc;
3995 uint16 ArrayDim;
3996 uint16 Offset;
3997 EArrayPropertyFlags ArrayFlags;
3998#if WITH_METADATA
4000 const FMetaDataPairParam* MetaDataArray;
4001#endif
4002 };
4003
4004 struct FMapPropertyParams // : FPropertyParamsBaseWithOffset
4005 {
4006 const char* NameUTF8;
4007 const char* RepNotifyFuncUTF8;
4008 EPropertyFlags PropertyFlags;
4010 EObjectFlags ObjectFlags;
4011 SetterFuncPtr SetterFunc;
4012 GetterFuncPtr GetterFunc;
4013 uint16 ArrayDim;
4014 uint16 Offset;
4015 EMapPropertyFlags MapFlags;
4016#if WITH_METADATA
4018 const FMetaDataPairParam* MetaDataArray;
4019#endif
4020 };
4021
4022 // These property types don't add new any construction parameters to their base property
4046
4047 struct FFunctionBaseParams
4048 {
4049 UObject* (*OuterFunc)();
4050 UFunction* (*SuperFunc)();
4051 const char* NameUTF8;
4052 const FPropertyParamsBase* const* PropertyArray;
4053 uint16 NumProperties;
4055 EObjectFlags ObjectFlags;
4056 EFunctionFlags FunctionFlags;
4057 uint16 RPCId;
4058 uint16 RPCResponseId;
4059#if WITH_METADATA
4061 const FMetaDataPairParam* MetaDataArray;
4062#endif
4063 };
4064
4066 {
4067 };
4068
4070 {
4071 };
4072
4074 {
4075 const char* OwningClassName;
4076 const char* DelegateName;
4077 };
4078
4080 {
4081 const char* AlternateName;
4082 };
4083
4084 struct FEnumParams
4085 {
4086 UObject* (*OuterFunc)();
4088 const char* NameUTF8;
4089 const char* CppTypeUTF8;
4091 EObjectFlags ObjectFlags;
4093 EEnumFlags EnumFlags;
4094 uint8 CppForm; // this is of type UEnum::ECppForm
4095#if WITH_METADATA
4097 const FMetaDataPairParam* MetaDataArray;
4098#endif
4099 };
4100
4102 {
4103 const char* QaulifiedName;
4104 };
4105
4106 struct FStructParams
4107 {
4108 UObject* (*OuterFunc)();
4109 UScriptStruct* (*SuperFunc)();
4110 void* (*StructOpsFunc)(); // really returns UScriptStruct::ICppStructOps*
4111 const char* NameUTF8;
4112 const FPropertyParamsBase* const* PropertyArray;
4113 uint16 NumProperties;
4114 uint16 SizeOf;
4115 uint8 AlignOf;
4116 EObjectFlags ObjectFlags;
4117 uint32 StructFlags; // EStructFlags
4118#if WITH_METADATA
4120 const FMetaDataPairParam* MetaDataArray;
4121#endif
4122 };
4123
4125 {
4126 const char* QaulifiedName;
4127 };
4128
4129 struct FPackageParams
4130 {
4131 const char* NameUTF8;
4132 UObject* (*const *SingletonFuncArray)();
4134 uint32 PackageFlags; // EPackageFlags
4137#if WITH_METADATA
4139 const FMetaDataPairParam* MetaDataArray;
4140#endif
4141 };
4142
4144 {
4145 UClass* (*ClassFunc)();
4146 int32 Offset;
4147 bool bImplementedByK2;
4148 bool bDirectInterface = false; // Used by verse
4149 };
4150
4151 struct FClassParams
4152 {
4153 UClass* (*ClassNoRegisterFunc)();
4154 const char* ClassConfigNameUTF8;
4155 const FCppClassTypeInfoStatic* CppClassInfo;
4158 const FPropertyParamsBase* const* PropertyArray;
4161 uint32 NumFunctions : 11;
4162 uint32 NumProperties : 11;
4164 uint32 ClassFlags; // EClassFlags
4165#if WITH_METADATA
4167 const FMetaDataPairParam* MetaDataArray;
4168#endif
4169 };
4170
4172 {
4173 const char* PackageRelativeVersePath;
4174 const char* MangledPackageVersePath;
4175 uint32 VerseClassFlags;
4176 };
4177
4178 COREUOBJECT_API void ConstructUFunction(UFunction** SingletonPtr, const FFunctionParams& Params);
4179 COREUOBJECT_API void ConstructUDelegateFunction(UFunction** SingletonPtr, const FDelegateFunctionParams& Params);
4180 COREUOBJECT_API void ConstructUSparseDelegateFunction(UFunction** SingletonPtr, const FSparseDelegateFunctionParams& Params);
4181 COREUOBJECT_API void ConstructUEnum(UEnum*& OutEnum, const FEnumParams& Params);
4182 COREUOBJECT_API void ConstructUScriptStruct(UScriptStruct*& OutStruct, const FStructParams& Params);
4183 COREUOBJECT_API void ConstructUPackage(UPackage*& OutPackage, const FPackageParams& Params);
4184 COREUOBJECT_API void ConstructUClass(UClass*& OutClass, const FClassParams& Params);
4185}
4187
4188// METADATA_PARAMS(x, y) expands to x, y, if WITH_METADATA is set, otherwise expands to nothing
4189#if WITH_METADATA
4190 #define METADATA_PARAMS(x, y) x, y,
4191#else
4192 #define METADATA_PARAMS(x, y)
4193#endif
4194
4195// IF_WITH_METADATA expands to its contents if WITH_METADATA is set, otherwise expands to nothing
4196#if WITH_METADATA
4197 #define IF_WITH_METADATA(...) __VA_ARGS__
4198#else
4199 #define IF_WITH_METADATA(...)
4200#endif
4201
4202// IF_WITH_EDITOR(x, y) expands to x if WITH_EDITOR is set, otherwise expands to y
4203#if WITH_EDITOR
4204 #define IF_WITH_EDITOR(x, y) x
4205#else
4206 #define IF_WITH_EDITOR(x, y) y
4207#endif
4208
4209// IF_WITH_EDITORONLY_DATA(x, y) expands to x if WITH_EDITORONLY_DATA is set, otherwise expands to y
4210#if WITH_EDITORONLY_DATA
4211 #define IF_WITH_EDITORONLY_DATA(x, y) x
4212#else
4213 #define IF_WITH_EDITORONLY_DATA(x, y) y
4214#endif
4215
4216// IF_WITH_VERSE_VM(x, y) expands to x if WITH_VERSE_VM is set, otherwise expands to y
4217#if WITH_VERSE_VM
4218 #define IF_WITH_VERSE_VM(x, y) x
4219#else
4220 #define IF_WITH_VERSE_VM(x, y) y
4221#endif
4222
4225{
4227 Invalid,
4229 Valid,
4232};
4233
4243
4244// Types used by both constinit and non-constinit UHT codegen
4245namespace UE::CodeGen
4246{
4252}
4253
4254#if UE_WITH_CONSTINIT_UOBJECT
4255class FStructBaseChain;
4256struct ICppStructOps;
4257struct FVerseCallableThunk;
4258
4259namespace UE::CodeGen::ConstInit
4260{
4261#if WITH_METADATA
4262 struct FMetaData
4263 {
4264 const UTF8CHAR* NameUTF8;
4265 const UTF8CHAR* ValueUTF8;
4266 };
4267#endif
4268
4269 // Parameter wrapper for FField* or UObject* which can be used as a parameter in a constexpr context
4270 struct FFieldOwnerParam
4271 {
4272 union FValue
4273 {
4274 UObject* Object;
4275 FField* Field;
4276 } Value;
4277 bool bIsObject;
4278
4279 constexpr FFieldOwnerParam()
4280 {
4281 Value.Object = nullptr;
4282 bIsObject = true;
4283 }
4284 // Implicit construction from UObject*
4285 constexpr FFieldOwnerParam(UObject* InObject)
4286 {
4287 Value.Object = InObject;
4288 bIsObject = true;
4289 }
4290 // Implicit construction from FField*
4291 constexpr FFieldOwnerParam(FField* InField)
4292 {
4293 Value.Field = InField;
4294 bIsObject = false;
4295 }
4296 };
4297
4298 // Shared parameters for all properties for constant-initialization
4299 struct FPropertyParams
4300 {
4301 FFieldClass* FieldClass;
4303 FProperty* NextProperty; // Next property in this exact struct, no link to inherited properties
4304 const UTF8CHAR* NameUTF8;
4306 EPropertyFlags PropertyFlags;
4307 EObjectFlags ObjectFlags;
4308 uint16 ArrayDim;
4309 uint16 Offset;
4310 int32 ElementSize;
4311#if WITH_METADATA
4313#endif
4314
4315 // Helper to initialize element size during delegating constructor call
4316 consteval FPropertyParams& SetElementSize(int32 InSize)
4317 {
4318 ElementSize = InSize;
4319 return *this;
4320 }
4321 };
4322
4323
4324 // Param structures for initialization of constinit UObjects in generated code
4325 // Intended to be passed directly to consteval constructors as as aggregate initialization
4326 // expressions using designated initializers and not stored in the binary as variables themselves
4327 struct FObjectParams
4328 {
4330 // UObject* rather than UClass* because consteval constructors must be inlined and TObjectPtr
4331 // cannot see inheritance hierarchy in definition of UObjectBase
4332 UObject* Class = nullptr;
4333 const UTF8CHAR* NameUTF8 = nullptr;
4334 UObject* Outer = nullptr;
4335
4337 {
4338 Class = InClass;
4339 return *this;
4340 }
4341 };
4342
4343 struct FPackageParams
4344 {
4347#if WITH_METADATA
4349#endif
4350 uint32 BodiesHash = 0;
4352 };
4353
4354 struct FUFieldParams
4355 {
4356 UField* Next;
4357 };
4358
4359 struct FStructParams
4360 {
4361 UStruct* Super;
4362 UField* FirstChild;
4364 FField* ChildProperties;
4365 int32 PropertiesSize;
4366 int16 MinAlignment;
4367#if WITH_METADATA
4369#endif
4370 };
4371
4373 {
4374 UClass* Class;
4375 int32 PointerOffset;
4376 bool bImplementedByK2;
4378 };
4379
4380 struct FClassParams
4381 {
4382 const TCHAR* ConfigName;
4383 void (*ClassConstructor)(const FObjectInitializer&);
4384 UObject* (*ClassVTableHelperCtorCaller)(FVTableHelper& Helper);
4385 FUObjectCppClassStaticFunctions CppClassStaticFunctions;
4386 EClassFlags ClassFlags;
4387 EClassCastFlags ClassCastFlags;
4390 UClass* ClassWithin;
4392 UScriptStruct* SparseClassDataStruct;
4393 };
4394
4395 struct FVerseClassParams
4396 {
4397 const UTF8CHAR* PackageRelativeVersePath;
4398 const UTF8CHAR* MangledPackageVersePath;
4399#if WITH_VERSE_VM
4401#endif
4402 };
4403
4404 struct FVerseStructParams
4405 {
4406 uint32 GuidA;
4407 uint32 GuidB;
4408 uint32 GuidC;
4409 uint32 GuidD;
4410 const UTF8CHAR* QualifiedName;
4411 };
4412
4413 struct FEnumParams
4414 {
4418 uint8 CppForm;
4419 EEnumFlags EnumFlags;
4421#if WITH_METADATA
4423#endif
4424 };
4425
4426 struct FVerseEnumParams
4427 {
4428 const UTF8CHAR* QualifiedName;
4429 };
4430
4431 struct FFunctionParams
4432 {
4434 EFunctionFlags FunctionFlags;
4435 int16 RPCId;
4436 int16 RPCResponseId;
4437 };
4438
4440 {
4442 };
4443
4445 {
4448 };
4449}
4450#endif // UE_WITH_CONSTINIT_UOBJECT
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
#define UE_REFERENCE_COLLECTOR_REQUIRE_OBJECTPTR
Definition CoreDefines.h:59
#define GLog
Definition CoreGlobals.h:95
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int16 int16
A 16-bit signed integer.
Definition Platform.h:1123
#define UE_LIFETIMEBOUND
Definition Platform.h:812
#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
#define UE_NODEBUG
Definition Platform.h:817
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::UTF8CHAR UTF8CHAR
An 8-bit character containing a UTF8 (Unicode, 8-bit, variable-width) code unit.
Definition Platform.h:1137
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
FPlatformTypes::ANSICHAR ANSICHAR
An ANSI character. Normally a signed type.
Definition Platform.h:1131
#define FUNCTION_NON_NULL_RETURN_END
Definition Platform.h:807
#define FUNCTION_NON_NULL_RETURN_START
Definition Platform.h:804
#define DECLARE_CYCLE_STAT_WITH_FLAGS_EXTERN(CounterName, StatId, GroupId, StatFlags, API)
Definition Stats.h:680
#define DECLARE_CYCLE_STAT_EXTERN(CounterName, StatId, GroupId, API)
Definition Stats.h:679
#define DECLARE_DWORD_COUNTER_STAT_EXTERN(CounterName, StatId, GroupId, API)
Definition Stats.h:682
#define DECLARE_DWORD_ACCUMULATOR_STAT_EXTERN(CounterName, StatId, GroupId, API)
Definition Stats.h:684
#define DECLARE_MEMORY_STAT_EXTERN(CounterName, StatId, GroupId, API)
Definition Stats.h:687
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_MULTICAST_DELEGATE_TwoParams(DelegateName, Param1Type, Param2Type)
Definition DelegateCombinations.h:58
#define DECLARE_TS_MULTICAST_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:50
#define DECLARE_TS_MULTICAST_DELEGATE_ThreeParams(DelegateName, Param1Type, Param2Type, Param3Type)
Definition DelegateCombinations.h:68
#define DECLARE_DELEGATE_ThreeParams(DelegateName, Param1Type, Param2Type, Param3Type)
Definition DelegateCombinations.h:66
#define DECLARE_MULTICAST_DELEGATE_ThreeParams(DelegateName, Param1Type, Param2Type, Param3Type)
Definition DelegateCombinations.h:67
#define DECLARE_MULTICAST_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:49
#define DECLARE_TS_MULTICAST_DELEGATE_TwoParams(DelegateName, Param1Type, Param2Type)
Definition DelegateCombinations.h:59
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
EFindObjectFlags
Definition FindObjectFlags.h:8
#define UE_EXACTCLASS_BOOL_DEPRECATED(FunctionName)
Definition FindObjectFlags.h:16
#define X(Name, Desc)
Definition FormatStringSan.h:47
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
const bool
Definition NetworkReplayStreaming.h:178
#define MAX_uint32
Definition NumericLimits.h:21
bool IsObjectHandleResolved_ForGC(FObjectHandle Handle)
Definition ObjectHandle.h:232
#define EInternalObjectFlags_AllFlags
Definition ObjectMacros.h:678
EClassCastFlags
Definition ObjectMacros.h:333
EPropertyFlags
Definition ObjectMacros.h:416
EMapPropertyFlags
Definition ObjectMacros.h:525
EClassFlags
Definition ObjectMacros.h:199
EPackageFlags
Definition ObjectMacros.h:129
@ PKG_None
No flags.
Definition ObjectMacros.h:130
EArrayPropertyFlags
Definition ObjectMacros.h:514
EInternalObjectFlags
Definition ObjectMacros.h:631
EObjectFlags
Definition ObjectMacros.h:552
@ RF_NoFlags
No flags, used to avoid a cast.
Definition ObjectMacros.h:555
EEnumFlags
Definition ObjectMacros.h:690
#define RF_AllFlags
All flags, used mainly for error checking.
Definition ObjectMacros.h:612
@ LOAD_None
No flags.
Definition ObjectMacros.h:69
EPackageReloadPhase
Definition PackageReload.h:48
#define RESULT_DECL
Definition Script.h:92
EFunctionFlags
Definition Script.h:132
COREUOBJECT_API UClass * StaticLoadClass(UClass *BaseClass, UObject *InOuter, FStringView Name, FStringView Filename={}, uint32 LoadFlags=LOAD_None, UPackageMap *Sandbox=nullptr)
Definition UObjectGlobals.cpp:1439
COREUOBJECT_API int32 GetNumAsyncPackages()
Definition AsyncPackageLoader.cpp:364
COREUOBJECT_API UObject * GetTransientOuterForRename(UClass *ForClass)
Definition Obj.cpp:5829
COREUOBJECT_API void BeginLoad(FUObjectSerializeContext *LoadContext, const TCHAR *DebugContext=nullptr)
Definition UObjectGlobals.cpp:2096
T * FindObjectChecked(UObject *Outer, FStringView Name, EFindObjectFlags Flags=EFindObjectFlags::None)
Definition UObjectGlobals.h:2067
COREUOBJECT_API bool GShouldVerifyGCAssumptions
Definition GarbageCollectionVerification.cpp:36
COREUOBJECT_API bool SaveToTransactionBuffer(UObject *Object, bool bMarkDirty)
Definition UObjectGlobals.cpp:3361
COREUOBJECT_API void PerformIncrementalReachabilityAnalysis(double TimeLimit)
Definition GarbageCollection.cpp:6034
COREUOBJECT_API void IncrementalPurgeGarbage(bool bUseTimeLimit, double TimeLimit=0.002)
Definition GarbageCollection.cpp:4652
COREUOBJECT_API bool GetAllowNativeComponentClassOverrides()
Definition UObjectGlobals.cpp:133
EDataValidationResult
Definition UObjectGlobals.h:4225
COREUOBJECT_API UObject * StaticConstructObject_Internal(const FStaticConstructObjectParameters &Params)
Definition UObjectGlobals.cpp:4921
T * GetMutableDefault()
Definition UObjectGlobals.h:2169
COREUOBJECT_API bool IsEventDrivenLoaderEnabled()
Definition AsyncLoading.cpp:8797
COREUOBJECT_API bool IsIncrementalUnhashPending()
Definition GarbageCollection.cpp:6090
COREUOBJECT_API UFunction * FindDelegateSignature(FName DelegateSignatureName)
Definition UObjectGlobals.cpp:6052
COREUOBJECT_API bool TryCollectGarbage(EObjectFlags KeepFlags, bool bPerformFullPurge=true)
Definition GarbageCollection.cpp:6221
const T * GetDefault()
Definition UObjectGlobals.h:2155
COREUOBJECT_API bool IsIncrementalPurgePending()
Definition GarbageCollection.cpp:5114
T * FindObjectFast(UObject *Outer, FName Name, EFindObjectFlags Flags=EFindObjectFlags::None, EObjectFlags ExclusiveFlags=RF_NoFlags)
Definition UObjectGlobals.h:2019
EObjectInitializerOptions
Definition UObjectGlobals.h:1279
void(* GetterFuncPtr)(const void *InContainer, void *OutValue)
Definition UObjectGlobals.h:3595
COREUOBJECT_API void SnapshotTransactionBuffer(UObject *Object)
Definition UObjectGlobals.cpp:3390
COREUOBJECT_API bool IsLoading()
Definition UObjectGlobals.cpp:2087
COREUOBJECT_API int32 GAssetClustreringEnabled
Definition UObjectClusters.cpp:34
COREUOBJECT_API float GetAsyncLoadPercentage(const FName &PackageName)
Definition AsyncPackageLoader.cpp:739
bool IsClassLoaded()
Definition UObjectGlobals.h:2180
COREUOBJECT_API bool StaticFindAllObjectsFastSafe(TArray< UObject * > &OutFoundObjects, UClass *ObjectClass, FName ObjectName, EFindObjectFlags Flags=EFindObjectFlags::None, EObjectFlags ExclusiveFlags=RF_NoFlags, EInternalObjectFlags ExclusiveInternalFlags=EInternalObjectFlags::None)
Definition UObjectGlobals.cpp:618
COREUOBJECT_API UObject * StaticFindObjectSafe(UClass *Class, UObject *InOuter, FStringView Name, EFindObjectFlags Flags=EFindObjectFlags::None)
Definition UObjectGlobals.cpp:596
COREUOBJECT_API UObject * StaticFindObjectFast(UClass *Class, UObject *InOuter, FName InName, EFindObjectFlags Flags=EFindObjectFlags::None, EObjectFlags ExclusiveFlags=RF_NoFlags, EInternalObjectFlags ExclusiveInternalFlags=EInternalObjectFlags::None)
Definition UObjectGlobals.cpp:449
COREUOBJECT_API FName MakeObjectNameFromDisplayLabel(const FString &DisplayLabel, const FName CurrentObjectName)
Definition UObjectGlobals.cpp:2993
COREUOBJECT_API void FinalizeIncrementalReachabilityAnalysis()
Definition GarbageCollection.cpp:6047
EHotReloadedClassFlags
Definition UObjectGlobals.h:3207
COREUOBJECT_API EAsyncPackageState::Type ProcessAsyncLoading(bool bUseTimeLimit, bool bUseFullTimeLimit, double TimeLimit)
Definition AsyncPackageLoader.cpp:369
COREUOBJECT_API void SetAsyncLoadingAllowed(bool bAllowAsyncLoading)
Definition AsyncPackageLoader.cpp:211
EReloadCompleteReason
Definition UObjectGlobals.h:3217
COREUOBJECT_API void CollectGarbage(EObjectFlags KeepFlags, bool bPerformFullPurge=true)
Definition GarbageCollection.cpp:6203
COREUOBJECT_API UObject * StaticFindFirstObject(UClass *Class, FStringView Name, EFindFirstObjectOptions Options=EFindFirstObjectOptions::None, ELogVerbosity::Type AmbiguousMessageVerbosity=ELogVerbosity::NoLogging, const TCHAR *InCurrentOperation=nullptr)
Definition UObjectGlobals.cpp:669
COREUOBJECT_API bool HasUniversallyUniqueObjectNameIdentifier(FName Name)
Definition UObjectGlobals.cpp:2987
COREUOBJECT_API bool StaticFindAllObjectsFast(TArray< UObject * > &OutFoundObjects, UClass *ObjectClass, FName ObjectName, EFindObjectFlags Flags=EFindObjectFlags::None, EObjectFlags ExclusiveFlags=RF_NoFlags, EInternalObjectFlags ExclusiveInternalFlags=EInternalObjectFlags::None)
Definition UObjectGlobals.cpp:609
COREUOBJECT_API void GatherUnreachableObjects(bool bForceSingleThreaded)
Definition GarbageCollection.cpp:5333
COREUOBJECT_API UObject * StaticAllocateObject(const UClass *Class, UObject *InOuter, FName Name, EObjectFlags SetFlags, EInternalObjectFlags InternalSetFlags=EInternalObjectFlags::None, bool bCanReuseSubobjects=false, bool *bOutReusedSubobject=nullptr, UPackage *ExternalPackage=nullptr, int32 SerialNumber=0, FRemoteObjectId RemoteId=FRemoteObjectId(), class FGCReconstructionGuard *GCGuard=nullptr)
Definition UObjectGlobals.cpp:3576
COREUOBJECT_API FName MakeUniversallyUniqueObjectName(UObject *Outer, FName InBaseName=NAME_None, FUniversallyUniqueObjectNameGenerator const *Generator=nullptr)
Definition UObjectGlobals.cpp:2952
COREUOBJECT_API UObject * StaticFindObjectChecked(UClass *Class, UObject *InOuter, FStringView Name, EFindObjectFlags Flags=EFindObjectFlags::None)
Definition UObjectGlobals.cpp:581
COREUOBJECT_API EAsyncPackageState::Type ProcessAsyncLoadingUntilComplete(TFunctionRef< bool()> CompletionPredicate, double TimeLimit)
Definition AsyncPackageLoader.cpp:358
COREUOBJECT_API FString ResolveIniObjectsReference(const FString &ObjectReference, const FString *IniFilename=nullptr, bool bThrow=false)
Definition UObjectGlobals.cpp:1073
COREUOBJECT_API bool UnhashUnreachableObjects(bool bUseTimeLimit, double TimeLimit=0.0)
Definition GarbageCollection.cpp:6095
COREUOBJECT_API UObject * StaticDuplicateObjectEx(FObjectDuplicationParameters &Parameters)
Definition UObjectGlobals.cpp:3119
bool ContainsObjectOfClass(const TArray< T * > &ObjectArray, UClass *ClassToCheck, EFindObjectFlags Flags=EFindObjectFlags::None, TArray< T * > *out_Objects=nullptr)
Definition UObjectGlobals.h:2199
COREUOBJECT_API bool StaticFindAllObjectsSafe(TArray< UObject * > &OutFoundObjects, UClass *Class, const TCHAR *Name, EFindObjectFlags Flags=EFindObjectFlags::None)
Definition UObjectGlobals.cpp:659
T * FindObjectSafe(UObject *Outer, FStringView Name, EFindObjectFlags Flags=EFindObjectFlags::None)
Definition UObjectGlobals.h:2083
T * FindObject(UObject *Outer, FStringView Name, EFindObjectFlags Flags=EFindObjectFlags::None)
Definition UObjectGlobals.h:2035
T * LoadObject(UObject *Outer, FStringView Name, FStringView Filename={}, uint32 LoadFlags=LOAD_None, UPackageMap *Sandbox=nullptr, const FLinkerInstancingContext *InstancingContext=nullptr)
Definition UObjectGlobals.h:2135
EParseObjectLoadingPolicy
Definition UObjectGlobals.h:537
COREUOBJECT_API void CancelAsyncLoading()
Definition AsyncPackageLoader.cpp:716
T * DuplicateObject(T const *SourceObject, UObject *Outer, const FName Name=NAME_None)
Definition UObjectGlobals.h:1977
T * FindFirstObjectSafe(FStringView Name, EFindFirstObjectOptions Options=EFindFirstObjectOptions::None, ELogVerbosity::Type AmbiguousMessageVerbosity=ELogVerbosity::NoLogging, const TCHAR *CurrentOperation=nullptr)
Definition UObjectGlobals.h:2125
COREUOBJECT_API int32 UpdateSuffixForNextNewObject(UObject *Parent, const UClass *Class, TFunctionRef< void(int32 &)> IndexMutator)
Definition UObjectGlobals.cpp:441
COREUOBJECT_API int32 LoadAssetAsync(FTopLevelAssetPath InAssetPath, FLoadAssetAsyncDelegate InCompletionDelegate, FLoadAssetAsyncOptionalParams InOptionalParams=FLoadAssetAsyncOptionalParams())
Definition UObjectGlobals.cpp:1467
EFindFirstObjectOptions
Definition UObjectGlobals.h:496
COREUOBJECT_API UPackage * FindPackage(UObject *InOuter, const TCHAR *PackageName)
Definition UObjectGlobals.cpp:924
COREUOBJECT_API UObject * GetTransientPackageAsObject()
Definition Obj.cpp:5824
COREUOBJECT_API bool IsIncrementalReachabilityAnalysisPending()
Definition GarbageCollection.cpp:6029
COREUOBJECT_API UObject * StaticFindFirstObjectSafe(UClass *Class, FStringView Name, EFindFirstObjectOptions Options=EFindFirstObjectOptions::None, ELogVerbosity::Type AmbiguousMessageVerbosity=ELogVerbosity::NoLogging, const TCHAR *InCurrentOperation=nullptr)
Definition UObjectGlobals.cpp:779
COREUOBJECT_API int32 GAllowCookedDataInEditorBuilds
Definition LinkerLoad.cpp:171
ECompiledInUObjectsRegisteredStatus
Definition UObjectGlobals.h:3231
int32 TAsyncLoadPriority
Definition UObjectGlobals.h:726
COREUOBJECT_API UObject * StaticLoadObject(UClass *Class, UObject *InOuter, FStringView Name, FStringView Filename={}, uint32 LoadFlags=LOAD_None, UPackageMap *Sandbox=nullptr, bool bAllowObjectReconciliation=true, const FLinkerInstancingContext *InstancingContext=nullptr)
Definition UObjectGlobals.cpp:1407
COREUOBJECT_API void EndLoad(FUObjectSerializeContext *LoadContext)
Definition UObjectGlobals.cpp:2427
COREUOBJECT_API FString GetConfigFilename(UObject *SourceObject)
Definition Obj.cpp:2276
bool StaticAllocateObjectErrorTests(const UClass *Class, UObject *InOuter, FName Name, EObjectFlags SetFlags)
void GlobalSetProperty(const TCHAR *Value, UClass *Class, FProperty *Property, bool bNotifyObjectOfChange)
Definition UObjectGlobals.cpp:792
T * FindFirstObject(FStringView Name, EFindFirstObjectOptions Options=EFindFirstObjectOptions::None, ELogVerbosity::Type AmbiguousMessageVerbosity=ELogVerbosity::NoLogging, const TCHAR *CurrentOperation=nullptr)
Definition UObjectGlobals.h:2115
COREUOBJECT_API bool StaticFindAllObjects(TArray< UObject * > &OutFoundObjects, UClass *Class, const TCHAR *Name, EFindObjectFlags Flags=EFindObjectFlags::None)
Definition UObjectGlobals.cpp:630
COREUOBJECT_API UObject * StaticFindObjectFastSafe(UClass *Class, UObject *InOuter, FName InName, EFindObjectFlags Flags=EFindObjectFlags::None, EObjectFlags ExclusiveFlags=RF_NoFlags, EInternalObjectFlags ExclusiveInternalFlags=EInternalObjectFlags::None)
Definition UObjectGlobals.cpp:466
#define UE_REFERENCE_COLLECTOR_REQUIRE_OBJECTPTR_DEPRECATED(...)
Definition UObjectGlobals.h:107
COREUOBJECT_API bool StaticExec(UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar=*GLog)
Definition Obj.cpp:4571
COREUOBJECT_API UObject * DuplicateObject_Internal(UClass *Class, const UObject *SourceObject, UObject *Outer, const FName NAME_None)
Definition UObjectGlobals.cpp:4902
COREUOBJECT_API bool SafeLoadError(UObject *Outer, uint32 LoadFlags, const TCHAR *ErrorMessage)
Definition UObjectGlobals.cpp:903
COREUOBJECT_API const FString * GetIniFilenameFromObjectsReference(const FString &ObjectsReferenceString)
Definition UObjectGlobals.cpp:1109
COREUOBJECT_API FObjectDuplicationParameters InitStaticDuplicateObjectParams(UObject const *SourceObject, UObject *DestOuter, const FName DestName=NAME_None, EObjectFlags FlagMask=RF_AllFlags, UClass *DestClass=nullptr, EDuplicateMode::Type DuplicateMode=EDuplicateMode::Normal, EInternalObjectFlags InternalFlagsMask=EInternalObjectFlags_AllFlags)
Definition UObjectGlobals.cpp:3075
EAsyncLoadingProgress
Definition UObjectGlobals.h:712
COREUOBJECT_API bool GIsSavingPackage
Definition SavePackageUtilities.cpp:178
COREUOBJECT_API UObject * StaticDuplicateObject(UObject const *SourceObject, UObject *DestOuter, const FName DestName=NAME_None, EObjectFlags FlagMask=RF_AllFlags, UClass *DestClass=nullptr, EDuplicateMode::Type DuplicateMode=EDuplicateMode::Normal, EInternalObjectFlags InternalFlagsMask=EInternalObjectFlags_AllFlags)
Definition UObjectGlobals.cpp:3113
COREUOBJECT_API bool IsReferenced(UObject *&Res, EObjectFlags KeepFlags, EInternalObjectFlags InternalKeepFlags, bool bCheckSubObjects=false, FReferencerInformationList *FoundReferences=nullptr)
Definition UObjectGlobals.cpp:5853
void(* SetterFuncPtr)(void *InContainer, const void *InValue)
Definition UObjectGlobals.h:3594
COREUOBJECT_API void FlushAsyncLoading(int32 PackageID=INDEX_NONE)
Definition AsyncPackageLoader.cpp:313
COREUOBJECT_API UObject * StaticFindObject(UClass *Class, UObject *InOuter, FStringView Name, EFindObjectFlags Flags=EFindObjectFlags::None)
Definition UObjectGlobals.cpp:512
COREUOBJECT_API int32 LoadPackageAsync(const FPackagePath &InPackagePath, FLoadPackageAsyncOptionalParams InOptionalParams)
Definition AsyncPackageLoader.cpp:651
COREUOBJECT_API bool UsesPerObjectConfig(UObject *SourceObject)
Definition Obj.cpp:2267
COREUOBJECT_API int32 GCreateGCClusters
Definition UObjectClusters.cpp:26
COREUOBJECT_API bool ParseObject(const TCHAR *Stream, const TCHAR *Match, UClass *Class, UObject *&DestRes, UObject *InParent, EParseObjectLoadingPolicy LoadingPolicy, bool *bInvalidObject=nullptr)
Definition UObjectGlobals.cpp:1248
COREUOBJECT_API UScriptStruct * GetFallbackStruct()
Definition UObjectGlobals.cpp:5943
COREUOBJECT_API bool ResolveName(UObject *&Outer, FString &ObjectsReferenceString, bool Create, bool Throw, uint32 LoadFlags=LOAD_None, const FLinkerInstancingContext *InstancingContext=nullptr)
Definition UObjectGlobals.cpp:1239
COREUOBJECT_API EDataValidationResult CombineDataValidationResults(EDataValidationResult Result1, EDataValidationResult Result2)
Definition DataValidation.cpp:11
COREUOBJECT_API FName MakeUniqueObjectName(UObject *Outer, const UClass *Class, FName BaseName=NAME_None, EUniqueObjectNameOptions Options=EUniqueObjectNameOptions::None)
Definition UObjectGlobals.cpp:2811
COREUOBJECT_API int32 GAllowUnversionedContentInEditor
Definition UObjectGlobals.cpp:101
EUniqueObjectNameOptions
Definition UObjectGlobals.h:1005
COREUOBJECT_API UObject * StaticLoadAsset(UClass *Class, FTopLevelAssetPath InPath, uint32 LoadFlags=LOAD_None, const FLinkerInstancingContext *InstancingContext=nullptr)
Definition UObjectGlobals.cpp:1458
COREUOBJECT_API UPackage * GetTransientPackage()
Definition Obj.cpp:5819
COREUOBJECT_API TArray< const TCHAR * > ParsePropertyFlags(EPropertyFlags Flags)
Definition Obj.cpp:4487
COREUOBJECT_API UPackage * CreatePackage(const TCHAR *PackageName)
Definition UObjectGlobals.cpp:1002
COREUOBJECT_API void StaticTick(float DeltaTime, bool bUseFullTimeLimit=true, float AsyncLoadingTime=0.005f)
Definition UObjectGlobals.cpp:839
UClass * LoadClass(UObject *Outer, FStringView Name, FStringView Filename={}, uint32 LoadFlags=LOAD_None, UPackageMap *Sandbox=nullptr)
Definition UObjectGlobals.h:2145
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint32 Offset
Definition VulkanMemory.cpp:4033
UEBinkAudioDecodeInterface * Interface
Definition binka_ue_decode_test.cpp:24
uint8_t uint8
Definition binka_ue_file_header.h:8
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition ArchiveUObject.h:17
friend FArchive & operator<<(FArchive &Ar, ANSICHAR &Value)
Definition Archive.h:1387
Definition Archive.h:1208
virtual void SetSerializedProperty(FProperty *InProperty)
Definition Archive.h:738
Definition CompactBinaryWriter.h:68
Definition IDelegateInstance.h:14
Definition UnrealType.h:6738
Definition Field.h:66
Definition Field.h:556
Definition GCObject.h:128
Definition UObjectGlobals.cpp:3494
Definition FastReferenceCollector.h:68
Definition LinkerInstancingContext.h:99
Definition UObjectGlobals.h:753
static constexpr uint32 BuildMask(auto... Types)
Definition UObjectGlobals.h:767
static constexpr uint32 BuildMask(EAsyncLoadingProgress Progress)
Definition UObjectGlobals.h:762
void Invoke(FLoadPackageAsyncProgressParams &Params)
Definition UObjectGlobals.h:772
FLoadPackageAsyncProgressDelegate(DelegateType &&InDelegate, uint32 InMask=MAX_uint32)
Definition UObjectGlobals.h:757
Definition NameTypes.h:617
Definition UnrealTemplate.h:321
Definition UObjectGlobals.h:1292
UE_FORCEINLINE_HINT void AddPropertyPostInitCallback(TFunction< void()> &&Callback)
Definition UObjectGlobals.h:1345
const FObjectInitializer & SetNestedDefaultSubobjectClass(FStringView SubobjectName, const UClass *Class) const
Definition UObjectGlobals.h:1470
COREUOBJECT_API ~FObjectInitializer()
Definition UObjectGlobals.cpp:4131
TReturnType * CreateDefaultSubobject(UObject *Outer, FName SubobjectName, bool bTransient=false) const
Definition UObjectGlobals.h:1393
friend void InternalConstructor(const class FObjectInitializer &X)
TReturnType * CreateOptionalDefaultSubobject(UObject *Outer, FName SubobjectName, bool bTransient=false) const
Definition UObjectGlobals.h:1378
const FObjectInitializer & SetDefaultSubobjectClass(FName SubobjectName, const UClass *Class) const
Definition UObjectGlobals.h:1437
static COREUOBJECT_API FObjectInitializer & Get()
Definition UObjectGlobals.cpp:5001
COREUOBJECT_API UClass * GetClass() const
Definition UObjectGlobals.cpp:4558
UE_FORCEINLINE_HINT struct FObjectInstancingGraph * GetInstancingGraph()
Definition UObjectGlobals.h:1340
const FObjectInitializer & SetNestedDefaultSubobjectClass(TArrayView< const FName > SubobjectNames, const UClass *Class) const
Definition UObjectGlobals.h:1482
const FObjectInitializer & SetDefaultSubobjectClass(FName SubobjectName) const
Definition UObjectGlobals.h:1449
const FObjectInitializer & DoNotCreateDefaultSubobject(FName SubobjectName) const
Definition UObjectGlobals.h:1458
TReturnType * CreateDefaultSubobject(UObject *Outer, FName SubobjectName, bool bTransient=false) const
Definition UObjectGlobals.h:1363
UE_FORCEINLINE_HINT UObject * GetArchetype() const
Definition UObjectGlobals.h:1327
UE_FORCEINLINE_HINT void FinalizeSubobjectClassInitialization()
Definition UObjectGlobals.h:1536
UE_FORCEINLINE_HINT UObject * GetObj() const
Definition UObjectGlobals.h:1335
const FObjectInitializer & DoNotCreateNestedDefaultSubobject(FStringView SubobjectName) const
Definition UObjectGlobals.h:1513
TReturnType * CreateEditorOnlyDefaultSubobject(UObject *Outer, FName SubobjectName, bool bTransient=false) const
Definition UObjectGlobals.h:1406
COREUOBJECT_API FObjectInitializer()
Definition UObjectGlobals.cpp:4030
const FObjectInitializer & SetNestedDefaultSubobjectClass(FStringView SubobjectName) const
Definition UObjectGlobals.h:1494
const FObjectInitializer & DoNotCreateNestedDefaultSubobject(TArrayView< const FName > SubobjectNames) const
Definition UObjectGlobals.h:1524
const FObjectInitializer & SetNestedDefaultSubobjectClass(TArrayView< const FName > SubobjectNames) const
Definition UObjectGlobals.h:1504
static COREUOBJECT_API void AssertIfInConstructor(UObject *Outer, const TCHAR *ErrorMessage)
Definition UObjectGlobals.cpp:4995
Definition ObjectSaveContext.h:244
Definition OutputDevice.h:133
Definition PackagePath.h:89
Definition PackageReload.h:67
Definition UnrealType.h:174
Definition UObjectGlobals.h:2420
const UObject * GetSerializedDataContainer() const
Definition UObjectGlobals.h:2450
UE_FORCEINLINE_HINT class FReferenceCollector & GetCollector()
Definition UObjectGlobals.h:2429
void SetSerializingObject(const UObject *InSerializingObject)
Definition UObjectGlobals.h:2438
void SetSerializedDataContainer(const UObject *InDataContainer)
Definition UObjectGlobals.h:2446
const UObject * GetSerializingObject() const
Definition UObjectGlobals.h:2442
Definition UObjectGlobals.h:2492
virtual bool IsIgnoringTransient() const =0
COREUOBJECT_API void AddPropertyReferencesLimitedToObjectProperties(const UStruct *Struct, void *Instance, const UObject *ReferencingObject=nullptr)
Definition UObjectGlobals.cpp:5640
virtual bool IsProcessingNativeReferences() const
Definition UObjectGlobals.h:2940
void AddReferencedObjects(TMapBase< KeyType, TObjectPtr< ValueType >, Allocator, KeyFuncs > &Map, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:2821
void AddReferencedObjects(TSet< TObjectPtr< UObjectType > > &ObjectSet, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:2785
void AddReferencedObject(TObjectPtr< const UObjectType > &Object, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:2712
UE_FORCEINLINE_HINT void AddStableReference(TObjectPtr< UObjectType > *Object)
Definition UObjectGlobals.h:2573
virtual void HandleObjectReference(UObject *&InObject, const UObject *InReferencingObject, const FProperty *InReferencingProperty)=0
virtual COREUOBJECT_API ~FReferenceCollector()
UE_FORCEINLINE_HINT void AddStableReferenceSet(TSet< TObjectPtr< UObjectType > > *Objects)
Definition UObjectGlobals.h:2585
void AddReferencedObjects(TMapBase< TObjectPtr< KeyType >, ValueType, Allocator, KeyFuncs > &Map, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:2806
COREUOBJECT_API void AddPropertyReferencesWithStructARO(const UScriptStruct *Struct, void *Instance, const UObject *ReferencingObject=nullptr)
Definition UObjectGlobals.cpp:5630
void AddReferencedObject(TWeakObjectPtr< T > &P, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:2856
virtual bool IsIgnoringArchetypeRef() const =0
virtual COREUOBJECT_API void AddStableReferenceArray(TArray< TObjectPtr< UObject > > *Objects)
Definition UObjectGlobals.cpp:5201
virtual void HandleObjectReferences(UObject **InObjects, const int32 ObjectNum, const UObject *InReferencingObject, const FProperty *InReferencingProperty)
Definition UObjectGlobals.h:3092
void AddReferencedObjects(TArray< TObjectPtr< UObjectType > > &ObjectArray, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:2751
virtual bool MarkWeakObjectReferenceForClearing(UObject **WeakReference, UObject *ReferenceOwner)
Definition UObjectGlobals.h:2932
UE_FORCEINLINE_HINT void AddStableReferenceArray(TArray< TObjectPtr< UObjectType > > *Objects)
Definition UObjectGlobals.h:2579
virtual void AllowEliminatingReferences(bool bAllow)
Definition UObjectGlobals.h:2917
FReferenceCollectorArchive & GetVerySlowReferenceCollectorArchive()
Definition UObjectGlobals.h:2950
virtual bool NeedsPropertyReferencer() const
Definition UObjectGlobals.h:2904
virtual void SetSerializedProperty(class FProperty *Inproperty)
Definition UObjectGlobals.h:2923
virtual void SetIsProcessingNativeReferences(bool bIsNative)
Definition UObjectGlobals.h:2936
virtual bool NeedsInitialReferences() const
Definition UObjectGlobals.h:2943
void AddReferencedObjects(TMapBase< TObjectPtr< KeyType >, TObjectPtr< ValueType >, Allocator, KeyFuncs > &Map, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:2836
COREUOBJECT_API void AddPropertyReferences(const UStruct *Struct, void *Instance, const UObject *ReferencingObject=nullptr)
Definition UObjectGlobals.cpp:5625
void AddReferencedObject(UObjectType *&Object, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:2599
void AddReferencedObjects(TArray< TObjectPtr< const UObjectType > > &ObjectArray, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:2768
void AddStableReferenceMap(TMapBase< KeyType, ValueType, Allocator, KeyFuncs > &Map)
Definition UObjectGlobals.h:2506
virtual COREUOBJECT_API void AddStableReference(TObjectPtr< UObject > *Object)
Definition UObjectGlobals.cpp:5196
void AddReferencedObjects(TArray< UObjectType * > &ObjectArray, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:2627
virtual COREUOBJECT_API void AddStableReferenceSet(TSet< TObjectPtr< UObject > > *Objects)
Definition UObjectGlobals.cpp:5206
virtual class FProperty * GetSerializedProperty() const
Definition UObjectGlobals.h:2927
void AddReferencedObject(TObjectPtr< UObjectType > &Object, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:2696
Definition UObjectGlobals.h:3142
bool bRequireDirectOuter
Definition UObjectGlobals.h:3192
COREUOBJECT_API ~FReferenceFinder()
virtual COREUOBJECT_API void FindReferences(UObject *Object, UObject *ReferencingObject=nullptr, FProperty *ReferencingProperty=nullptr)
Definition GarbageCollection.cpp:3889
TArray< UObject * > & ObjectArray
Definition UObjectGlobals.h:3184
virtual bool IsIgnoringTransient() const override
Definition UObjectGlobals.h:3172
TSet< const UObject * > ObjectSet
Definition UObjectGlobals.h:3186
bool bSerializeRecursively
Definition UObjectGlobals.h:3196
bool bShouldIgnoreTransient
Definition UObjectGlobals.h:3198
virtual bool IsIgnoringArchetypeRef() const override
Definition UObjectGlobals.h:3171
class FProperty * SerializedProperty
Definition UObjectGlobals.h:3190
virtual class FProperty * GetSerializedProperty() const override
Definition UObjectGlobals.h:3177
virtual COREUOBJECT_API void HandleObjectReference(UObject *&Object, const UObject *ReferencingObject, const FProperty *InReferencingProperty) override
Definition GarbageCollection.cpp:3900
virtual void SetSerializedProperty(class FProperty *Inproperty) override
Definition UObjectGlobals.h:3173
bool bShouldIgnoreArchetype
Definition UObjectGlobals.h:3194
UObject * LimitOuter
Definition UObjectGlobals.h:3188
Definition UObjectGlobals.h:2239
FScopedObjectFlagMarker()
Definition UObjectGlobals.h:2272
~FScopedObjectFlagMarker()
Definition UObjectGlobals.h:2278
Definition UObjectGlobals.h:1820
static void InitProperties(const FObjectInitializer &ObjectInitializer, UObject *Obj, UClass *DefaultsClass, UObject *DefaultData)
Definition UObjectGlobals.h:1830
static void PostConstructInitObject(FObjectInitializer &ObjectInitializer)
Definition UObjectGlobals.h:1863
static void InstanceSubobjects(const FObjectInitializer &ObjectInitializer, UClass *Class, bool bNeedInstancing, bool bNeedSubobjectInstancing)
Definition UObjectGlobals.h:1852
static bool InitSubobjectProperties(const FObjectInitializer &ObjectInitializer)
Definition UObjectGlobals.h:1840
Definition Class.h:412
Definition Text.h:385
Definition TransactionObjectEvent.h:181
Definition ObjectMacros.h:180
Definition UObjectGlobals.h:2461
FReferenceCollectorArchive & GetArchive()
Definition UObjectGlobals.h:2484
FVerySlowReferenceCollectorArchiveScope(FReferenceCollectorArchive &InArchive, const UObject *InSerializingObject, FProperty *InSerializedProperty=nullptr, const UObject *InSerializedDataContainer=nullptr)
Definition UObjectGlobals.h:2468
~FVerySlowReferenceCollectorArchiveScope()
Definition UObjectGlobals.h:2478
Definition ArrayView.h:139
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void RemoveAt(SizeType Index, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2083
UE_NODEBUG UE_FORCEINLINE_HINT ElementType * GetData() UE_LIFETIMEBOUND
Definition Array.h:1027
SizeType RemoveSwap(const ElementType &Item, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:3244
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
Definition DelegateSignatureImpl.inl:310
Definition AssetRegistryState.h:50
Definition AndroidPlatformMisc.h:14
Definition UnrealString.h.inl:34
Definition DelegateSignatureImpl.inl:1029
Definition UObjectGlobals.h:2291
bool Advance()
Definition UObjectGlobals.h:2389
TObjectClass & operator*() const
Definition UObjectGlobals.h:2344
UE_FORCEINLINE_HINT void RemoveCurrent()
Definition UObjectGlobals.h:2363
UE_FORCEINLINE_HINT void operator++()
Definition UObjectGlobals.h:2325
TObjectClass * operator->() const
Definition UObjectGlobals.h:2353
UE_FORCEINLINE_HINT bool operator!() const
Definition UObjectGlobals.h:2335
TObjectArrayIterator(TArray< TObjectClass * > &InArray, UClass *InClassToCheck=nullptr, EFindObjectFlags InFlags=EFindObjectFlags::None)
Definition UObjectGlobals.h:2308
UE_FORCEINLINE_HINT void RemoveCurrentSwap()
Definition UObjectGlobals.h:2371
UE_FORCEINLINE_HINT TObjectClass * GetObject() const
Definition UObjectGlobals.h:2381
Definition SharedPointer.h:692
Definition UniquePtr.h:107
Definition Class.h:3793
Definition UObjectGlobals.h:3476
FAssetLog(const TCHAR *InPath UE_LIFETIMEBOUND)
Definition UObjectGlobals.h:3478
friend void SerializeForLog(FCbWriter &Writer, const FAssetLog &AssetLog)
Definition UObjectGlobals.h:3482
FAssetLog(const UObject *InObject UE_LIFETIMEBOUND)
Definition UObjectGlobals.h:3480
FAssetLog(const FPackagePath &InPath UE_LIFETIMEBOUND)
Definition UObjectGlobals.h:3479
Definition Class.h:2791
Definition Class.h:181
Definition Class.h:2476
Definition UObjectBase.h:59
Definition Object.h:95
Definition CoreNet.h:191
Definition Package.h:216
Definition Class.h:1720
Definition Class.h:480
Definition World.h:918
Definition UObjectGlobals.h:692
Type
Definition UObjectGlobals.h:694
@ Canceled
Definition UObjectGlobals.h:706
@ FailedNotInstalled
Definition UObjectGlobals.h:702
@ Succeeded
Definition UObjectGlobals.h:704
@ FailedLinker
Definition UObjectGlobals.h:700
@ FailedMissing
Definition UObjectGlobals.h:698
@ Failed
Definition UObjectGlobals.h:696
Definition UObjectGlobals.h:1139
Type
Definition UObjectGlobals.h:1141
@ TimeOut
Definition UObjectGlobals.h:1143
@ Complete
Definition UObjectGlobals.h:1147
@ PendingImports
Definition UObjectGlobals.h:1145
Definition UObjectGlobals.h:126
Type
Definition UObjectGlobals.h:128
@ Normal
Definition UObjectGlobals.h:130
@ PIE
Definition UObjectGlobals.h:134
@ World
Definition UObjectGlobals.h:132
Type
Definition LogVerbosity.h:17
@ NoLogging
Definition LogVerbosity.h:19
Definition FieldSystemNoiseAlgo.cpp:6
Definition UObjectConstructInternal.h:15
Definition Class.h:1127
Definition Class.h:1127
implementation
Definition PlayInEditorLoadingScope.h:8
Definition RemoteObjectSerialization.cpp:55
Definition PackageHarvester.cpp:207
Definition AdvancedWidgetsModule.cpp:13
bool IsSavingPackage(UObject *InOuter)
Definition SavePackageUtilities.cpp:182
U16 Index
Definition radfft.cpp:71
Definition UObjectGlobals.h:3509
static COREUOBJECT_API FString GetAssetLogString(const TCHAR *Path, const FString &Message)
Definition UObjectGlobals.cpp:6260
static COREUOBJECT_API FString FormatPathForAssetLog(const TCHAR *Path)
Definition UObjectGlobals.cpp:6189
Definition Class.h:3741
Definition UObjectGlobals.h:3250
static COREUOBJECT_API FIsPackageOKToSaveDelegate IsPackageOKToSaveDelegate
Definition UObjectGlobals.h:3356
static COREUOBJECT_API FOnPackageReloaded OnPackageReloaded
Definition UObjectGlobals.h:3348
DECLARE_DELEGATE_OneParam(FNetworkFileRequestPackageReload, const TArray< FString > &)
DECLARE_DELEGATE_RetVal_OneParam(FPrimaryAssetId, FGetPrimaryAssetIdForObject, const UObject *)
static COREUOBJECT_API FSimpleMulticastDelegate & GetPostPurgeGarbageDelegate()
Definition UObjectGlobals.cpp:230
static COREUOBJECT_API FNetworkFileRequestPackageReload NetworkFileRequestPackageReload
Definition UObjectGlobals.h:3352
DECLARE_MULTICAST_DELEGATE_TwoParams(FOnPackageReloaded, EPackageReloadPhase, FPackageReloadedEvent *)
DECLARE_MULTICAST_DELEGATE_OneParam(FReloadCompleteDelegate, EReloadCompleteReason)
DECLARE_DELEGATE_RetVal_OneParam(bool, FOnLoadObjectsOnTop, const FString &)
DECLARE_DELEGATE_RetVal_TwoParams(bool, FShouldCookPackageForPlatform, const UPackage *, const ITargetPlatform *)
static COREUOBJECT_API FSimpleMulticastDelegate & GetPreGarbageCollectDelegate()
Definition UObjectGlobals.cpp:212
static COREUOBJECT_API TMulticastDelegate< void()> ReinstanceHotReloadedClassesDelegate
Definition UObjectGlobals.h:3376
DECLARE_MULTICAST_DELEGATE(FReloadReinstancingCompleteDelegate)
static COREUOBJECT_API FCompiledInUObjectsRemovedDelegate CompiledInUObjectsRemovedDelegate
Definition UObjectGlobals.h:3390
DECLARE_MULTICAST_DELEGATE_OneParam(FOnReportGarbageReferencers, TConstArrayView< struct FGarbageReferenceInfo >)
static COREUOBJECT_API FSimpleMulticastDelegate & GetGarbageCollectStartedDelegate()
Definition UObjectGlobals.cpp:218
static COREUOBJECT_API FShouldCookPackageForPlatform ShouldCookPackageForPlatform
Definition UObjectGlobals.h:3454
static COREUOBJECT_API FPackageCreatedForLoad PackageCreatedForLoad
Definition UObjectGlobals.h:3446
DECLARE_MULTICAST_DELEGATE_OneParam(FReloadAddedClassesDelegate, const TArray< UClass * > &)
static COREUOBJECT_API FOnLoadObjectsOnTop ShouldLoadOnTop
Definition UObjectGlobals.h:3442
static COREUOBJECT_API FSimpleMulticastDelegate PostReachabilityAnalysis
Definition UObjectGlobals.h:3417
static COREUOBJECT_API FPreLoadMapDelegate PreLoadMap
Definition UObjectGlobals.h:3394
static COREUOBJECT_API FReloadCompleteDelegate ReloadCompleteDelegate
Definition UObjectGlobals.h:3368
static COREUOBJECT_API FOnPostInitSparseClassData OnPostInitSparseClassData
Definition UObjectGlobals.h:3344
DECLARE_DELEGATE_RetVal_ThreeParams(bool, FIsPackageOKToSaveDelegate, UPackage *, const FString &, FOutputDevice *)
static COREUOBJECT_API FGetPrimaryAssetIdForObject GetPrimaryAssetIdForObject
Definition UObjectGlobals.h:3450
static COREUOBJECT_API FCompiledInUObjectsRegisteredDelegate CompiledInUObjectsRegisteredDelegate
Definition UObjectGlobals.h:3386
static COREUOBJECT_API FSimpleMulticastDelegate & GetPostGarbageCollect()
Definition UObjectGlobals.cpp:224
static COREUOBJECT_API FOnReportGarbageReferencers & GetGarbageCollectReportGarbageReferencers()
Definition UObjectGlobals.cpp:237
static COREUOBJECT_API FSimpleMulticastDelegate PostDemoPlay
Definition UObjectGlobals.h:3405
static COREUOBJECT_API FSimpleMulticastDelegate GarbageCollectComplete
Definition UObjectGlobals.h:3438
DECLARE_MULTICAST_DELEGATE_ThreeParams(FOnPostInitSparseClassData, UClass *, UScriptStruct *, void *)
static COREUOBJECT_API FPreLoadMapWithContextDelegate PreLoadMapWithContext
Definition UObjectGlobals.h:3398
static COREUOBJECT_API TMulticastDelegate< void(UClass *OldClass, UClass *NewClass, EHotReloadedClassFlags Flags)> RegisterClassForHotReloadReinstancingDelegate
Definition UObjectGlobals.h:3372
static COREUOBJECT_API FSimpleMulticastDelegate PostGarbageCollectConditionalBeginDestroy
Definition UObjectGlobals.h:3435
static COREUOBJECT_API FReloadReinstancingCompleteDelegate ReloadReinstancingCompleteDelegate
Definition UObjectGlobals.h:3364
static COREUOBJECT_API FSimpleMulticastDelegate PreGarbageCollectConditionalBeginDestroy
Definition UObjectGlobals.h:3432
DECLARE_MULTICAST_DELEGATE_OneParam(FPackageCreatedForLoad, class UPackage *)
static COREUOBJECT_API FReloadAddedClassesDelegate ReloadAddedClassesDelegate
Definition UObjectGlobals.h:3360
static COREUOBJECT_API FPostLoadMapDelegate PostLoadMapWithWorld
Definition UObjectGlobals.h:3402
Definition Class.h:3654
Definition UnrealType.h:6698
Definition UObjectGlobals.h:3224
TConstArrayView< UPackage * > LoadedPackages
Definition UObjectGlobals.h:3225
bool bSynchronous
Definition UObjectGlobals.h:3227
int32 RecursiveDepth
Definition UObjectGlobals.h:3226
Definition Stack.h:114
Definition Guid.h:109
Definition UObjectGlobals.h:789
uint32 LoadFlags
Definition UObjectGlobals.h:805
int32 PIEInstanceID
Definition UObjectGlobals.h:799
int32 PackagePriority
Definition UObjectGlobals.h:801
const FLinkerInstancingContext * InstancingContext
Definition UObjectGlobals.h:803
FName CustomPackageName
Definition UObjectGlobals.h:791
EPackageFlags PackageFlags
Definition UObjectGlobals.h:797
TUniquePtr< FLoadPackageAsyncDelegate > CompletionDelegate
Definition UObjectGlobals.h:793
TSharedPtr< FLoadPackageAsyncProgressDelegate > ProgressDelegate
Definition UObjectGlobals.h:795
Definition UObjectGlobals.h:147
FName DestName
Definition UObjectGlobals.h:161
UObject * DestOuter
Definition UObjectGlobals.h:156
bool bAssignExternalPackages
Definition UObjectGlobals.h:198
UClass * DestClass
Definition UObjectGlobals.h:210
EObjectFlags ApplyFlags
Definition UObjectGlobals.h:178
EDuplicateMode::Type DuplicateMode
Definition UObjectGlobals.h:192
TMap< UObject *, UObject * > * CreatedObjects
Definition UObjectGlobals.h:226
uint32 PortFlags
Definition UObjectGlobals.h:190
EInternalObjectFlags ApplyInternalFlags
Definition UObjectGlobals.h:185
bool bSkipPostLoad
Definition UObjectGlobals.h:204
EObjectFlags FlagMask
Definition UObjectGlobals.h:166
UObject * SourceObject
Definition UObjectGlobals.h:151
TMap< UObject *, UObject * > DuplicationSeed
Definition UObjectGlobals.h:219
EInternalObjectFlags InternalFlagMask
Definition UObjectGlobals.h:171
Definition UObjectGlobals.h:1609
const UClass * Class
Definition UObjectGlobals.h:1610
FOverrides * SubOverrides
Definition UObjectGlobals.h:1611
UObject * Subobject
Definition UObjectGlobals.h:1679
FSubobjectInit(UObject *InSubobject, UObject *InTemplate)
Definition UObjectGlobals.h:1681
UObject * Template
Definition UObjectGlobals.h:1680
Definition Class.h:4941
Definition ObjectPtr.h:55
Definition PrimaryAssetId.h:126
Definition UnrealType.h:7001
Definition UnrealType.h:6865
Definition UObjectGlobals.h:2961
static void AddReferencedObjects(FReferenceCollector &Coll, TArray< const UObjectType * > &ObjectArray, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:3003
static void AddReferencedObjects(FReferenceCollector &Coll, TSet< UObjectType * > &ObjectSet, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:3014
static void AddReferencedObjects(FReferenceCollector &Coll, TMapBase< KeyType *, ValueType *, Allocator, KeyFuncs > &Map, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:3056
static void AddReferencedObjects(FReferenceCollector &Coll, TArray< UObjectType * > &ObjectArray, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:2985
static void AddReferencedObject(FReferenceCollector &Coll, UObjectType *&Object, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:2963
static void AddReferencedObject(FReferenceCollector &Coll, const UObjectType *&Object, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:2973
static void AddReferencedObjects(FReferenceCollector &Coll, TMapBase< KeyType *, ValueType, Allocator, KeyFuncs > &Map, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:3028
static void AddReferencedObjects(FReferenceCollector &Coll, TMapBase< KeyType, ValueType *, Allocator, KeyFuncs > &Map, const UObject *ReferencingObject=nullptr, const FProperty *ReferencingProperty=nullptr)
Definition UObjectGlobals.h:3042
Definition ObjectMacros.h:723
Definition RemoteObjectTypes.h:212
Definition UObjectGlobals.h:1239
static bool IsDisallowedAbstractClass(const UClass *InClass, EObjectFlags InFlags)
Definition UObjectGlobals.cpp:3421
COREUOBJECT_API FScopedAllowAbstractClassAllocation()
Definition UObjectGlobals.cpp:3411
COREUOBJECT_API ~FScopedAllowAbstractClassAllocation()
Definition UObjectGlobals.cpp:3416
Definition UObjectGlobals.h:1758
UPackage * ExternalPackage
Definition UObjectGlobals.h:1790
UObject * Outer
Definition UObjectGlobals.h:1763
int32 SerialNumber
Definition UObjectGlobals.h:1796
FObjectInstancingGraph * InstanceGraph
Definition UObjectGlobals.h:1787
EInternalObjectFlags InternalSetFlags
Definition UObjectGlobals.h:1772
bool bAssumeTemplateIsArchetype
Definition UObjectGlobals.h:1778
TFunction< void()> PropertyInitCallback
Definition UObjectGlobals.h:1793
UObject * Template
Definition UObjectGlobals.h:1784
EObjectFlags SetFlags
Definition UObjectGlobals.h:1769
bool bCopyTransientsFromClassDefaults
Definition UObjectGlobals.h:1775
friend FObjectInitializer
Definition UObjectGlobals.h:1813
const UClass * Class
Definition UObjectGlobals.h:1760
FName Name
Definition UObjectGlobals.h:1766
Definition TopLevelAssetPath.h:38
Definition ObjectMacros.h:2059
Definition UObjectThreadContext.h:140
Definition UObjectGlobals.h:1046
std::atomic< uint32 > Seed
Definition UObjectGlobals.h:1051
TCHAR SessionIdBase36[14]
Definition UObjectGlobals.h:1050
COREUOBJECT_API uint32 GetNewValue() const
Definition UObjectGlobals.cpp:2940
Definition WeakObjectPtr.h:49
Definition Engine.h:334
Definition IsTObjectPtr.h:16
Definition ObjectPtr.h:488
Definition PointerIsConvertibleFromTo.h:60
Definition Tuple.h:652
Definition WeakObjectPtrTemplates.h:25
Definition UObjectGlobals.h:4248
void(* Pointer)(UObject *Context, FFrame &TheStack, RESULT_DECL)
Definition UObjectGlobals.h:4250
const UTF8CHAR * NameUTF8
Definition UObjectGlobals.h:4249