![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include "Concepts/SameAs.h"#include "Containers/Array.h"#include "Containers/ArrayView.h"#include "Containers/Map.h"#include "Containers/Set.h"#include "Containers/UnrealString.h"#include "CoreTypes.h"#include "Stats/Stats.h"#include "Templates/Function.h"#include "UObject/FindObjectFlags.h"#include "UObject/NameTypes.h"#include "UObject/ObjectMacros.h"#include "UObject/UObjectArray.h"#include "UObject/UnrealNames.h"Go to the source code of this file.
Classes | |
| class | FScopedUObjectHashTablesLock |
Enumerations | |
| enum class | EObjectMemoryOverheadOptions { None , ShowIndividualStats = 1 << 0 , IncludeReflectionData = 1 << 1 } |
|
strong |
| COREUOBJECT_API bool ClassHasInstancesAsyncLoading | ( | const UClass * | ClassToLookFor | ) |
Returns true if any instances of the class in question are currently being async loaded.
| ClassToLookFor | The class in question |
| DECLARE_DWORD_COUNTER_STAT_EXTERN | ( | TEXT("NumObjects") | , |
| STAT_Hash_NumObjects | , | ||
| STATGROUP_UObjectHash | , | ||
| COREUOBJECT_API | |||
| ) |
| DECLARE_STATS_GROUP_VERBOSE | ( | TEXT("UObject Hash") | , |
| STATGROUP_UObjectHash | , | ||
| STATCAT_Advanced | |||
| ) |
| COREUOBJECT_API class UObjectBase * FindObjectWithOuter | ( | const class UObjectBase * | Outer, |
| const class UClass * | ClassToLookFor = nullptr, |
||
| FName | NameToLookFor = NAME_None |
||
| ) |
Find an objects with a given name and or class within an outer
| Outer | Outer to search for |
| ClassToLookFor | if NULL, ignore this parameter, otherwise require the returned object have this class |
| NameToLookFor | if NAME_None, ignore this parameter, otherwise require the returned object have this name |
| COREUOBJECT_API void ForEachObjectOfClass | ( | const UClass * | ClassToLookFor, |
| TFunctionRef< void(UObject *)> | Operation, | ||
| bool | bIncludeDerivedClasses = true, |
||
| EObjectFlags | ExcludeFlags = RF_ClassDefaultObject, |
||
| EInternalObjectFlags | ExclusionInternalFlags = EInternalObjectFlags::None |
||
| ) |
Performs an operation on all objects of the provided class Note that the operation must not modify UObject hash maps so it can not create, rename or destroy UObjects.
| Outer | UObject class to loop over instances of |
| Operation | Function to be called for each object |
| bIncludeDerivedClasses | If true, the results will include objects of child classes as well. |
| AdditionalExcludeFlags | Objects with any of these flags will be excluded from the results. |
| COREUOBJECT_API void ForEachObjectOfClasses | ( | TArrayView< const UClass *const > | ClassesToLookFor, |
| TFunctionRef< void(UObject *)> | Operation, | ||
| EObjectFlags | ExcludeFlags = RF_ClassDefaultObject, |
||
| EInternalObjectFlags | ExclusionInternalFlags = EInternalObjectFlags::None |
||
| ) |
Performs an operation on all objects of the provided classes Note that the operation must not modify UObject hash maps so it can not create, rename or destroy UObjects.
| Classes | UObject Classes to loop over instances of |
| Operation | Function to be called for each object |
| bIncludeDerivedClasses | If true, the results will include objects of child classes as well. |
| AdditionalExcludeFlags | Objects with any of these flags will be excluded from the results. |
|
inline |
Performs an operation on all objects with a given outer Note that the operation must not modify UObject hash maps so it can not create, rename or destroy UObjects.
| Outer | Outer to search for |
| Operation | Function to be called for each object |
| bIncludeNestedObjects | If true, then things whose outers directly or indirectly have Outer as an outer are included, these are the nested objects. |
| ExclusionFlags | Specifies flags to use as a filter for which objects to return |
| ExclusiveInternalFlags | Specifies internal flags to use as a filter for which objects to return |
| COREUOBJECT_API void ForEachObjectWithOuterBreakable | ( | const class UObjectBase * | Outer, |
| TFunctionRef< bool(UObject *)> | Operation, | ||
| bool | bIncludeNestedObjects = true, |
||
| EObjectFlags | ExclusionFlags = RF_NoFlags, |
||
| EInternalObjectFlags | ExclusionInternalFlags = EInternalObjectFlags::None |
||
| ) |
Performs an operation on objects with a given outer, with the possibility to break iteration Note that the operation must not modify the UObject hash maps so it can not create, rename or destroy UObjects.
| Outer | Outer to search for |
| Operation | Function to be called for each object, returning if we want to continue iteration or not |
| bIncludeNestedObjects | If true, then things whose outers directly or indirectly have Outer as an outer are included, these are the nested objects. |
| ExclusionFlags | Specifies flags to use as a filter for which objects to return |
| ExclusiveInternalFlags | Specifies internal flags to use as a filter for which objects to return |
| COREUOBJECT_API void ForEachObjectWithPackage | ( | const class UPackage * | Outer, |
| TFunctionRef< bool(UObject *)> | Operation, | ||
| bool | bIncludeNestedObjects = true, |
||
| EObjectFlags | ExclusionFlags = RF_NoFlags, |
||
| EInternalObjectFlags | ExclusionInternalFlags = EInternalObjectFlags::None |
||
| ) |
Performs an operation on all objects found within a given package Note that the operation must not modify UObject hash maps so it can not create, rename or destroy UObjects.
| Package | Package to iterate into |
| Operation | Function to be called for each object, return false to break out of the iteration |
| bIncludeNestedObjects | If true, then things whose outers directly or indirectly have Outer as an outer are included, these are the nested objects. |
| ExclusionFlags | Specifies flags to use as a filter for which objects to return |
| ExclusiveInternalFlags | Specifies internal flags to use as a filter for which objects to return |
| COREUOBJECT_API TMap< UClass *, TSet< UClass * > > GetAllDerivedClasses | ( | ) |
Get all base classes and their direct subclasses
| COREUOBJECT_API void GetDerivedClasses | ( | const UClass * | ClassToLookFor, |
| TArray< UClass * > & | Results, | ||
| bool | bRecursive = true |
||
| ) |
Returns an array of classes that were derived from the specified class.
| ClassToLookFor | The parent class of the classes to return. |
| Results | An output list of child classes of the specified parent class. |
| bRecursive | If true, the results will include children of the children classes, recursively. Otherwise, only direct decedents will be included. |
| UPackage * GetObjectExternalPackageInternal | ( | const class UObjectBase * | Object | ) |
Return the assigned external package of an object, if any
| Object | Object to get the external package of |
| UPackage * GetObjectExternalPackageThreadSafe | ( | const class UObjectBase * | Object | ) |
Return the assigned external package of an object, if any
| Object | Object to get the external package of |
| COREUOBJECT_API void GetObjectsOfClass | ( | const UClass * | ClassToLookFor, |
| TArray< UObject * > & | Results, | ||
| bool | bIncludeDerivedClasses = true, |
||
| EObjectFlags | ExcludeFlags = RF_ClassDefaultObject, |
||
| EInternalObjectFlags | ExclusionInternalFlags = EInternalObjectFlags::None |
||
| ) |
Returns an array of objects of a specific class. Optionally, results can include objects of derived classes as well.
| ClassToLookFor | Class of the objects to return. |
| Results | An output list of objects of the specified class. |
| bIncludeDerivedClasses | If true, the results will include objects of child classes as well. |
| AdditionalExcludeFlags | Objects with any of these flags will be excluded from the results. |
| ExclusiveInternalFlags | Specifies internal flags to use as a filter for which objects to return |
| COREUOBJECT_API void GetObjectsWithOuter | ( | const class UObjectBase * | Outer, |
| TArray< UObject * > & | Results, | ||
| bool | bIncludeNestedObjects = true, |
||
| EObjectFlags | ExclusionFlags = RF_NoFlags, |
||
| EInternalObjectFlags | ExclusionInternalFlags = EInternalObjectFlags::None |
||
| ) |
Return all objects with a given outer
| Outer | Outer to search for |
| Results | Returned results |
| bIncludeNestedObjects | If true, then things whose outers directly or indirectly have Outer as an outer are included, these are the nested objects. |
| ExclusionFlags | Specifies flags to use as a filter for which objects to return |
| ExclusiveInternalFlags | Specifies internal flags to use as a filter for which objects to return |
| COREUOBJECT_API void GetObjectsWithPackage | ( | const class UPackage * | Outer, |
| TArray< UObject * > & | Results, | ||
| bool | bIncludeNestedObjects = true, |
||
| EObjectFlags | ExclusionFlags = RF_NoFlags, |
||
| EInternalObjectFlags | ExclusionInternalFlags = EInternalObjectFlags::None |
||
| ) |
Returns an array of all objects found within a given package
| Package | Package to search into |
| Results | Array to put the results |
| bIncludeNestedObjects | If true, then things whose outers directly or indirectly have Outer as an outer are included, these are the nested objects. |
| ExclusionFlags | Specifies flags to use as a filter for which objects to return |
| ExclusiveInternalFlags | Specifies internal flags to use as a filter for which objects to return |
| COREUOBJECT_API uint64 GetRegisteredClassesVersionNumber | ( | ) |
Get a version number representing the current state of registered classes.
Can be stored and then compared to invalidate external caching of classes hierarchy whenever it changes.
| COREUOBJECT_API uint64 GetRegisteredNativeClassesVersionNumber | ( | ) |
Get a version number representing the current state of registered native classes.
Can be stored and then compared to invalidate external caching of native classes hierarchy whenever it changes.
| void HashObject | ( | class UObjectBase * | Object | ) |
Add an object to the name hash tables
| Object | Object to add to the hash tables |
| void HashObjectExternalPackage | ( | class UObjectBase * | Object, |
| class UPackage * | Package | ||
| ) |
Assign an external package directly to an object in the hash tables
| Object | Object to assign a package to |
| Package | Package to assign, null will call UnhashObjectExternalPackage |
| void LockUObjectHashTables | ( | ) |
Locks UObject hash tables so that other threads can't hash or find new UObjects
Prevents any other threads from finding/adding UObjects (e.g. while GC is running)
|
inline |
Logs out information about the total object hash memory usage for debug purposes
| Ar | the archive to write the log data to |
| bShowIndividualStats | whether to log each hash/map memory usage separately |
| COREUOBJECT_API void LogHashMemoryOverheadStatistics | ( | FOutputDevice & | Ar, |
| const EObjectMemoryOverheadOptions | InOptions | ||
| ) |
Logs out information about the total object hash memory usage for debug purposes
| Ar | the archive to write the log data to |
| InOptions | Logging options |
| COREUOBJECT_API void LogHashOuterStatistics | ( | FOutputDevice & | Ar, |
| const bool | bShowHashBucketCollisionInfo | ||
| ) |
Logs out information about the outer object hash for debug purposes
| Ar | the archive to write the log data to |
| bShowHashBucketCollisionInfo | whether to log each bucket's collision count |
| COREUOBJECT_API void LogHashStatistics | ( | FOutputDevice & | Ar, |
| const bool | bShowHashBucketCollisionInfo | ||
| ) |
Logs out information about the object hash for debug purposes
| Ar | the archive to write the log data to |
| bShowHashBucketCollisionInfo | whether to log each bucket's collision count |
| COREUOBJECT_API void ShrinkUObjectHashTables | ( | ) |
Shrink the UObject hash tables
| COREUOBJECT_API bool StaticFindAllObjectsFastInternal | ( | TArray< UObject * > & | OutFoundObjects, |
| const UClass * | ObjectClass, | ||
| FName | ObjectName, | ||
| EFindObjectFlags | Flags = EFindObjectFlags::None, |
||
| EObjectFlags | ExcludeFlags = RF_NoFlags, |
||
| EInternalObjectFlags | ExclusiveInternalFlags = EInternalObjectFlags::None |
||
| ) |
Private internal version of StaticFindAllObjectsFast that allows using 0 exclusion flags.
| OutFoundObjects | Array of objects matching the specified search parameters |
| ObjectClass | The to be found object's class |
| ObjectName | The to be found object's name |
| bExactClass | Whether to require an exact match with the passed in class |
| ExcludeFlags | Ignores objects that contain any of the specified exclusive flags |
| ExclusiveInternalFlags | Ignores objects that contain any of the specified internal exclusive flags |
If a class was specified, check that the object is of the correct class
Include (or not) pending kill objects
Ensure that the partial path provided matches the object found
| UE_NODEBUG UE_FORCEINLINE_HINT bool StaticFindAllObjectsFastInternal | ( | TArray< UObject * > & | OutFoundObjects, |
| const UClass * | ObjectClass, | ||
| FName | ObjectName, | ||
| ExactClassType | bExactClass, | ||
| EObjectFlags | ExcludeFlags = RF_NoFlags, |
||
| EInternalObjectFlags | ExclusiveInternalFlags = EInternalObjectFlags::None |
||
| ) |
| COREUOBJECT_API UObject * StaticFindFirstObjectFastInternal | ( | const UClass * | ObjectClass, |
| FName | ObjectName, | ||
| EFindObjectFlags | Flags = EFindObjectFlags::None, |
||
| EObjectFlags | ExcludeFlag = RF_NoFlags, |
||
| EInternalObjectFlags | ExclusiveInternalFlags = EInternalObjectFlags::None |
||
| ) |
Private internal version of StaticFindFirstObject that allows using 0 exclusion flags.
| ObjectClass | The to be found object's class |
| ObjectName | The to be found object's name |
| bExactClass | Whether to require an exact match with the passed in class |
| ExcludeFlag | Ignores objects that contain any of the specified exclusive flags |
| ExclusiveInternalFlags | Ignores objects that contain any of the specified internal exclusive flags |
If a class was specified, check that the object is of the correct class
Include (or not) pending kill objects
Ensure that the partial path provided matches the object found
| UE_NODEBUG UE_FORCEINLINE_HINT UObject * StaticFindFirstObjectFastInternal | ( | const UClass * | ObjectClass, |
| FName | ObjectName, | ||
| ExactClassType | bExactClass, | ||
| EObjectFlags | ExcludeFlag = RF_NoFlags, |
||
| EInternalObjectFlags | ExclusiveInternalFlags = EInternalObjectFlags::None |
||
| ) |
| UObject * StaticFindObjectFastExplicit | ( | const UClass * | ObjectClass, |
| FName | ObjectName, | ||
| const FString & | ObjectPathName, | ||
| EFindObjectFlags | Flags, | ||
| EObjectFlags | ExcludeFlags | ||
| ) |
Variation of StaticFindObjectFast that uses explicit path.
| ObjectClass | The to be found object's class |
| ObjectName | The to be found object's name |
| ObjectPathName | Full path name for the object to search for |
| ExactClass | Whether to require an exact match with the passed in class |
| ExclusiveFlags | Ignores objects that contain any of the specified exclusive flags |
Variation of StaticFindObjectFast that uses explicit path.
| ObjectClass | The to be found object's class |
| ObjectName | The to be found object's class |
| ObjectPathName | Full path name for the object to search for |
| ExactClass | Whether to require an exact match with the passed in class |
| ExclusiveFlags | Ignores objects that contain any of the specified exclusive flags |
| UE_NODEBUG UE_FORCEINLINE_HINT UObject * StaticFindObjectFastExplicit | ( | const UClass * | ObjectClass, |
| FName | ObjectName, | ||
| const FString & | ObjectPathName, | ||
| ExactClassType | bExactClass, | ||
| EObjectFlags | ExcludeFlags = RF_NoFlags |
||
| ) |
| COREUOBJECT_API UObject * StaticFindObjectFastInternal | ( | const UClass * | Class, |
| const UObject * | InOuter, | ||
| FName | InName, | ||
| EFindObjectFlags | Flags = EFindObjectFlags::None, |
||
| EObjectFlags | ExclusiveFlags = RF_NoFlags, |
||
| EInternalObjectFlags | ExclusiveInternalFlags = EInternalObjectFlags::None |
||
| ) |
Private internal version of StaticFindObjectFast that allows using 0 exclusion flags.
| Class | The to be found object's class |
| InOuter | The to be found object's outer |
| InName | The to be found object's class |
| ExactClass | Whether to require an exact match with the passed in class |
| ExclusiveFlags | Ignores objects that contain any of the specified exclusive flags |
| ExclusiveInternalFlags | Ignores objects that contain any of the specified internal exclusive flags |
| UE_NODEBUG UE_FORCEINLINE_HINT UObject * StaticFindObjectFastInternal | ( | const UClass * | Class, |
| const UObject * | InOuter, | ||
| FName | InName, | ||
| ExactClassType | bExactClass, | ||
| EObjectFlags | ExclusiveFlags = RF_NoFlags, |
||
| EInternalObjectFlags | ExclusiveInternalFlags = EInternalObjectFlags::None |
||
| ) |
| COREUOBJECT_API UObject * StaticFindObjectFastInternal | ( | FRemoteObjectId | RemoteId, |
| EObjectFlags | InExclusiveFlags = RF_NoFlags, |
||
| EInternalObjectFlags | InExlusiveInternalFlags = EInternalObjectFlags::None |
||
| ) |
Variation of StaticFindObjectFastInternal that uses remote id.
| RemoteId | The to be found object's remote id |
| InExclusiveFlags | Ignores objects that contain any of the specified exclusive flags |
| InExlusiveInternalFlags | Ignores objects that contain any of the specified internal exclusive flags |
| void UnhashObject | ( | UObjectBase * | Object | ) |
Remove an object to the name hash tables
| Object | Object to remove from the hash tables |
| void UnhashObjectExternalPackage | ( | class UObjectBase * | Object | ) |
Assign an external package directly to an object in the hash tables
| Object | Object to unassign a package from |