Navigation
Unreal Engine C++ API Reference > Runtime > CoreUObject > UObject
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UField
- UStruct
- UClass
- UBlueprintGeneratedClass
- UAnimBlueprintGeneratedClass
- UDisplayClusterBlueprintGeneratedClass
- URenderGridBlueprintGeneratedClass
- UOptimusValueContainerGeneratorClass
- UVerseClass
References
Module | CoreUObject |
Header | /Engine/Source/Runtime/CoreUObject/Public/UObject/Class.h |
Include | #include "UObject/Class.h" |
Syntax
class UClass : public UStruct
Remarks
An object class.
Variables
Type | Name | Description | |
---|---|---|---|
bool | bCooked | Used to check if the class was cooked or not | |
bool | bLayoutChanging | Used to check if the class layout is currently changing and therefore is not ready for a CDO to be created | |
EClassCastFlags | ClassCastFlags | Cast flags used to accelerate dynamic_cast |
|
FName | ClassConfigName | Which Name.ini file to load Config variables out of | |
ClassConstructorType | ClassConstructor | ||
TObjectPtr< UObject > | ClassDefaultObject | The class default object; used for delta serialization and object initialization | |
EClassFlags | ClassFlags | Class flags; See EClassFlags for more information | |
TObjectPtr< UObject > | ClassGeneratedBy | This is the blueprint that caused the generation of this class, or null if it is a native compiled-in class | |
TArray< FRepRecord > | ClassReps | List of replication records | |
int32 | ClassUnique | Class pseudo-unique counter; used to accelerate unique instance name generation | |
ClassVTableHelperCtorCallerType | ClassVTableHelperCtorCaller | ||
TObjectPtr< UClass > | ClassWithin | The required type for the outer of instances of this class | |
FUObjectCppClassStaticFunctions | CppClassStaticFunctions | ||
int32 | FirstOwnedClassRep | Index of the first ClassRep that belongs to this class. | |
TArray< FImplementedInterface > | Interfaces | The list of interfaces which this class implements, along with the pointer property that is located at the offset of the interface's vtable. | |
TArray< FNativeFunctionLookup > | NativeFunctionLookupTable | This class's native functions. | |
TArray< UField * > | NetFields | List of network relevant fields (functions) | |
FField * | PropertiesPendingDestruction | Linked list of properties to be destroyed when this class is destroyed that couldn't be destroyed in PurgeClass | |
UE::GC::FSchemaOwner | ReferenceSchema | GC schema, finalized in AssembleReferenceTokenStream | |
void * | SparseClassData | This is where we store the data that is only changed per class instead of per instance | |
TObjectPtr< UScriptStruct > | SparseClassDataStruct | The struct used to store sparse class data. |
Constructors
Type | Name | Description | |
---|---|---|---|
UClass
(
FVTableHelper& Helper |
DO NOT USE. This constructor is for internal usage only for hot-reload purposes. | ||
UClass
(
const FObjectInitializer& ObjectInitializer |
Constructors. | ||
UClass
(
const FObjectInitializer& ObjectInitializer, |
Create a new UClass given its superclass. | ||
UClass
(
EStaticConstructor, |
Called when statically linked. |
Destructors
Type | Name | Description | |
---|---|---|---|
~UClass () |
Destructor. |
Functions
Type | Name | Description | |
---|---|---|---|
void | __DefaultConstructor
(
const FObjectInitializer& X |
||
UObject * | __VTableCtorCaller
(
FVTableHelper& Helper |
||
void | AddDefaultSubobject
(
UObject* NewSubobject, |
Adds a new default instance map item | |
void | AddFunctionToFunctionMap
(
UFunction* Function, |
Add a function to the function map | |
void | AddNativeFunction
(
const WIDECHAR* InName, |
Add a native function to the internal native function table, but with a unicode name. | |
void | AddNativeFunction
(
const ANSICHAR* InName, |
Add a native function to the internal native function table | |
void | AddReferencedObjects
(
UObject* InThis, |
Callback used to allow an object to register its direct object references that are not already covered by the token stream. | |
void | AssembleReferenceTokenStream
(
bool bForce |
Assembles the token stream for realtime garbage collection by combining the per class only token stream for each class in the class hierarchy. | |
void | Assemble reference token streams for all classes if they haven't had it assembled already | ||
void | CallAddReferencedObjects
(
UObject* This, |
Calls AddReferencedObjects static method on the specified object. | |
void | CallAppendToClassSchema
(
FAppendToClassSchemaContext& Context |
Calls the c++ class's AppendToClassSchema static function | |
void | CallDeclareConstructClasses
(
TArray< FTopLevelAssetPath >& OutConstructClasses |
Calls the c++ class's DeclareConstructClasses static function (from the nearest native parent if this is not native) | |
void | CallDeclareCustomVersions
(
FArchive& Ar |
Calls the c++ class's DeclareCustomVersions static function (from the nearest native parent if this is not native) | |
bool | Some classes may not support creating assets of their type | ||
UE_INTERNAL bool | Returns true if an InstanceDataObject be created from an instance of this type. | ||
void | |||
void | Clears the function name caches, in case things have changed | ||
void | ClearSparseClassDataStruct
(
bool bInRecomplingOnLoad |
Clears the sparse class data struct for this and all child classes that directly reference it as a super-struct This will rename the current sparse class data struct aside into the transient package | |
void | ConditionalRecompileClass
(
FUObjectSerializeContext* InLoadContext |
Conditionally recompiles the class after loading, in case any dependencies were also newly loaded | |
FString | ConvertFullNameToShortTypeFullName
(
FStringView InFullName |
Takes a FullName (from e.g. AssetData.GetFullName or UObject.GetFullName) in either ShortTypeFullName or PathFullName form ShortTypeFullName: "ClassObjectName /PackagePath/PackageShortName.ObjectName:SubObjectName" PathFullName: "/ClassPath/ClassPackage.ClassObjectName /PackagePath/PackageShortName.ObjectName:SubObjectName" Converts it to ShortTypeFullName if not already in that format and returns it | |
FString | ConvertPathNameToShortTypeName
(
FStringView InClassPathOrShortTypeName |
Returns the ObjectName portion of a ClassPath name: "/Path/To.Object" is converted to "Object". | |
UObject * | Get the default object from the class, creating it if missing, if requested or under a few other circumstances | ||
void | CreateLinkAndAddChildFunctionsToMap
(
const FClassFunctionLinkInfo* Functions, |
||
void | CreatePersistentUberGraphFrame
(
UObject* Obj, |
Creates memory to store temporary data | |
void * | |||
void | DestroyPersistentUberGraphFrame
(
UObject* Obj, |
Clears memory to store temporary data | |
void | Destroys properties that couldn't be destroyed in PurgeClass | ||
UObject * | FindArchetype
(
const UClass* ArchetypeClass, |
Finds the object that is used as the parent object when serializing properties, overridden for blueprints | |
UClass * | FindCommonBase
(
const TArray< UClass* >& InClasses |
Finds the common base class that parents the array of classes passed in. | |
UClass * | FindCommonBase
(
UClass* InClassA, |
Finds the common base class that parents the two classes passed in. | |
UFunction * | FindFunctionByName
(
FName InName, |
Looks for a given function name | |
void | |||
void | GenerateFunctionList
(
TArray< FName >& OutArray |
||
UObject * | Returns archetype object for CDO | ||
const void * | Returns archetype for sparse class data | ||
const UClass * | |||
UClass * | If there are potentially multiple versions of this class (e.g. blueprint generated classes), this function will return the authoritative version, which should be used for references | ||
void | GetAutoCollapseCategories
(
TArray< FString >& OutAutoCollapseCategories |
||
void | GetAutoExpandCategories
(
TArray< FString >& OutAutoExpandCategories |
||
EClassFlags | Gets the class flags. | ||
void | GetClassGroupNames
(
TArray< FString >& OutClassGroupNames |
||
FTopLevelAssetPath | Returns class path name as a package + class FName pair | ||
const FString | Translates the hardcoded script config names (engine, editor, input and game) to their global pendants and otherwise uses config(myini) name to look for a game specific implementation and creates one based on the default if it doesn't exist yet. | ||
const ICppClassTypeInfo * | Provides access to C++ type info. | ||
T * | Get the default object from the class and cast to a particular type | ||
UObject * | GetDefaultObject
(
bool bCreateIfNeeded |
Get the default object from the class | |
FName | Get the name of the CDO for the this class | ||
void | GetDefaultObjectPreloadDependencies
(
TArray< UObject* >& OutDeps |
Returns all objects that should be preloaded before the class default object is serialized at load time. | |
void | GetDefaultObjectSubobjects
(
TArray< UObject* >& OutDefaultSubobjects |
Gets all default instanced objects (often components). | |
FFeedbackContext & | Feedback context for default property import | ||
int32 | Returns amount of memory used by default object | ||
UObject * | GetDefaultSubobjectByName
(
FName ToFind |
Searches for the default instanced object (often a component) by name | |
FString | |||
void | GetHideFunctions
(
TArray< FString >& OutHideFunctions |
Editor only properties. | |
void * | Returns a pointer to the sidecar data structure. | ||
UPackage * | |||
uint8 * | GetPersistentUberGraphFrame
(
UObject* Obj, |
Returns memory used to store temporary data on an instance, used by blueprints | |
void | GetPrioritizeCategories
(
TArray< FString >& OutPrioritizedCategories |
||
FTopLevelAssetPath | If this class was recompiled, returns the path to where we should find the new (i.e. reinstanced) class. | ||
FTopLevelAssetPath | Internal helper method for GetReinstancedClassPathName(). | ||
const void * | GetSparseClassData
(
const EGetSparseClassDataMethod GetMethod |
Returns a pointer to the sidecar data structure, based on the EGetSparseClassDataMethod. | |
UScriptStruct * | Returns the struct used by the sparse class data archetype | ||
UScriptStruct * | Returns a pointer to the type of the sidecar data structure if one is specified. | ||
UClass * | Returns parent class, the parent of a Class is always another class | ||
bool | HasAllCastFlags
(
EClassCastFlags FlagsToCheck |
||
bool | HasAllClassFlags
(
EClassFlags FlagsToCheck |
Used to safely check whether all of the passed in flags are set. | |
bool | HasAnyCastFlag
(
EClassCastFlags FlagToCheck |
Used to safely check whether the passed in flag is set. | |
bool | HasAnyClassFlags
(
EClassFlags FlagsToCheck |
Used to safely check whether the passed in flag is set. | |
bool | HasProperty
(
const FProperty* InProperty |
Checks if the property exists on this class or a parent class. | |
bool | ImplementsInterface
(
const UClass* SomeInterface |
This will return whether or not this class implements the passed in class / interface | |
void | InitPropertiesFromCustomList
(
uint8* DataPtr, |
Helper method to assist with initializing object properties from an explicit list. | |
bool | IsAutoCollapseCategory
(
const TCHAR* InCategory |
||
bool | IsAutoExpandCategory
(
const TCHAR* InCategory |
||
bool | IsClassGroupName
(
const TCHAR* InGroupName |
||
bool | IsFunctionHidden
(
const TCHAR* InFunction |
||
bool | IsFunctionImplementedInScript
(
FName InFunctionName |
Determines if the specified function has been implemented in a Blueprint | |
bool | IsPrioritizeCategory
(
const TCHAR* InCategory |
||
bool | IsSafeToSerializeToStructuredArchives
(
UClass* InClass |
Helper function for determining if the given class is compatible with structured archive serialization | |
bool | IsShortTypeName
(
FStringView ClassPathOrShortTypeName |
Returns whether the given stringview is in ShortTypeName form: No directory separators "/" or object separators ".", SUBOBJECT_DELIMITER Returns true for empty string. | |
bool | Returns whether the sparse class data on this instance overrides that of its archetype (in type or value) | ||
void | PostInitInstance
(
UObject* InObj, |
Called after PostInitProperties during object construction to allow class specific initialization of an object instance. | |
void | PostLoadDefaultObject
(
UObject* Object |
Wraps the PostLoad() call for the class default object. | |
void | PostLoadInstance
(
UObject* InObj |
Called during PostLoad of an object to allow class specific PostLoad operations of an object instance. | |
void | PurgeClass
(
bool bRecompilingOnLoad |
Purges out the properties of this class in preparation for it to be regenerated | |
void | RemoveFunctionFromFunctionMap
(
UFunction* Function |
Remove a function from the function map | |
void | SerializeDefaultObject
(
UObject* Object, |
Serializes the passed in object as this class's default object using the given archive | |
void | SerializeDefaultObject
(
UObject* Object, |
Serializes the passed in object as this class's default object using the given archive slot | |
void | Serializes the associated sparse class data for the passed in object using the given archive slot. | ||
void | SetCppTypeInfoStatic
(
const FCppClassTypeInfoStatic* InCppTypeInfoStatic |
Sets C++ type information. Should not be NULL. | |
void | SetSparseClassDataStruct
(
UScriptStruct* InSparseClassDataStruct |
||
void | SetupObjectInitializer
(
FObjectInitializer& ObjectInitializer |
Allows class to provide data to the object initializer that can affect how native class subobjects are created. | |
void | Initializes the ClassReps and NetFields arrays used by replication. | ||
UClass * | StaticClass () |
Returns a UClass object representing this class at runtime | |
EClassCastFlags | Returns the static cast flags for this class | ||
const TCHAR * | Returns the package this class belongs in | ||
void | |||
FTopLevelAssetPath | TryConvertShortTypeNameToPathName
(
const FString& InShortTypeName, |
Tries to convert short class name to class path name. | |
FTopLevelAssetPath | TryConvertShortTypeNameToPathName
(
UClass* TypeClass, |
Tries to convert short class name to class path name. | |
T * | TryFindTypeSlow
(
const FString& InShortNameOrPathName, |
Utility function that tries to find a type (class/struct/enum) given a path name or a short name however it will throw a warning (with a callstack) if it's the latter. | |
UField * | TryFindTypeSlow
(
UClass* TypeClass, |
Utility function that tries to find a type (class/struct/enum) given a path name or a short name however it will throw a warning (with a callstack) if it's the latter. | |
T * | TryFindTypeSlowSafe
(
const FString& InShortNameOrPathName, |
Utility function that tries to find a type (class/struct/enum) given a path name or a short name however it will throw a warning (with a callstack) if it's the latter. | |
UField * | TryFindTypeSlowSafe
(
UClass* TypeClass, |
Utility function that tries to find a type (class/struct/enum) given a path name or a short name however it will throw a warning (with a callstack) if it's the latter. | |
bool | TryFixShortClassNameExportPath
(
FString& InOutExportPathToFix, |
Tries to fix an export path containing short class name. |
Overridden from UStruct
Type | Name | Description | |
---|---|---|---|
const TCHAR * | GetPrefixCPP () |
Returns the struct/ class prefix used for the C++ declaration of this struct/ class. | |
bool | If true, this class has been cleaned and sanitized (trashed) and should not be used | ||
void | Creates the field/property links and gets structure ready for use at runtime | ||
void | SetSuperStruct
(
UStruct* NewSuperStruct |
Sets the super struct pointer and updates hash information as necessary. |
Overridden from UField
Type | Name | Description | |
---|---|---|---|
void | Bind () |
Find the class's native constructor. |
Overridden from UObject
Type | Name | Description | |
---|---|---|---|
void | Called to finish destroying the object. | ||
void | GetAssetRegistryTags
(
TArray< FAssetRegistryTag >& OutTags |
||
void | GetAssetRegistryTags
(
FAssetRegistryTagsContext Context |
Gathers a list of asset registry searchable tags which are name/value pairs with some type information This only needs to be implemented for asset objects | |
FString | GetDesc () |
Return a one line description of an object for viewing in the thumbnail view of the generic browser | |
void | GetPreloadDependencies
(
TArray< UObject* >& OutDeps |
Called during cooking. | |
FRestoreForUObjectOverwrite * | Save information for StaticAllocateObject in the case of overwriting an existing object. | ||
bool | IsAsset () |
Returns true if this object is considered an asset. | |
bool | IsNameStableForNetworking means an object can be referred to its path name (relative to outer) over the network | ||
void | Called after the C++ constructor and after the properties have been initialized, including those loaded from config. | ||
void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. | |
bool | Rename
(
const TCHAR* NewName, |
Rename this object to a unique name, or change its outer. | |
void | Handles reading, writing, and reference collecting using FArchive. | ||
void | TagSubobjects
(
EObjectFlags NewFlags |
Tags objects that are part of the same asset with the specified object flag, used for GC checking | |
void | ThreadedPostLoadAssetRegistryTagsOverride
(
FPostLoadAssetRegistryTagsContext& Context |
Performs fixup on loaded asset registry data. |
Overridden from UObjectBase
Type | Name | Description | |
---|---|---|---|
void | DeferredRegister
(
UClass* UClassStaticClass, |
Convert a boot-strap registered class into a real one, add to uobject array, etc |
Operators
Type | Name | Description | |
---|---|---|---|
void | operator delete
(
void* InMem |
Eliminate V1062 warning from PVS-Studio while keeping MSVC and Clang happy. | |
void * | operator new
(
const size_t InSize, |
For internal use only; use StaticConstructObject() to create new objects. | |
void * | operator new
(
const size_t InSize, |
For internal use only; use StaticConstructObject() to create new objects. |
Typedefs
Name | Description |
---|---|
ClassConstructorType | |
ClassVTableHelperCtorCallerType | |
StaticClassFunctionType | |
Super | Typedef for the base class (UStruct) |
ThisClass | Typedef for UClass. |
WithinClass | The required type of this object's outer (class UPackage) |
Constants
Name | Description |
---|---|
StaticClassFlags | Bitwise union of EClassFlags pertaining to this class. |