Navigation
API > API/Runtime > API/Runtime/CoreUObject
An object class.
| Name | UClass |
| Type | class |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/UObject/Class.h |
| Include Path | #include "UObject/Class.h" |
Syntax
UCLASS (MinimalAPI, Within=Package, Config=Engine)
class UClass : public UStruct
Inheritance Hierarchy
- FStructBaseChain → UStruct → UClass
- UObjectBase → UObjectBaseUtility → UObject → UField → UStruct → UClass
Derived Classes
- UBlueprintGeneratedClass
- UOptimusValueContainerGeneratorClass
- URigVMMemoryStorageGeneratorClass
- UVerseClass
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UClass
(
const FObjectInitializer& ObjectInitializer, |
Create a new UClass given its superclass. | UObject/Class.h | |
UClass
(
const FObjectInitializer& ObjectInitializer |
Constructors. | UObject/Class.h | |
UClass
(
EStaticConstructor, |
Called when statically linked. | UObject/Class.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~UClass() |
Destructor. | UObject/Class.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| ClassConstructorType | void(*) | UObject/Class.h | |
| ClassVTableHelperCtorCallerType | UObject *(*) | UObject/Class.h | |
| StaticClassFunctionType | UClass *(*) | UObject/Class.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bCooked | bool | Used to check if the class was cooked or not | UObject/Class.h | |
| bLayoutChanging | bool | Used to check if the class layout is currently changing and therefore is not ready for a CDO to be created | UObject/Class.h | |
| ClassCastFlags | EClassCastFlags | Cast flags used to accelerate dynamic_cast |
UObject/Class.h | |
| ClassConfigName | FName | Which Name.ini file to load Config variables out of | UObject/Class.h | |
| ClassConstructor | ClassConstructorType | UObject/Class.h | ||
| ClassDefaultObject | TObjectPtr< UObject > | The class default object; used for delta serialization and object initialization | UObject/Class.h |
|
| ClassFlags | EClassFlags | Class flags; See EClassFlags for more information | UObject/Class.h | |
| ClassGeneratedBy | TObjectPtr< UObject > | This is the blueprint that caused the generation of this class, or null if it is a native compiled-in class | UObject/Class.h |
|
| ClassReps | TArray< FRepRecord > | List of replication records | UObject/Class.h | |
| ClassUnique | int32 | Class pseudo-unique counter; used to accelerate unique instance name generation | UObject/Class.h | |
| ClassVTableHelperCtorCaller | ClassVTableHelperCtorCallerType | UObject/Class.h | ||
| ClassWithin | TObjectPtr< UClass > | The required type for the outer of instances of this class | UObject/Class.h |
|
| CppClassStaticFunctions | FUObjectCppClassStaticFunctions | UObject/Class.h | ||
| FirstOwnedClassRep | int32 | Index of the first ClassRep that belongs to this class. | UObject/Class.h | |
| Interfaces | TArray< FImplementedInterface > | The list of interfaces which this class implements, along with the pointer property that is located at the offset of the interface's vtable. | UObject/Class.h | |
| NativeFunctionLookupTable | TArray< FNativeFunctionLookup > | This class's native functions. | UObject/Class.h | |
| NetFields | TArray< TObjectPtr< UField > > | List of network relevant fields (functions) | UObject/Class.h |
|
| PropertiesPendingDestruction | FField * | Linked list of properties to be destroyed when this class is destroyed that couldn't be destroyed in PurgeClass | UObject/Class.h | |
| ReferenceSchema | UE::GC::FSchemaOwner | GC schema, finalized in AssembleReferenceTokenStream | UObject/Class.h | |
| UClass | union UClass | UObject/Class.h | ||
| UClass | union UClass | UObject/Class.h | ||
| UClass | union UClass | UObject/Class.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AllFunctionsCache | TMap< FName, UFunction * > | A cache of all functions by name that exist in this class or a parent (superclass or interface) context | UObject/Class.h | |
| AllFunctionsCacheLock | FUClassFuncLock | Scope lock to avoid the SuperFuncMap being read and written to simultaneously on multiple threads. | UObject/Class.h | |
| CppTypeInfo | TOptional< FCppClassTypeInfo > | Provides access to attributes of the underlying C++ class. Should never be unset. | UObject/Class.h | |
| FuncMap | TMap< FName, TObjectPtr< UFunction > > | Map of all functions by name contained in this class | UObject/Class.h | |
| FuncMapLock | FUClassFuncLock | Scope lock to avoid the FuncMap being read and written to simultaneously on multiple threads. | UObject/Class.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Adds a new default instance map item | UObject/Class.h | ||
| Add a function to the function map | UObject/Class.h | ||
void AddNativeFunction
(
const WIDECHAR* InName, |
Add a native function to the internal native function table, but with a unicode name. | UObject/Class.h | |
void AddNativeFunction
(
const ANSICHAR* InName, |
Add a native function to the internal native function table | UObject/Class.h | |
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. | UObject/Class.h | |
void CallAddReferencedObjects
(
UObject* This, |
Calls AddReferencedObjects static method on the specified object. | UObject/Class.h | |
void CallAppendToClassSchema
(
FAppendToClassSchemaContext& Context |
Calls the c++ class's AppendToClassSchema static function | UObject/Class.h | |
void CallDeclareConstructClasses
(
TArray< FTopLevelAssetPath >& OutConstructClasses |
Calls the c++ class's DeclareConstructClasses static function (from the nearest native parent if this is not native) | UObject/Class.h | |
void CallDeclareCustomVersions
(
FArchive& Ar |
Calls the c++ class's DeclareCustomVersions static function (from the nearest native parent if this is not native) | UObject/Class.h | |
virtual bool CanCreateAssetOfClass() |
Some classes may not support creating assets of their type | UObject/Class.h | |
virtual bool CanCreateInstanceDataObject() |
Returns true if an InstanceDataObject be created from an instance of this type. | UObject/Class.h | |
bool CheckDefaultObjectIsValidLowLevelFast
(
const int32 AlignmentCheck |
Checks if the class default object is valid (not null and its address is a properly aligned pointer) | UObject/Class.h | |
void ClearFunctionMapsCaches() |
Clears the function name caches, in case things have changed | UObject/Class.h | |
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 | UObject/Class.h | |
virtual void ConditionalRecompileClass
(
FUObjectSerializeContext* InLoadContext |
Conditionally recompiles the class after loading, in case any dependencies were also newly loaded | UObject/Class.h | |
void CreateLinkAndAddChildFunctionsToMap
(
const FClassFunctionLinkInfo* Functions, |
UObject/Class.h | ||
| Creates memory to store temporary data | UObject/Class.h | ||
virtual void DestroyPersistentUberGraphFrame
(
UObject* Obj, |
Clears memory to store temporary data | UObject/Class.h | |
void DestroyPropertiesPendingDestruction() |
Destroys properties that couldn't be destroyed in PurgeClass | UObject/Class.h | |
| Finds the object that is used as the parent object when serializing properties, overridden for blueprints | UObject/Class.h | ||
UFunction * FindFunctionByName
(
FName InName, |
Looks for a given function name | UObject/Class.h | |
virtual void FlushCompilationQueueForLevel() |
UObject/Class.h | ||
| UObject/Class.h | |||
virtual UObject * GetArchetypeForCDO() |
Returns archetype object for CDO | UObject/Class.h | |
const void * GetArchetypeForSparseClassData
(
const EGetSparseClassDataMethod GetMethod |
Returns archetype for sparse class data | UObject/Class.h | |
virtual UClass * GetAuthoritativeClass () |
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 | UObject/Class.h | |
const UClass * GetAuthoritativeClass () |
UObject/Class.h | ||
| UObject/Class.h | |||
| UObject/Class.h | |||
EClassFlags GetClassFlags() |
Gets the class flags. | UObject/Class.h | |
| UObject/Class.h | |||
FTopLevelAssetPath GetClassPathName() |
Returns class path name as a package + class FName pair | UObject/Class.h | |
const FString GetConfigName() |
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. | UObject/Class.h | |
const ICppClassTypeInfo * GetCppTypeInfo() |
Provides access to C++ type info. | UObject/Class.h | |
T * GetDefaultObject () |
Get the default object from the class and cast to a particular type | UObject/Class.h | |
UObject * GetDefaultObject
(
bool bCreateIfNeeded |
Get the default object from the class | UObject/Class.h | |
FName GetDefaultObjectName() |
Get the name of the CDO for the this class | UObject/Class.h | |
virtual void GetDefaultObjectPreloadDependencies
(
TArray< UObject* >& OutDeps |
Returns all objects that should be preloaded before the class default object is serialized at load time. | UObject/Class.h | |
| Gets all default instanced objects (often components). | UObject/Class.h | ||
int32 GetDefaultsCount() |
Returns amount of memory used by default object | UObject/Class.h | |
| Searches for the default instanced object (often a component) by name | UObject/Class.h | ||
FString GetDescription() |
UObject/Class.h | ||
| Editor only properties. | UObject/Class.h | ||
void * GetOrCreateSparseClassData () |
Returns a pointer to the sidecar data structure. | UObject/Class.h | |
| Returns memory used to store temporary data on an instance, used by blueprints | UObject/Class.h | ||
| UObject/Class.h | |||
virtual EStructPropertyLinkFlags GetPropertyLinkFlags
(
UStruct* ContainerStruct, |
UObject/Class.h | ||
| If this class was recompiled, returns the path to where we should find the new (i.e. reinstanced) class. | UObject/Class.h | ||
const void * GetSparseClassData
(
const EGetSparseClassDataMethod GetMethod |
Returns a pointer to the sidecar data structure, based on the EGetSparseClassDataMethod. | UObject/Class.h | |
UScriptStruct * GetSparseClassDataArchetypeStruct() |
Returns the struct used by the sparse class data archetype | UObject/Class.h | |
UScriptStruct * GetSparseClassDataStruct() |
Returns a pointer to the type of the sidecar data structure if one is specified. | UObject/Class.h | |
UClass * GetSuperClass() |
Returns parent class, the parent of a Class is always another class | UObject/Class.h | |
bool HasAllCastFlags
(
EClassCastFlags FlagsToCheck |
UObject/Class.h | ||
bool HasAllClassFlags
(
EClassFlags FlagsToCheck |
Used to safely check whether all of the passed in flags are set. | UObject/Class.h | |
bool HasAnyCastFlag
(
EClassCastFlags FlagToCheck |
Used to safely check whether the passed in flag is set. | UObject/Class.h | |
bool HasAnyClassFlags
(
EClassFlags FlagsToCheck |
Used to safely check whether the passed in flag is set. | UObject/Class.h | |
virtual bool HasProperty
(
const FProperty* InProperty |
Checks if the property exists on this class or a parent class. | UObject/Class.h | |
bool HotReloadPrivateStaticClass
(
uint32 InSize, |
Called when a class is reloading from a DLL...updates various information in-place. | UObject/Class.h | |
bool ImplementsInterface
(
const UClass* SomeInterface |
This will return whether or not this class implements the passed in class / interface | UObject/Class.h | |
virtual void InitPropertiesFromCustomList
(
uint8* DataPtr, |
Helper method to assist with initializing object properties from an explicit list. | UObject/Class.h | |
bool IsAutoCollapseCategory
(
const TCHAR* InCategory |
UObject/Class.h | ||
bool IsAutoExpandCategory
(
const TCHAR* InCategory |
UObject/Class.h | ||
bool IsClassGroupName
(
const TCHAR* InGroupName |
UObject/Class.h | ||
bool IsFunctionHidden
(
const TCHAR* InFunction |
UObject/Class.h | ||
virtual bool IsFunctionImplementedInScript
(
FName InFunctionName |
Determines if the specified function has been implemented in a Blueprint | UObject/Class.h | |
bool IsPrioritizeCategory
(
const TCHAR* InCategory |
UObject/Class.h | ||
bool OverridesSparseClassDataArchetype() |
Returns whether the sparse class data on this instance overrides that of its archetype (in type or value) | UObject/Class.h | |
virtual void PostInitInstance
(
UObject* InObj, |
Called after PostInitProperties during object construction to allow class specific initialization of an object instance. | UObject/Class.h | |
virtual void PostLoadDefaultObject
(
UObject* Object |
Wraps the PostLoad() call for the class default object. | UObject/Class.h | |
virtual void PostLoadInstance
(
UObject* InObj |
Called during PostLoad of an object to allow class specific PostLoad operations of an object instance. | UObject/Class.h | |
virtual void PurgeClass
(
bool bRecompilingOnLoad |
Purges out the properties of this class in preparation for it to be regenerated | UObject/Class.h | |
void RemoveFunctionFromFunctionMap
(
UFunction* Function |
Remove a function from the function map | UObject/Class.h | |
bool ReplaceNativeFunction
(
FName InName, |
Replace a native function in the internal native function table | UObject/Class.h | |
virtual void SerializeDefaultObject
(
UObject* Object, |
Serializes the passed in object as this class's default object using the given archive slot | UObject/Class.h | |
virtual void SerializeDefaultObject
(
UObject* Object, |
Serializes the passed in object as this class's default object using the given archive | UObject/Class.h | |
void SerializeSparseClassData
(
FStructuredArchive::FSlot Slot |
Serializes the associated sparse class data for the passed in object using the given archive slot. | UObject/Class.h | |
void SetCppTypeInfoStatic
(
const FCppClassTypeInfoStatic* InCppTypeInfoStatic |
Sets C++ type information. Should not be NULL. | UObject/Class.h | |
void SetDefaultObject
(
UObject* InClassDefaultObject |
Get the immutable default object from the class | UObject/Class.h | |
void SetSparseClassDataStruct
(
UScriptStruct* InSparseClassDataStruct |
UObject/Class.h | ||
virtual void SetupObjectInitializer
(
FObjectInitializer& ObjectInitializer |
Allows class to provide data to the object initializer that can affect how native class subobjects are created. | UObject/Class.h | |
void SetUpRuntimeReplicationData () |
Initializes the ClassReps and NetFields arrays used by replication. | UObject/Class.h | |
bool ShouldUseDynamicSubobjectInstancing() |
Returns true if the object instancing graph should analyze default data at runtime to determine which of its object properties need to be instanced at construction time, rather than exclusively relying on reflected property semantics. | UObject/Class.h |
Overridden from UStruct
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool ActivateTrackingPropertyValueFlag
(
EPropertyValueFlags Flags, |
Try to activate tracking of this type of flag for the instance. | UObject/Class.h | |
virtual const TCHAR * GetPrefixCPP () |
Returns the struct/ class prefix used for the C++ declaration of this struct/ class. | UObject/Class.h | |
virtual bool HasPropertyValueFlag
(
EPropertyValueFlags Flags, |
Query whether the instance has the flag set for the property. True if tracking is inactive. | UObject/Class.h | |
virtual bool IsStructTrashed() |
If true, this class has been cleaned and sanitized (trashed) and should not be used | UObject/Class.h | |
virtual bool IsTrackingPropertyValueFlag
(
EPropertyValueFlags Flags, |
Query whether the instance is tracking this type of flag. | UObject/Class.h | |
virtual void Link
(
FArchive& Ar, |
Creates the field/property links and gets structure ready for use at runtime | UObject/Class.h | |
virtual void ResetPropertyValueFlags
(
EPropertyValueFlags Flags, |
Reset the flag to false for every property on the instance. | UObject/Class.h | |
virtual void SerializePropertyValueFlags
(
EPropertyValueFlags Flags, |
Serialize the flag for every property on the instance. NOT FOR PERSISTENT SERIALIZATION! | UObject/Class.h | |
virtual void SetPropertyValueFlag
(
EPropertyValueFlags Flags, |
Set the value of the flag for the property on the instance. Ignored if tracking is inactive. | UObject/Class.h | |
virtual void SetSuperStruct
(
UStruct* NewSuperStruct |
Sets the super struct pointer and updates hash information as necessary. | UObject/Class.h |
Overridden from UField
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Bind() |
Find the class's native constructor. | UObject/Class.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void FinishDestroy () |
Called to finish destroying the object. | UObject/Class.h | |
virtual 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 | UObject/Class.h | |
virtual void GetAssetRegistryTags
(
TArray< FAssetRegistryTag >& OutTags |
UObject/Class.h | ||
virtual FString GetDesc() |
Return a one line description of an object for viewing in the thumbnail view of the generic browser | UObject/Class.h | |
virtual void GetPreloadDependencies
(
TArray< UObject* >& OutDeps |
Called during cooking. | UObject/Class.h | |
virtual FRestoreForUObjectOverwrite * GetRestoreForUObjectOverwrite () |
Save information for StaticAllocateObject in the case of overwriting an existing object. | UObject/Class.h | |
virtual bool IsAsset() |
Returns true if this object is considered an asset. | UObject/Class.h | |
virtual bool IsNameStableForNetworking() |
IsNameStableForNetworking means an object can be referred to its path name (relative to outer) over the network | UObject/Class.h | |
virtual void PostInitProperties () |
Called after the C++ constructor and after the properties have been initialized, including those loaded from config. | UObject/Class.h | |
virtual void PostLoad () |
Do any object-specific cleanup required immediately after loading an object. | UObject/Class.h | |
| Rename this object to a unique name, or change its outer. | UObject/Class.h | ||
| Handles reading, writing, and reference collecting using FArchive. | UObject/Class.h | ||
virtual void TagSubobjects
(
EObjectFlags NewFlags |
Tags objects that are part of the same asset with the specified object flag, used for GC checking | UObject/Class.h |
Overridden from UObjectBase
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void DeferredRegister
(
UClass* UClassStaticClass, |
Convert a boot-strap registered class into a real one, add to uobject array, etc | UObject/Class.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void CleanupSparseClassData() |
UObject/Class.h | ||
virtual UObject * CreateDefaultObject() |
Get the default object from the class, creating it if missing, if requested or under a few other circumstances | UObject/Class.h | |
void * CreateSparseClassData() |
UObject/Class.h | ||
| Internal helper method for GetReinstancedClassPathName(). | UObject/Class.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ThreadedPostLoadAssetRegistryTagsOverride
(
FPostLoadAssetRegistryTagsContext& Context |
Performs fixup on loaded asset registry data. | UObject/Class.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static 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. | UObject/Class.h | |
static void AssembleReferenceTokenStreams() |
Assemble reference token streams for all classes if they haven't had it assembled already | UObject/Class.h | |
static 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 | UObject/Class.h | |
static FString ConvertPathNameToShortTypeName
(
FStringView InClassPathOrShortTypeName |
Returns the ObjectName portion of a ClassPath name: "/Path/To.Object" is converted to "Object". | UObject/Class.h | |
static UClass * FindCommonBase
(
UClass* InClassA, |
Finds the common base class that parents the two classes passed in. | UObject/Class.h | |
static UClass * FindCommonBase
(
const TArray< UClass* >& InClasses |
Finds the common base class that parents the array of classes passed in. | UObject/Class.h | |
static FFeedbackContext & GetDefaultPropertiesFeedbackContext() |
Feedback context for default property import | UObject/Class.h | |
static bool IsSafeToSerializeToStructuredArchives
(
UClass* InClass |
Helper function for determining if the given class is compatible with structured archive serialization | UObject/Class.h | |
static 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. | UObject/Class.h | |
static FTopLevelAssetPath TryConvertShortTypeNameToPathName
(
UClass* TypeClass, |
Tries to convert short class name to class path name. | UObject/Class.h | |
static FTopLevelAssetPath TryConvertShortTypeNameToPathName
(
FStringView InShortTypeName, |
Tries to convert short class name to class path name. | UObject/Class.h | |
static T * TryFindTypeSlow
(
FStringView 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. | UObject/Class.h | |
static 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. | UObject/Class.h | |
static T * TryFindTypeSlowSafe
(
FStringView 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. | UObject/Class.h | |
static 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. | UObject/Class.h | |
static bool TryFixShortClassNameExportPath
(
FString& InOutExportPathToFix, |
Tries to fix an export path containing short class name. | UObject/Class.h |