UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Object.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5/*=============================================================================
6 Object.h: Direct base class for all UE objects
7=============================================================================*/
8
9#include "UObject/Script.h"
16
17#include "Object.generated.h"
18
19struct FAssetData;
21namespace UE::AssetRegistry { class FAssetRegistryImpl; }
23namespace UE::Cook { class FCookEventContext; }
24namespace UE::Cook { enum class ECookEvent : uint32; }
25class FConfigCacheIni;
33class ITargetPlatform;
38struct FFrame;
42class UClass;
43
44namespace UE::Net
45{
46 class FFragmentRegistrationContext;
48 namespace Private
49 {
50 struct FNetHandleLegacyPushModelHelper;
51 }
52}
53
55
58{
66};
67
68#if WITH_EDITOR
71{
75 None = 0,
82};
83
85#endif // WITH_EDITOR
86
93UCLASS(Abstract, MinimalAPI, Config = Engine)
95{
97
98public:
100
103
110
113
116
117#if UE_WITH_CONSTINIT_UOBJECT
118 explicit consteval UObject(UE::CodeGen::ConstInit::FObjectParams InParams)
120 {
121 }
122#endif
123
125 COREUOBJECT_API UObject* CreateDefaultSubobject(FName SubobjectFName, UClass* ReturnType, UClass* ClassToCreateByDefault, bool bIsRequired, bool bIsTransient);
126
133 template<class TReturnType>
135 {
136 UClass* ReturnType = TReturnType::StaticClass();
137 return static_cast<TReturnType*>(CreateEditorOnlyDefaultSubobjectImpl(SubobjectName, ReturnType, bTransient));
138 }
139
146 template<class TReturnType>
148 {
149 UClass* ReturnType = TReturnType::StaticClass();
150 return static_cast<TReturnType*>(CreateDefaultSubobject(SubobjectName, ReturnType, ReturnType, /*bIsRequired =*/ true, bTransient));
151 }
152
160 template<class TReturnType, class TClassToConstructByDefault>
162 {
163 return static_cast<TReturnType*>(CreateDefaultSubobject(SubobjectName, TReturnType::StaticClass(), TClassToConstructByDefault::StaticClass(), /*bIsRequired =*/ true, bTransient));
164 }
165
173 template<class TReturnType>
175 {
176 UClass* ReturnType = TReturnType::StaticClass();
177 return static_cast<TReturnType*>(CreateDefaultSubobject(SubobjectName, ReturnType, ReturnType, /*bIsRequired =*/ false, bTransient));
178 }
179
188 template<class TReturnType, class TClassToConstructByDefault>
190 {
191 return static_cast<TReturnType*>(CreateDefaultSubobject(SubobjectName, TReturnType::StaticClass(), TClassToConstructByDefault::StaticClass(), /*bIsRequired =*/ false, bTransient));
192 }
193
198 COREUOBJECT_API void GetDefaultSubobjects(TArray<UObject*>& OutDefaultSubobjects);
199
204 COREUOBJECT_API UObject* GetDefaultSubobjectByName(FName ToFind);
205
206 /*----------------------------------
207 UObject interface
208 ----------------------------------*/
209
210protected:
215 virtual FString GetDetailedInfoInternal() const { return TEXT("No_Detailed_Info_Specified"); }
216
217public:
222 COREUOBJECT_API virtual void PostInitProperties();
223
228 COREUOBJECT_API virtual void PostReinitProperties();
229
234 virtual void PostCDOContruct()
235 {
236 }
237
238#if WITH_EDITOR
240
247 {
248 }
249
254 UE_DEPRECATED(5.1, "Use version that takes FPostCDOCompiledContext instead.")
256 {
257 }
258#endif
259
267 COREUOBJECT_API virtual void PreSaveRoot(FObjectPreSaveRootContext ObjectSaveContext);
268
275 COREUOBJECT_API virtual void PostSaveRoot(FObjectPostSaveRootContext ObjectSaveContext);
276
283 COREUOBJECT_API virtual void PreSave(FObjectPreSaveContext SaveContext);
284
288 COREUOBJECT_API virtual void CollectSaveOverrides(FObjectCollectSaveOverridesContext SaveContext);
289
290#if WITH_EDITOR
295 virtual void OnCookEvent(UE::Cook::ECookEvent CookEvent, UE::Cook::FCookEventContext& Context)
296 {
297 }
298
308 COREUOBJECT_API virtual bool Modify( bool bAlwaysMarkDirty=true );
309
311 COREUOBJECT_API virtual bool IsCapturingAsRootObjectForTransaction() const;
312
314 COREUOBJECT_API bool CanModify() const;
315
316#else
317 UE_FORCEINLINE_HINT bool Modify(bool bAlwaysMarkDirty = true) { return false; }
319#endif
320
321#if WITH_EDITOR
325 virtual void LoadedFromAnotherClass(const FName& OldClassName) {}
326#endif
327
340 virtual bool ResolveSubobject(const TCHAR* SubObjectPath, UObject*& OutObject, bool bLoadIfExists) { return false; }
341
345 virtual bool IsReadyForAsyncPostLoad() const { return true; }
346
351 COREUOBJECT_API virtual void PostLoad();
352
360 COREUOBJECT_API virtual void PostLoadSubobjects(FObjectInstancingGraph* OuterInstanceGraph);
361
366 COREUOBJECT_API virtual void BeginDestroy();
367
373 virtual bool IsReadyForFinishDestroy() { return true; }
374
375#if WITH_EDITOR
379 virtual void PostLinkerChange() {}
380#endif
381
387 COREUOBJECT_API virtual void FinishDestroy();
388
395#if WITH_EDITORONLY_DATA
417#endif
418
420 virtual void ShutdownAfterError() {}
421
422 UE_DEPRECATED(5.3, "Matinee has been removed in 5.0, nothing is calling PostInterpChange anymore")
423 virtual void PostInterpChange(FProperty* PropertyThatChanged) {}
424
425#if WITH_EDITOR
432
440
450 COREUOBJECT_API virtual bool CanEditChange( const FProperty* InProperty ) const;
451
461 COREUOBJECT_API virtual bool CanEditChange(const FEditPropertyChain& PropertyChain) const;
462
466 COREUOBJECT_API void PostEditChange();
467
473 COREUOBJECT_API virtual void PostEditChangeProperty( struct FPropertyChangedEvent& PropertyChangedEvent);
474
479 COREUOBJECT_API virtual void PostEditChangeChainProperty( struct FPropertyChangedChainEvent& PropertyChangedEvent );
480
483
485 COREUOBJECT_API virtual void PreEditUndo();
486
488 COREUOBJECT_API virtual void PostEditUndo();
489
492
499
502
505
506protected:
508 enum class ETransactionAnnotationCreationMode : uint8 { DefaultInstance, FindOrCreate };
510
517 COREUOBJECT_API virtual bool IsSelectedInEditor() const;
518
519public:
520#endif // WITH_EDITOR
521
523 COREUOBJECT_API virtual void PostRename(UObject* OldOuter, const FName OldName);
524
533
538 virtual void PostDuplicate(bool bDuplicateForPIE) {}
539 virtual void PostDuplicate(EDuplicateMode::Type DuplicateMode)
540 {
541 PostDuplicate(DuplicateMode == EDuplicateMode::PIE);
542 }
543
544#if UE_WITH_REMOTE_OBJECT_HANDLE
548 virtual void PostMigrate(const struct FUObjectMigrationContext& MigrationContext) {}
549
550 virtual bool IsMigrationRoot() const { return false; }
551#endif
552
559 COREUOBJECT_API virtual bool NeedsLoadForClient() const;
560
567 COREUOBJECT_API virtual bool NeedsLoadForServer() const;
568
575 COREUOBJECT_API virtual bool NeedsLoadForTargetPlatform(const class ITargetPlatform* TargetPlatform) const;
576
583 virtual bool NeedsLoadForEditorGame() const
584 {
585 return false;
586 }
587
593 virtual bool IsEditorOnly() const
594 {
595 return false;
596 }
597
604 virtual bool HasNonEditorOnlyReferences() const
605 {
606 return false;
607 }
608
614 virtual bool IsPostLoadThreadSafe() const
615 {
616 return false;
617 }
618
624 UE_DEPRECATED(5.5, "Multithreaded destruction of UObjects is no longer supported.")
625 COREUOBJECT_API virtual bool IsDestructionThreadSafe() const;
626
632 COREUOBJECT_API virtual void GetPreloadDependencies(TArray<UObject*>& OutDeps);
633
639 virtual void GetPrestreamPackages(TArray<UObject*>& OutPrestream)
640 {
641 }
642
646 static COREUOBJECT_API void UpdateClassesExcludedFromDedicatedServer(const TArray<FString>& InClassNames, const TArray<FString>& InModulesNames);
647
651 static COREUOBJECT_API void UpdateClassesExcludedFromDedicatedClient(const TArray<FString>& InClassNames, const TArray<FString>& InModulesNames);
652
657 static COREUOBJECT_API bool CanCreateInCurrentContext(UObject* Template);
658
668 virtual void ExportCustomProperties(FOutputDevice& Out, uint32 Indent) {}
669
679 virtual void ImportCustomProperties(const TCHAR* SourceText, FFeedbackContext* Warn) {}
680
686 virtual void PostEditImport() {}
687
692
701 COREUOBJECT_API virtual bool Rename(const TCHAR* NewName=nullptr, UObject* NewOuter=nullptr, ERenameFlags Flags=REN_None);
702
704 virtual FString GetDesc() { return TEXT( "" ); }
705
707 COREUOBJECT_API UScriptStruct* GetSparseClassDataStruct() const;
708
709#if WITH_EDITOR
710 virtual void MoveDataToSparseClassDataStruct() const {}
712#endif
713
714#if WITH_ENGINE
719 COREUOBJECT_API virtual class UWorld* GetWorld() const;
720
722 COREUOBJECT_API class UWorld* GetWorldChecked(bool& bSupported) const;
723
724#if WITH_EDITOR
726 COREUOBJECT_API virtual bool ImplementsGetWorld() const;
727#endif // #if WITH_EDITOR
728
729#endif // #if WITH_ENGINE
730
744 {
745 return false;
746 }
747
755
764 {
767 return ResSize.GetTotalMemoryBytes();
768 }
769
774 virtual FName GetExporterName( void )
775 {
776 return( FName( TEXT( "" ) ) );
777 }
778
787
794
795#if WITH_VERSE_VM || defined(__INTELLISENSE__)
800#endif
801
812
821 {
822 return true;
823 }
824
827 {
842
845 {
847 TD_None = 0,
849 TD_Date = 1<<0,
851 TD_Time = 1<<1,
853 TD_InvariantTz = 1<<2,
855 TD_Memory = 1<<3,
856 };
857
860
862 FString Value;
863
865 ETagType Type = TT_Alphabetical;
866
868 uint32 DisplayFlags = TD_None;
869
870 FAssetRegistryTag() = default;
872 : Name(InName), Value(InValue), Type(InType), DisplayFlags(InDisplayFlags) {}
874 : Name(InName), Value(MoveTemp(InValue)), Type(InType), DisplayFlags(InDisplayFlags) {}
875
876#if WITH_EDITOR
882
884 UE_DEPRECATED(5.4, "Subscribe to OnGetExtraObjectTagsWithContext instead")
887 UE_DEPRECATED(5.4, "Subscribe to OnGetExtraObjectTagsWithContext instead, and early exit if !Context.IsSaving")
889#endif // WITH_EDITOR
890 };
891
898 COREUOBJECT_API virtual void GetAssetRegistryTags(FAssetRegistryTagsContext Context) const;
899 UE_DEPRECATED(5.4, "Implement the version that takes FAssetRegistryTagsContext instead.")
900 COREUOBJECT_API virtual void GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const;
901
902#if WITH_EDITOR
916#endif // WITH_EDITOR
917
918 COREUOBJECT_API void GetAssetRegistryTags(FAssetData& Out) const;
923 COREUOBJECT_API void GetAssetRegistryTags(FAssetRegistryTagsContext Context, FAssetData& Out) const;
924
926 static COREUOBJECT_API const FName& SourceFileTagName();
927
928#if WITH_EDITOR
929
930 UE_DEPRECATED(5.5, "This function is no longer called. If you require this functionality, please implement ThreadedPostLoadAssetRegistryTagsOverride. " \
931 "Note that this function MUST be safe to call on a background thread. If you have functionality that doesn't meet that requirement, " \
932 "consider using the AssetRegistry's AssetAddedEvent which fires on the game thread.")
933 virtual void PostLoadAssetRegistryTags(const FAssetData& InAssetData, TArray<FAssetRegistryTag>& OutTagsAndValuesToUpdate) const final {}
934
937 {
941
942 const FAssetData& GetAssetData() const { return AssetData; }
943 void AddTagToUpdate(const FAssetRegistryTag& Tag) { TagsAndValuesToUpdate.Add(Tag); }
944
945 bool CanCreateObjects() const { return bCanCreateObjects; }
946 bool PostLoadCouldComplete() const { return bPostLoadCouldComplete; }
947 void SetPostLoadCouldComplete(bool bValue) { bPostLoadCouldComplete = bValue; }
948 private:
950 const FAssetData& AssetData;
953 bool bCanCreateObjects = true;
954 bool bPostLoadCouldComplete = true;
955 };
956
957protected:
969
970public:
971
974
979 {
981 FText TooltipText;
983 FString ImportantValue;
984
986 FAssetRegistryTagMetadata& SetDisplayName(const FText& InDisplayName)
987 {
989 return *this;
990 }
991
994 {
995 TooltipText = InTooltipText;
996 return *this;
997 }
998
1001 {
1002 Suffix = InSuffix;
1003 return *this;
1004 }
1005
1008 {
1010 return *this;
1011 }
1012 };
1013
1016
1019
1020#endif
1021
1023 COREUOBJECT_API virtual bool IsAsset() const;
1024
1030 COREUOBJECT_API virtual FPrimaryAssetId GetPrimaryAssetId() const;
1031
1033 COREUOBJECT_API virtual bool IsLocalizedResource() const;
1034
1036 COREUOBJECT_API virtual bool IsSafeForRootSet() const;
1037
1043 COREUOBJECT_API virtual void TagSubobjects(EObjectFlags NewFlags);
1044
1052 COREUOBJECT_API virtual void GetLifetimeReplicatedProps( TArray< class FLifetimeProperty > & OutLifetimeProps ) const;
1053
1055 COREUOBJECT_API virtual void GetReplicatedCustomConditionState(FCustomPropertyConditionState& OutActiveState) const;
1063 COREUOBJECT_API virtual void RegisterReplicationFragments(UE::Net::FFragmentRegistrationContext& Context, UE::Net::EFragmentRegistrationFlags RegistrationFlags);
1064
1066 COREUOBJECT_API virtual bool IsNameStableForNetworking() const;
1067
1069 COREUOBJECT_API virtual bool IsFullNameStableForNetworking() const;
1070
1072 COREUOBJECT_API virtual bool IsSupportedForNetworking() const;
1073
1075 UE_DEPRECATED(5.7, "This function is useless now and will be deleted")
1076 virtual void GetSubobjectsWithStableNamesForNetworking(TArray<UObject*> &ObjList) {}
1077
1079 COREUOBJECT_API virtual void PreNetReceive();
1080
1082 COREUOBJECT_API virtual void PostNetReceive();
1083
1085 virtual void PostRepNotifies() {}
1086
1088 COREUOBJECT_API virtual void PreDestroyFromReplication();
1089
1090#if WITH_EDITOR
1098 COREUOBJECT_API virtual EDataValidationResult IsDataValid(class FDataValidationContext& Context) const;
1099
1100 UE_DEPRECATED(5.3, "Please use the the const version of IsDataValid(FDataValidationContext&)")
1102
1110 UE_DEPRECATED(5.3, "Please use IsDataValid(FDataValidationContext&) const as the FDataValidationContext will allow distinguishing between Warnings and Errors.")
1112#endif // WITH_EDITOR
1113
1114 /*----------------------------------------------------------
1115 Non virtual functions, not intended to be overridden
1116 ----------------------------------------------------------*/
1117
1124 COREUOBJECT_API bool IsSelected() const;
1125
1126#if WITH_EDITOR
1134
1142#endif // WITH_EDITOR
1143
1150 COREUOBJECT_API void SerializeScriptProperties( FArchive& Ar ) const;
1151
1158 COREUOBJECT_API void SerializeScriptProperties( FStructuredArchive::FSlot Slot ) const;
1159
1167 COREUOBJECT_API void ReinitializeProperties( UObject* SourceObject=NULL, struct FObjectInstancingGraph* InstanceGraph=NULL );
1168
1177 COREUOBJECT_API FString GetDetailedInfo() const;
1178
1183 COREUOBJECT_API bool ConditionalBeginDestroy();
1184
1186 COREUOBJECT_API bool ConditionalFinishDestroy();
1187
1189 COREUOBJECT_API void ConditionalPostLoad();
1190
1192 COREUOBJECT_API void ConditionalPreload();
1193
1201 COREUOBJECT_API void ConditionalPostLoadSubobjects( struct FObjectInstancingGraph* OuterInstanceGraph=NULL );
1202
1203#if WITH_EDITOR
1211 virtual void BeginCacheForCookedPlatformData( const ITargetPlatform* TargetPlatform ) { }
1212
1218 virtual bool IsCachedCookedPlatformDataLoaded( const ITargetPlatform* TargetPlatform ) { return true; }
1219
1223 virtual void WillNeverCacheCookedPlatformDataAgain() { }
1224
1230 virtual void ClearCachedCookedPlatformData( const ITargetPlatform* TargetPlatform ) { }
1231
1237 virtual void ClearAllCachedCookedPlatformData() { }
1238
1247 void CookAdditionalFiles(const TCHAR* PackageFilename, const ITargetPlatform* TargetPlatform,
1248 TFunctionRef<void(const TCHAR* Filename, void* Data, int64 Size)> WriteAdditionalFile)
1249 {
1250 CookAdditionalFilesOverride(PackageFilename, TargetPlatform, WriteAdditionalFile);
1251 }
1252
1253private:
1264 virtual void CookAdditionalFilesOverride(const TCHAR* PackageFilename, const ITargetPlatform* TargetPlatform,
1265 TFunctionRef<void(const TCHAR* Filename, void* Data, int64 Size)> WriteAdditionalFile)
1266 {
1267 }
1268
1269public:
1270#endif
1274 inline bool IsBasedOnArchetype( const UObject* const SomeObject ) const;
1275
1277 COREUOBJECT_API UFunction* FindFunction( FName InName ) const;
1278
1280 COREUOBJECT_API UFunction* FindFunctionChecked( FName InName ) const;
1281
1288 COREUOBJECT_API virtual void BuildSubobjectMapping(UObject* OtherObject, TMap<UObject*, UObject*>& ObjectMapping) const;
1289
1294 UE_DEPRECATED(5.4, "Call GetDefaultSubobjects for top level subobjects or use ForEachObjectWithOuter with a more precise check")
1295 COREUOBJECT_API void CollectDefaultSubobjects( TArray<UObject*>& OutDefaultSubobjects, bool bIncludeNestedSubobjects=false ) const;
1296
1303 COREUOBJECT_API bool CheckDefaultSubobjects(bool bForceCheck = false) const;
1304
1309 COREUOBJECT_API void SaveConfig(uint64 RequiredPropertyFlags = CPF_Config, const TCHAR* Filename = nullptr,
1310 FConfigCacheIni* Config=GConfig, bool bAllowCopyToDefaultObject = true);
1311
1313 {
1314 EPropertyFlags RequiredPropertyFlags = CPF_Config;
1315 FString Filename;
1316 FConfigCacheIni* ConfigSystem = GConfig;
1317 bool bAllowCopyToDefaultObject = true;
1318
1319 bool bSaveToLayer = false;
1322 };
1323 COREUOBJECT_API void SaveConfig(const FSaveConfigContext& Context);
1324
1328 UE_DEPRECATED(5.0, "TryUpdateDefaultConfigFile replaces UpdateDefaultConfigFile")
1329 COREUOBJECT_API void UpdateDefaultConfigFile(const FString& SpecificFileLocation = "");
1330
1338 COREUOBJECT_API bool TryUpdateDefaultConfigFile(const FString& SpecificFileLocation = "", bool bWarnIfFail = true);
1339
1343 COREUOBJECT_API void UpdateGlobalUserConfigFile();
1344
1348 COREUOBJECT_API void UpdateProjectUserConfigFile();
1349
1353 COREUOBJECT_API void UpdateSinglePropertyInConfigFile(const FProperty* InProperty, const FString& InConfigIniName);
1354
1355private:
1359 COREUOBJECT_API void UpdateSingleSectionOfConfigFile(const FString& ConfigIniName);
1360
1365 COREUOBJECT_API void EnsureNotRetrievingVTablePtr() const;
1366
1367public:
1371 COREUOBJECT_API FString GetDefaultConfigFilename() const;
1372
1376 COREUOBJECT_API FString GetGlobalUserConfigFilename() const;
1377
1381 COREUOBJECT_API FString GetProjectUserConfigFilename() const;
1382
1383#if WITH_EDITOR
1390#endif
1391
1395 virtual const TCHAR* GetConfigOverridePlatform() const { return nullptr; }
1396
1402 virtual void OverrideConfigSection(FString& SectionName) {}
1403
1409 virtual void OverridePerObjectConfigSection(FString& SectionName) {}
1410
1421 COREUOBJECT_API void LoadConfig(UClass* ConfigClass = nullptr, const TCHAR* Filename = nullptr,
1422 uint32 PropagationFlags = UE::LCPF_None, class FProperty* PropertyToLoad = nullptr,
1424
1434 COREUOBJECT_API void ReloadConfig( UClass* ConfigClass=NULL, const TCHAR* Filename=NULL, uint32 PropagationFlags=UE::LCPF_None, class FProperty* PropertyToLoad=NULL );
1435
1437 COREUOBJECT_API void ParseParms( const TCHAR* Parms );
1438
1445 COREUOBJECT_API void OutputReferencers( FOutputDevice& Ar, FReferencerInformationList* Referencers=NULL );
1446
1449
1459 COREUOBJECT_API void SetLinker( FLinkerLoad* LinkerLoad, int32 LinkerIndex, bool bShouldDetachExisting = true, bool bSilenceLogs = false);
1460
1466 static COREUOBJECT_API UObject* GetArchetypeFromRequiredInfo(const UClass* Class, const UObject* Outer, FName Name, EObjectFlags ObjectFlags);
1467
1473 COREUOBJECT_API UObject* GetArchetype() const;
1474
1480 COREUOBJECT_API void GetArchetypeInstances( TArray<UObject*>& Instances );
1481
1485 COREUOBJECT_API void InstanceSubobjectTemplates( struct FObjectInstancingGraph* InstanceGraph = NULL );
1486
1490 template<class T>
1491 bool Implements() const;
1492
1493
1494 /*-----------------------------
1495 Virtual Machine
1496 -----------------------------*/
1497
1499 COREUOBJECT_API virtual void ProcessEvent( UFunction* Function, void* Parms );
1500
1510 {
1511 return FunctionCallspace::Local;
1512 }
1513
1523 virtual bool CallRemoteFunction( UFunction* Function, void* Parms, struct FOutParmRec* OutParms, FFrame* Stack )
1524 {
1525 return false;
1526 }
1527
1529 COREUOBJECT_API bool CallFunctionByNameWithArguments( const TCHAR* Cmd, FOutputDevice& Ar, UObject* Executor, bool bForceCallWithNonExec = false );
1530
1533
1539
1544 virtual bool ProcessConsoleExec(const TCHAR* Cmd, FOutputDevice& Ar, UObject* Executor)
1545 {
1546 return CallFunctionByNameWithArguments(Cmd, Ar, Executor);
1547 }
1548
1554 COREUOBJECT_API void SkipFunction(FFrame& Stack, RESULT_DECL, UFunction* Function);
1555
1561
1565 COREUOBJECT_API bool IsInBlueprint() const;
1566
1570 COREUOBJECT_API void DestroyNonNativeProperties();
1571
1573 virtual void MarkAsEditorOnlySubobject() { }
1574
1578 COREUOBJECT_API void AbortInsideMemberFunction() const;
1579
1580 // UnrealScript intrinsics, do not call directly
1581
1582 // Undefined native handler
1584
1585 // Variables
1597
1598 // Do Nothing
1602
1605
1609
1612
1614
1618
1619 // Commands
1623
1629
1636
1642
1643
1644 // Assignment
1651
1652 // Delegates
1657
1658 // Context expressions
1663
1664 // Function calls
1669
1670 // Struct comparison
1674
1679
1680 // Constants
1694
1717
1718 // Object construction
1722
1723 // Conversions
1735
1736 // Dynamic array functions
1737 // Array support
1751
1754
1756
1758
1760
1762
1766
1767
1773 UFUNCTION(BlueprintImplementableEvent, meta=(BlueprintInternalUseOnly = "true"))
1774 void ExecuteUbergraph(int32 EntryPoint);
1775
1776protected:
1778 COREUOBJECT_API bool CanCheckDefaultSubObjects(bool bForceCheck, bool& bResult) const;
1779
1785 COREUOBJECT_API virtual bool CheckDefaultSubobjectsInternal() const;
1786
1787private:
1788 COREUOBJECT_API void ProcessContextOpcode(FFrame& Stack, RESULT_DECL, bool bCanFailSilent);
1789
1797 COREUOBJECT_API UObject* CreateEditorOnlyDefaultSubobjectImpl(FName SubobjectName, UClass* ReturnType, bool bTransient = false);
1798
1799public:
1800
1802 {
1803 NETFIELD_REP_START = 0,
1804 NETFIELD_REP_END = -1
1805 };
1806
1807 virtual void ValidateGeneratedRepEnums(const TArray<struct FRepRecord>& ClassReps) const {}
1808
1809private:
1810
1812 virtual void SetNetPushIdDynamic(const uint64 NewNetPushId)
1813 {
1814 // This method should only be called on Objects that are networked, and those should
1815 // always have this implemented (by UHT).
1816 checkf(false, TEXT("REPLICATED_BASE_CLASS macro is not implemented in %s. Something went very wrong."), *GetFullName());
1817 }
1818
1819 // Here for UHT to be happy
1821
1822public:
1823
1826 {
1827 return uint64(int64(INDEX_NONE));
1828 }
1829};
1830
1832{
1833private:
1837
1838 static void SetNetPushIdDynamic(UObject* Object, const uint64 NewNetPushId)
1839 {
1840 Object->SetNetPushIdDynamic(NewNetPushId);
1841 }
1842};
1843
1845{
1847 {
1848 // Here we don't really check if the flags match but if the end result is the same
1850 return !Test->HasAnyFlags(RF_MirroredGarbage);
1851 }
1852};
1853
1854#if WITH_EDITORONLY_DATA
1856{
1857public:
1858 explicit FAppendToClassSchemaContext(void* InHasher) // Type is void* to mask the implementation detail
1859 :Hasher(InHasher)
1860 {
1861 }
1862 COREUOBJECT_API void Update(const void* Data, uint64 Size);
1863
1864private:
1865 void* Hasher; // Type is void* to mask the implementation detail
1866};
1867#endif
1868
1879
1891
1898template <typename T>
1900{
1901 static_assert(std::is_base_of<UObject, T>::value, "GetValid can only work with UObject-derived classes");
1902 return IsValid(Test) ? Test : nullptr;
1903}
1904
1911template <typename T>
1912const T* GetValid(const T* Test)
1913{
1914 static_assert(std::is_base_of<UObject, T>::value, "GetValid can only work with UObject-derived classes");
1915 return IsValid(Test) ? Test : nullptr;
1916}
1917
1918#if WITH_EDITOR
1921#endif
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define NULL
Definition oodle2base.h:134
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
FConfigCacheIni * GConfig
Definition CoreGlobals.cpp:54
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_DELEGATE_RetVal_OneParam(ReturnValueType, DelegateName, Param1Type)
Definition DelegateCombinations.h:54
#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_TS_MULTICAST_DELEGATE_TwoParams(DelegateName, Param1Type, Param2Type)
Definition DelegateCombinations.h:59
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
return true
Definition ExternalRpcRegistry.cpp:601
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
const bool
Definition NetworkReplayStreaming.h:178
EPropertyFlags
Definition ObjectMacros.h:416
@ CPF_Config
Property should be loaded/saved as permanent profile.
Definition ObjectMacros.h:433
uint32 ERenameFlags
Definition ObjectMacros.h:2302
EStaticConstructor
Definition ObjectMacros.h:174
#define REN_None
Definition ObjectMacros.h:2305
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
@ Garbage
Garbage from logical point of view and should not be referenced. This flag is mirrored in EObjectFlag...
EObjectFlags
Definition ObjectMacros.h:552
@ RF_MirroredGarbage
Garbage from logical point of view and should not be referenced. This flag is mirrored in EInternalOb...
Definition ObjectMacros.h:598
#define UCLASS(...)
Definition ObjectMacros.h:776
bool IsValidChecked(const UObject *Test)
Definition Object.h:1886
T * GetValid(T *Test)
Definition Object.h:1899
#define RESULT_DECL
Definition Script.h:92
#define CallFunction(Capability, ReturnValue, FunctionName,...)
Definition TypedElementQueryContextImplementation.inl:56
EDataValidationResult
Definition UObjectGlobals.h:4225
FUObjectArray GUObjectArray
Definition UObjectHash.cpp:55
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint32 Size
Definition VulkanMemory.cpp:4034
if(Failed) console_printf("Failed.\n")
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Engine.Build.cs:7
Definition Archive.h:1208
Definition AssetRegistryTagsContext.h:98
Definition ConfigCacheIni.h:1240
Definition CoreNet.h:578
Definition DataValidation.h:40
Definition UnrealType.h:6738
Definition FeedbackContext.h:30
Definition LinkerLoad.h:124
Definition NameTypes.h:617
Definition ObjectSaveContext.h:193
Definition UObjectGlobals.h:1292
Definition ObjectSaveContext.h:459
Definition ObjectSaveContext.h:554
Definition ObjectSaveContext.h:244
Definition ObjectSaveContext.h:535
Definition UnrealType.h:3087
Definition OutputDevice.h:133
Definition UnrealType.h:174
Definition UObjectGlobals.h:2492
Definition ObjectMacros.h:2402
Definition StructuredArchiveSlots.h:144
Definition StructuredArchiveSlots.h:52
Definition Text.h:385
Definition TransactionObjectEvent.h:181
FUObjectItem * IndexToObject(int32 Index)
Definition UObjectArray.h:1089
Definition ObjectMacros.h:180
Definition ITransactionObjectAnnotation.h:19
Definition Array.h:670
Definition AssetRegistryState.h:50
Definition AndroidPlatformMisc.h:14
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition Class.h:3793
Definition ReplicationFragment.h:244
Definition Class.h:2476
Definition UObjectBaseUtility.h:45
Definition Object.h:95
virtual bool ProcessConsoleExec(const TCHAR *Cmd, FOutputDevice &Ar, UObject *Executor)
Definition Object.h:1544
DECLARE_FUNCTION(execByteConst)
SIZE_T GetResourceSizeBytes(EResourceSizeMode::Type Mode)
Definition Object.h:763
virtual FName GetExporterName(void)
Definition Object.h:774
DECLARE_FUNCTION(execSetArray)
DECLARE_FUNCTION(execSetMap)
DECLARE_FUNCTION(execEqualEqual_DelegateFunction)
virtual void PostRepNotifies()
Definition Object.h:1085
virtual bool IsPostLoadThreadSafe() const
Definition Object.h:614
virtual FString GetDetailedInfoInternal() const
Definition Object.h:215
virtual UClass * RegenerateClass(UClass *ClassToRegenerate, UObject *PreviousCDO)
Definition Object.h:1560
DECLARE_FUNCTION(execNullInterface)
virtual void OverrideConfigSection(FString &SectionName)
Definition Object.h:1402
virtual bool CallRemoteFunction(UFunction *Function, void *Parms, struct FOutParmRec *OutParms, FFrame *Stack)
Definition Object.h:1523
DECLARE_FUNCTION(execComputedJump)
DECLARE_FUNCTION(execInt64Const)
DECLARE_FUNCTION(execVector3fConst)
DECLARE_FUNCTION(execCallMulticastDelegate)
DECLARE_FUNCTION(execFinalFunction)
virtual void PostDuplicate(bool bDuplicateForPIE)
Definition Object.h:538
DECLARE_FUNCTION(execDynArrayInsert)
TReturnType * CreateOptionalDefaultSubobject(FName SubobjectName, bool bTransient=false)
Definition Object.h:174
DECLARE_FUNCTION(execLetWeakObjPtr)
DECLARE_FUNCTION(execLocalVirtualFunction)
DECLARE_FUNCTION(execBindDelegate)
DECLARE_FUNCTION(execContext_FailSilent)
virtual void PostEditImport()
Definition Object.h:686
DECLARE_FUNCTION(execEndFunctionParms)
DECLARE_FUNCTION(execEatReturnValue)
TReturnType * CreateDefaultSubobject(FName SubobjectName, bool bTransient=false)
Definition Object.h:147
DECLARE_FUNCTION(execAutoRtfmTransact)
DECLARE_FUNCTION(execAutoRtfmStopTransact)
DECLARE_FUNCTION(execSkipOffsetConst)
DECLARE_FUNCTION(execStringConst)
DECLARE_FUNCTION(execPopExecutionFlow)
DECLARE_FUNCTION(execUndefined)
DECLARE_FUNCTION(execTransformConst)
DECLARE_FUNCTION(execInstrumentation)
TReturnType * CreateOptionalDefaultSubobject(FName SubobjectName, bool bTransient=false)
Definition Object.h:189
DECLARE_FUNCTION(execJumpIfNot)
virtual bool IsReadyForFinishDestroy()
Definition Object.h:373
DECLARE_FUNCTION(execInstanceVariable)
DECLARE_FUNCTION(execNothingOp4a)
DECLARE_FUNCTION(execClassContext)
virtual void ImportCustomProperties(const TCHAR *SourceText, FFeedbackContext *Warn)
Definition Object.h:679
DECLARE_FUNCTION(execArrayElement)
DECLARE_FUNCTION(execObjectToBool)
COREUOBJECT_API void CallAddReferencedObjects(FReferenceCollector &Collector)
Definition GarbageCollection.cpp:6386
DECLARE_FUNCTION(execClearMulticastDelegate)
ENetFields_Private
Definition Object.h:1802
DECLARE_FUNCTION(execInterfaceContext)
DECLARE_FUNCTION(execVectorConst)
DECLARE_FUNCTION(execStructConst)
DECLARE_FUNCTION(execCast)
UObject WithinClass
Definition Object.h:99
DECLARE_FUNCTION(execClassDefaultVariable)
DECLARE_FUNCTION(execIntZero)
DECLARE_FUNCTION(execBitFieldConst)
virtual bool ResolveSubobject(const TCHAR *SubObjectPath, UObject *&OutObject, bool bLoadIfExists)
Definition Object.h:340
DECLARE_FUNCTION(execSetSet)
DECLARE_FUNCTION(execGetDynArrayLength)
DECLARE_FUNCTION(execIntConst)
DECLARE_FUNCTION(execNoObject)
DECLARE_FUNCTION(execStructCmpEq)
DECLARE_FUNCTION(execInstanceDelegate)
DECLARE_FUNCTION(execIntOne)
DECLARE_FUNCTION(execNotEqual_DelegateFunction)
DECLARE_FUNCTION(execFieldPathConst)
DECLARE_FUNCTION(execDoubleConst)
DECLARE_FUNCTION(execWireTracepoint)
DECLARE_FUNCTION(execObjectConst)
DECLARE_FUNCTION(execInterfaceToInterface)
DECLARE_FUNCTION(execLocalFinalFunction)
virtual bool GetNativePropertyValues(TMap< FString, FString > &out_PropertyValues, uint32 ExportFlags=0) const
Definition Object.h:743
DECLARE_FUNCTION(execAutoRtfmAbortIfNot)
DECLARE_FUNCTION(execStructMemberContext)
DECLARE_FUNCTION(execSwitchValue)
DECLARE_FUNCTION(execDynArrayAdd)
DECLARE_FUNCTION(execReturnNothing)
virtual FRestoreForUObjectOverwrite * GetRestoreForUObjectOverwrite()
Definition Object.h:808
DECLARE_FUNCTION(execSoftObjectConst)
DECLARE_FUNCTION(execInterfaceToBool)
DECLARE_FUNCTION(execLetValueOnPersistentFrame)
virtual void PostReloadConfig(class FProperty *PropertyThatWasLoaded)
Definition Object.h:691
DECLARE_FUNCTION(execDynArrayRemove)
DECLARE_FUNCTION(execDynamicCast)
virtual void MarkAsEditorOnlySubobject()
Definition Object.h:1573
DECLARE_FUNCTION(execVirtualFunction)
DECLARE_FUNCTION(execDefaultVariable)
DECLARE_FUNCTION(execStructMember)
DECLARE_FUNCTION(execBoolVariable)
virtual int32 GetFunctionCallspace(UFunction *Function, FFrame *Stack)
Definition Object.h:1509
virtual void PostDuplicate(EDuplicateMode::Type DuplicateMode)
Definition Object.h:539
DECLARE_FUNCTION(execDynArrayAddItem)
DECLARE_FUNCTION(execNew)
virtual bool IsEditorOnly() const
Definition Object.h:593
DECLARE_FUNCTION(execPushExecutionFlow)
DECLARE_FUNCTION(execPopExecutionFlowIfNot)
virtual bool AreNativePropertiesIdenticalTo(UObject *Other) const
Definition Object.h:820
DECLARE_FUNCTION(execArrayGetByRef)
DECLARE_FUNCTION(execStructCmpNe)
DECLARE_FUNCTION(execDynArraySort)
virtual COREUOBJECT_API void GetResourceSizeEx(FResourceSizeEx &CumulativeResourceSize)
Definition Obj.cpp:2681
DECLARE_FUNCTION(execNothingInt32)
DECLARE_FUNCTION(execLetBool)
DECLARE_FUNCTION(execNothing)
DECLARE_FUNCTION(execObjectToInterface)
DECLARE_FUNCTION(execNotEqual_DelegateDelegate)
DECLARE_FUNCTION(execLetDelegate)
DECLARE_FUNCTION(execSetConst)
DECLARE_FUNCTION(execMapConst)
DECLARE_FUNCTION(execInterfaceToObject)
DECLARE_FUNCTION(execPropertyConst)
DECLARE_FUNCTION(execDoubleToFloatCast)
DECLARE_FUNCTION(execSelf)
TReturnType * CreateEditorOnlyDefaultSubobject(FName SubobjectName, bool bTransient=false)
Definition Object.h:134
UE_FORCEINLINE_HINT bool IsCapturingAsRootObjectForTransaction() const
Definition Object.h:318
DECLARE_FUNCTION(execArrayConst)
virtual void PreDuplicate(FObjectDuplicationParameters &DupParams)
Definition Object.h:532
DECLARE_FUNCTION(execDynArrayRemoveItem)
DECLARE_FUNCTION(execSetDynArrayElement)
friend COREUOBJECT_API UClass * Z_Construct_UClass_UObject_NoRegister()
DECLARE_FUNCTION(execEmptyParmValue)
DECLARE_FUNCTION(execAddMulticastDelegate)
virtual FString GetDesc()
Definition Object.h:704
DECLARE_FUNCTION(execContext)
DECLARE_FUNCTION(execGetDynArrayElement)
DECLARE_FUNCTION(execLetMulticastDelegate)
virtual COREUOBJECT_API void Serialize(FArchive &Ar)
DECLARE_FUNCTION(execMetaCast)
virtual bool NeedsLoadForEditorGame() const
Definition Object.h:583
virtual void PostCDOContruct()
Definition Object.h:234
DECLARE_FUNCTION(execEndOfScript)
DECLARE_FUNCTION(execFalse)
virtual void OverridePerObjectConfigSection(FString &SectionName)
Definition Object.h:1409
virtual void ExportCustomProperties(FOutputDevice &Out, uint32 Indent)
Definition Object.h:668
DECLARE_FUNCTION(execSetDynArrayLength)
DECLARE_FUNCTION(execInterfaceVariable)
virtual void ValidateGeneratedRepEnums(const TArray< struct FRepRecord > &ClassReps) const
Definition Object.h:1807
virtual void ShutdownAfterError()
Definition Object.h:420
DECLARE_FUNCTION(execBreakpoint)
DECLARE_FUNCTION(execRemoveMulticastDelegate)
DECLARE_FUNCTION(execCallMathFunction)
DECLARE_FUNCTION(execEqualEqual_DelegateDelegate)
DECLARE_FUNCTION(execNameConst)
virtual const TCHAR * GetConfigOverridePlatform() const
Definition Object.h:1395
DECLARE_FUNCTION(execLocalVariable)
DECLARE_FUNCTION(execAssert)
DECLARE_FUNCTION(execFloatToDoubleCast)
DECLARE_FUNCTION(execFloatConst)
DECLARE_FUNCTION(execTracepoint)
UE_FORCEINLINE_HINT bool Modify(bool bAlwaysMarkDirty=true)
Definition Object.h:317
virtual uint64 GetNetPushIdDynamic() const
Definition Object.h:1825
DECLARE_FUNCTION(execIntConstByte)
DECLARE_FUNCTION(execDynArrayFind)
DECLARE_FUNCTION(execJump)
virtual bool HasNonEditorOnlyReferences() const
Definition Object.h:604
DECLARE_FUNCTION(execDynArrayInsertItem)
DECLARE_FUNCTION(execUInt64Const)
DECLARE_FUNCTION(execNativeParm)
DECLARE_FUNCTION(execLetObj)
DECLARE_FUNCTION(ProcessInternal)
TReturnType * CreateDefaultSubobject(FName SubobjectName, bool bTransient=false)
Definition Object.h:161
DECLARE_FUNCTION(execTextConst)
DECLARE_FUNCTION(execUnicodeStringConst)
DECLARE_FUNCTION(execLocalOutVariable)
DECLARE_FUNCTION(execDynArrayFindStruct)
DECLARE_FUNCTION(execClassSparseDataVariable)
DECLARE_FUNCTION(execTrue)
DECLARE_FUNCTION(execRotationConst)
virtual bool IsReadyForAsyncPostLoad() const
Definition Object.h:345
DECLARE_FUNCTION(execLet)
DECLARE_FUNCTION(execInterfaceCast)
Definition Class.h:1720
Definition World.h:918
static UE_API void AddReferencedObjects(UObject *InThis, FReferenceCollector &Collector)
Definition World.cpp:982
virtual UE_API UWorld * GetWorld() const override
Definition World.cpp:1820
Definition Object.h:58
Type
Definition Object.h:60
@ NullChecked
Definition Object.h:64
@ NullAllowed
Definition Object.h:62
Type
Definition UObjectGlobals.h:128
@ PIE
Definition UObjectGlobals.h:134
@ AssetData
Definition TokenizedMessage.h:40
@ Suffix
Definition MirrorDataTable.h:34
Type
Definition ResourceSize.h:18
Definition OverriddenPropertySet.cpp:45
Definition PropertyNames.h:7
Definition TestUtils.cpp:8
Definition PackageReader.h:15
Definition ConfigAccessTracking.h:154
Definition CookOnTheFly.h:19
Definition NetworkVersion.cpp:28
EFragmentRegistrationFlags
Definition ReplicationFragment.h:220
@ DisplayName
[ClassMetadata] [PropertyMetadata] [FunctionMetadata] The name to display for this class,...
Definition ObjectMacros.h:1240
@ false
Definition radaudio_common.h:23
Definition ArchiveCookContext.h:14
Definition AssetData.h:162
Definition Stack.h:114
static bool CheckObjectValidBasedOnItsFlags(const UObject *Test)
Definition Object.h:1846
Definition UObjectGlobals.h:147
Definition Class.h:4941
Definition Object.h:1832
friend struct FNetObjectManagerPushIdHelper
Definition Object.h:1835
friend struct FNetPrivatePushIdHelper
Definition Object.h:1834
friend struct UE::Net::Private::FNetHandleLegacyPushModelHelper
Definition Object.h:1836
Definition Stack.h:103
Definition PrimaryAssetId.h:126
Definition UnrealType.h:7001
Definition UnrealType.h:6865
Definition ObjectMacros.h:723
Definition ResourceSize.h:31
Definition TopLevelAssetPath.h:38
UE_FORCEINLINE_HINT bool HasAnyFlags(EInternalObjectFlags InFlags) const
Definition UObjectArray.h:309
Definition UObjectMigrationContext.h:62
Definition Object.h:827
ETagDisplay
Definition Object.h:845
FName Name
Definition Object.h:859
FAssetRegistryTag(FName InName, FString &&InValue, ETagType InType, uint32 InDisplayFlags=TD_None)
Definition Object.h:873
FString Value
Definition Object.h:862
FAssetRegistryTag(FName InName, const FString &InValue, ETagType InType, uint32 InDisplayFlags=TD_None)
Definition Object.h:871
ETagType
Definition Object.h:830
@ TT_Hidden
Definition Object.h:832
@ TT_Dimensional
Definition Object.h:838
@ TT_Chronological
Definition Object.h:840
@ TT_Numerical
Definition Object.h:836
@ TT_Alphabetical
Definition Object.h:834
Definition Object.h:1313
FString Filename
Definition Object.h:1315
FString OverrideConfigSectionName
Definition Object.h:1321