UClass

An object class.

Windows
MacOS
Linux

Inheritance Hierarchy

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

Name Description

Public variable

uint32: 1

 

bCooked

Used to check if the class was cooked or not

Public variable

ClassAddReferen...

 

ClassAddReferencedObjects

Pointer to a static AddReferencedObjects method.

Public variable

EClassCastFlags

 

ClassCastFlags

Cast flags used to accelerate dynamic_cast on objects of this type for common T

Public variable

FName

 

ClassConfigName

Which Name.ini file to load Config variables out of

Public variable

ClassConstructo...

 

ClassConstructor

Public variable

UObject *

 

ClassDefaultObject

The class default object; used for delta serialization and object initialization

Public variable

EClassFlags

 

ClassFlags

Class flags; See EClassFlags for more information

Public variable

UObject *

 

ClassGeneratedBy

This is the blueprint that caused the generation of this class, or null if it is a native compiled-in class

Public variable

TArray< FRepRec...

 

ClassReps

List of replication records

Public variable

uint32: 31

 

ClassUnique

Class pseudo-unique counter; used to accelerate unique instance name generation

Public variable

ClassVTableHelp...

 

ClassVTableHelperCtorCaller

Public variable

UClass *

 

ClassWithin

The required type for the outer of instances of this class

Public variable

int32

 

FirstOwnedClassRep

Index of the first ClassRep that belongs to this class.

Public variable

TArray< FImplem...

 

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.

Public variable

TArray< FNative...

 

NativeFunctionLookupTable

This class's native functions.

Public variable

TArray< UField ...

 

NetFields

List of network relevant fields (functions)

Public variable

FField *

 

PropertiesPendingDestruction

Linked list of properties to be destroyed when this class is destroyed that couldn't be destroyed in PurgeClass

Public variable

FGCReferenceTok...

 

ReferenceTokenStream

Reference token stream used by realtime garbage collector, finalized in AssembleReferenceTokenStream

Public variable

FCriticalSectio...

 

ReferenceTokenStreamCritical

CS for the token stream.

Protected variable

void *

 

SparseClassData

This is where we store the data that is only changed per class instead of per instance

Protected variable

UScriptStruct &...

 

SparseClassDataStruct

The struct used to store sparse class data.

Constructors

Name Description

Public function

UClass

(
    FVTableHelper& Helper
)

DO NOT USE. This constructor is for internal usage only for hot-reload purposes.

Public function

UClass

(
    const FObjectInitializer& ObjectIn...
)

Constructors.

Public function

UClass

(
    const FObjectInitializer& ObjectIn...,
    UClass* InSuperClass
)

Create a new UClass given its superclass.

Public function

UClass

(
    EStaticConstructor,
    FName InName,
    uint32 InSize,
    uint32 InAlignment,
    EClassFlags InClassFlags,
    EClassCastFlags InClassCastFlags,
    const TCHAR* InClassConfigName,
    EObjectFlags InFlags,
    ClassConstructorType InClassConstru...,
    ClassVTableHelperCtorCallerType InC...,
    ClassAddReferencedObjectsType InCla...
)

Called when statically linked.

Functions

Name Description

Public function Static

void

 

__DefaultConstructor

(
    const FObjectInitializer& X
)

Public function Static

UObject *...

 

__VTableCtorCaller

(
    FVTableHelper& Helper
)

Public function

void

 

AddDefaultSubobject

(
    UObject* NewSubobject,
    UClass* BaseClass
)

Adds a new default instance map item

Public function

void

 

AddFunctionToFunctionMap

(
    UFunction* Function,
    FName FuncName
)

Add a function to the function map

Public function

void

 

AddNativeFunction

(
    const WIDECHAR* InName,
    FNativeFuncPtr InPointer
)

Add a native function to the internal native function table, but with a unicode name.

Public function

void

 

AddNativeFunction

(
    const ANSICHAR* InName,
    FNativeFuncPtr InPointer
)

Add a native function to the internal native function table

Public function Static

void

 

AddReferencedObjects

(
    UObject* InThis,
    FReferenceCollector& Collector
)

Callback used to allow an object to register its direct object references that are not already covered by the token stream.

Public function

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.

Public function Static

void

 

AssembleReferenceTokenStreams()

Assemble reference token streams for all classes if they haven't had it assembled already

Public function Const

void

 

CallAddReferencedObjects

(
    UObject* This,
    FReferenceCollector& Collector
)

Calls AddReferencedObjects static method on the specified object.

Public function

void

 

ClearFunctionMapsCaches()

Clears the function name caches, in case things have changed

Public function Virtual

void

 

ConditionalRecompileClass

(
    FUObjectSerializeContext* InLo...
)

Conditionally recompiles the class after loading, in case any dependencies were also newly loaded

Protected function Virtual

UObject *...

 

CreateDefaultObject()

Get the default object from the class, creating it if missing, if requested or under a few other circumstances

Public function

void

 

CreateLinkAndAddChildFunctionsToMap

(
    const FClassFunctionLinkInfo* ...,
    uint32 NumFunctions
)

Public function Virtual Const

void

 

CreatePersistentUberGraphFrame

(
    UObject* Obj,
    bool bCreateOnlyIfEmpty,
    bool bSkipSuperClass,
    UClass* OldClass
)

Creates memory to store temporary data

Public function Virtual Const

void

 

DestroyPersistentUberGraphFrame

(
    UObject* Obj,
    bool bSkipSuperClass
)

Clears memory to store temporary data

Public function

void

 

DestroyPropertiesPendingDestruction()

Destroys properties that couldn't be destroyed in PurgeClass

Public function

void

 

EmitExternalPackageReference()

Realtime garbage collection helper function used to emit token containing information about an external package reference.

Public function

void

 

EmitFixedArrayBegin

(
    int32 Offset,
    const FName& DebugName,
    int32 Stride,
    int32 Count
)

Realtime garbage collection helper function used to indicate the beginning of a fixed array.

Public function

void

 

EmitFixedArrayEnd()

Realtime garbage collection helper function used to indicated the end of a fixed array.

Public function

void

 

EmitObjectArrayReference

(
    int32 Offset,
    const FName& DebugName
)

Realtime garbage collection helper function used to emit token containing information about a an array of UObject references at the passed in offset.

Public function

void

 

EmitObjectReference

(
    int32 Offset,
    const FName& DebugName,
    EGCReferenceType Kind
)

Realtime garbage collection helper function used to emit token containing information about a direct UObject reference at the passed in offset.

Public function

uint32

 

EmitStructArrayBegin

(
    int32 Offset,
    const FName& DebugName,
    int32 Stride
)

Realtime garbage collection helper function used to indicate an array of structs at the passed in offset.

Public function

void

 

EmitStructArrayEnd

(
    uint32 SkipIndexIndex
)

Realtime garbage collection helper function used to indicate the end of an array of structs.

Public function Virtual Const

UObject *...

 

FindArchetype

(
    const UClass* ArchetypeClass,
    const FName ArchetypeName
)

Finds the object that is used as the parent object when serializing properties, overridden for blueprints

Public function Static

UClass *

 

FindCommonBase

(
    UClass* InClassA,
    UClass* InClassB
)

Finds the common base class that parents the two classes passed in.

Public function Static

UClass *

 

FindCommonBase

(
    const TArray< UClass* >& InCl...
)

Finds the common base class that parents the array of classes passed in.

Public function Const

UFunction &#...

 

FindFunctionByName

(
    FName InName,
    EIncludeSuperFlag::Type IncludeSupe...
)

Looks for a given function name

Public function Virtual

void

 

FlushCompilationQueueForLevel()

Public function Const

void

 

GenerateFunctionList

(
    TArray< FName >& OutArray
)

Public function Virtual Const

UObject *...

 

GetArchetypeForCDO()

Returns archetype object for CDO

Public function Virtual Const

void *

 

GetArchetypeForSparseClassData()

Returns archetype for sparse class data

Public function 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

Public function Const

const UClass...

 

GetAuthoritativeClass()

Public function Const

void

 

GetAutoCollapseCategories

(
    TArray< FString >& OutAutoCollapse...
)

Public function Const

void

 

GetAutoExpandCategories

(
    TArray< FString >& OutAutoExpandCa...
)

Public function Const

EClassFlags

 

GetClassFlags()

Gets the class flags.

Public function Const

void

 

GetClassGroupNames

(
    TArray< FString >& OutClassGroupNa...
)

Public function Const

const FStrin...

 

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.

Public function Const

const ICppCl...

 

GetCppTypeInfo()

Provides access to C++ type info.

Public function Const

UObject *...

 

GetDefaultObject

(
    bool bCreateIfNeeded
)

Get the default object from the class

Public function Const

T *

 

GetDefaultObject()

Get the default object from the class and cast to a particular type

Public function Const

FName

 

GetDefaultObjectName()

Get the name of the CDO for the this class

Public function Virtual

void

 

GetDefaultObjectPreloadDependencies

(
    TArray< UObject* >& OutDeps
)

Returns all objects that should be preloaded before the class default object is serialized at load time.

Public function

void

 

GetDefaultObjectSubobjects

(
    TArray< UObject* >& OutDefaul...
)

Gets all default instanced objects (often components).

Public function Static

FFeedbackCon...

 

GetDefaultPropertiesFeedbackContext()

Feedback context for default property import

Public function

int32

 

GetDefaultsCount()

Returns amount of memory used by default object

Public function

UObject *...

 

GetDefaultSubobjectByName

(
    FName ToFind
)

Searches for the default instanced object (often a component) by name

Public function Const

FString

 

GetDescription()

Public function Const

void

 

GetHideFunctions

(
    TArray< FString >& OutHideFunction...
)

Editor only properties.

Public function

void *

 

GetOrCreateSparseClassData()

Returns a pointer to the sidecar data structure.

Public function Const

UPackage ...

 

GetOuterUPackage()

Public function Virtual Const

uint8 *

 

GetPersistentUberGraphFrame

(
    UObject* Obj,
    UFunction* FuncToCheck
)

Returns memory used to store temporary data on an instance, used by blueprints

Public function Const

UScriptStruc...

 

GetSparseClassDataArchetypeStruct()

Returns the struct used by the sparse class data archetype

Public function Const

UClass *

 

GetSuperClass()

Returns parent class, the parent of a Class is always another class

Public function Const

bool

 

HasAllCastFlags

(
    EClassCastFlags FlagsToCheck
)

Public function Const

bool

 

HasAllClassFlags

(
    EClassFlags FlagsToCheck
)

Used to safely check whether all of the passed in flags are set.

Public function Const

bool

 

HasAnyCastFlag

(
    EClassCastFlags FlagToCheck
)

Used to safely check whether the passed in flag is set.

Public function Const

bool

 

HasAnyClassFlags

(
    EClassFlags FlagsToCheck
)

Used to safely check whether the passed in flag is set.

Public function Virtual Const

bool

 

HasProperty

(
    FProperty* InProperty
)

Checks if the property exists on this class or a parent class.

Public function

bool

 

HotReloadPrivateStaticClass

(
    uint32 InSize,
    EClassFlags InClassFlags,
    EClassCastFlags InClassCastFlags,
    const TCHAR* InConfigName,
    ClassConstructorType InClassConstru...,
    ClassVTableHelperCtorCallerType InC...,
    ClassAddReferencedObjectsType InCla...,
    UClass* TClass_Super_StaticCla...,
    UClass* TClass_WithinClass_Sta...
)

Called when a class is reloading from a DLL...updates various information in-place.

Public function Const

bool

 

ImplementsInterface

(
    const UClass* SomeInterface
)

This will return whether or not this class implements the passed in class / interface

Public function Virtual

void

 

InitPropertiesFromCustomList

(
    uint8* DataPtr,
    const uint8* DefaultDataPtr
)

Helper method to assist with initializing object properties from an explicit list.

Public function Const

bool

 

IsAutoCollapseCategory

(
    const TCHAR* InCategory
)

Public function Const

bool

 

IsAutoExpandCategory

(
    const TCHAR* InCategory
)

Public function Const

bool

 

IsClassGroupName

(
    const TCHAR* InGroupName
)

Public function Const

bool

 

IsFunctionHidden

(
    const TCHAR* InFunction
)

Public function Virtual Const

bool

 

IsFunctionImplementedInScript

(
    FName InFunctionName
)

Determines if the specified function has been implemented in a Blueprint

Public function Static

bool

 

IsSafeToSerializeToStructuredArchives

(
    UClass* InClass
)

Helper function for determining if the given class is compatible with structured archive serialization

Public function Virtual

void

 

PostInitInstance

(
    UObject* InObj
)

Called after PostInitProperties during object construction to allow class specific initialization of an object instance.

Public function Virtual

void

 

PostLoadDefaultObject

(
    UObject* Object
)

Wraps the PostLoad() call for the class default object.

Public function Virtual

void

 

PurgeClass

(
    bool bRecompilingOnLoad
)

Purges out the properties of this class in preparation for it to be regenerated

Public function

void

 

RemoveFunctionFromFunctionMap

(
    UFunction* Function
)

Remove a function from the function map

Public function

bool

 

ReplaceNativeFunction

(
    FName InName,
    FNativeFuncPtr InPointer,
    bool bAddToFunctionRemapTable
)

Replace a native function in the internal native function table

Public function Virtual

void

 

SerializeDefaultObject

(
    UObject* Object,
    FArchive& Ar
)

Serializes the passed in object as this class's default object using the given archive

Public function Virtual

void

 

SerializeDefaultObject

(
    UObject* Object,
    FStructuredArchive::FSlot Slot
)

Serializes the passed in object as this class's default object using the given archive slot

Public function

void

 

SerializeSparseClassData

(
    FStructuredArchive::FSlot Slot
)

Serializes the associated sparse class data for the passed in object using the given archive slot.

Public function

void

 

SetCppTypeInfoStatic

(
    const FCppClassTypeInfoStatic*...
)

Sets C++ type information. Should not be NULL.

Public function

void

 

SetSparseClassDataStruct

(
    UScriptStruct* InSparseClassDa...
)

Public function Virtual Const

void

 

SetupObjectInitializer

(
    FObjectInitializer& ObjectInitiali...
)

Allows class to provide data to the object initializer that can affect how native class subobjects are created.

Public function

void

 

SetUpRuntimeReplicationData()

Initializes the ClassReps and NetFields arrays used by replication.

Public function Static

UClass *

 

StaticClass()

Returns a UClass object representing this class at runtime

Public function Static

EClassCastFl...

 

StaticClassCastFlags()

Returns the static cast flags for this class

Public function Static

const TCHAR ...

 

StaticPackage()

Returns the package this class belongs in

Public function Static

void

 

StaticRegisterNativesUClass()

Overridden from UStruct

Name Description

Public function Virtual Const

const TCHAR ...

 

GetPrefixCPP()

Returns the struct/ class prefix used for the C++ declaration of this struct/ class.

Public function Virtual Const

bool

 

IsStructTrashed()

If true, this class has been cleaned and sanitized (trashed) and should not be used

Public function Virtual

void

 

Link

(
    FArchive& Ar,
    bool bRelinkExistingProperties
)

Creates the field/property links and gets structure ready for use at runtime

Public function Virtual

void

 

SetSuperStruct

(
    UStruct* NewSuperStruct
)

Sets the super struct pointer and updates hash information as necessary.

Overridden from UField

Name Description

Public function Virtual

void

 

Bind()

Find the class's native constructor.

Overridden from UObject

Name Description

Public function Virtual

void

 

FinishDestroy()

Called to finish destroying the object.

Public function Virtual Const

void

 

GetAssetRegistryTags

(
    TArray< FAssetRegistryTag >& OutTa...
)

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

Public function Virtual

FString

 

GetDesc()

Return a one line description of an object for viewing in the thumbnail view of the generic browser

Public function Virtual

FRestoreForU...

 

GetRestoreForUObjectOverwrite()

Save information for StaticAllocateObject in the case of overwriting an existing object.

Public function Virtual Const

UScriptStruc...

 

GetSparseClassDataStruct()

Returns a pointer to the type of the sidecar data structure if one is specified.

Public function Virtual Const

bool

 

IsAsset()

Returns true if this object is considered an asset.

Public function Virtual Const

bool

 

IsNameStableForNetworking()

IsNameStableForNetworking means an object can be referred to its path name (relative to outer) over the network

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

bool

 

Rename

(
    const TCHAR* NewName,
    UObject* NewOuter,
    ERenameFlags Flags
)

Rename this object to a unique name, or change its outer.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Public function Virtual

void

 

TagSubobjects

(
    EObjectFlags NewFlags
)

Tags objects that are part of the same asset with the specified object flag, used for GC checking

Overridden from UObjectBase

Name Description

Public function Virtual

void

 

DeferredRegister

(
    UClass* UClassStaticClass,
    const TCHAR* PackageName,
    const TCHAR* Name
)

Convert a boot-strap registered class into a real one, add to uobject array, etc

Operators

Name Description

Public function

void *

 

operator new

(
    const size_t InSize,
    EInternal* InMem
)

For internal use only; use StaticConstructObject() to create new objects.

Public function

void *

 

operator new

(
    const size_t InSize,
    EInternal InInternalOnly,
    UObject* InOuter,
    FName InName,
    EObjectFlags InSetFlags
)

For internal use only; use StaticConstructObject() to create new objects.

Typedefs

Name

Description

ClassAddReferencedObjectsType

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.

Deprecated Functions

Name Description

Public function Const

bool

 

IsFunctionImplementedInBlueprint

(
    FName InFunctionName
)

IsFunctionImplementedInBlueprint is deprecated, call IsFunctionImplementedInScript instead

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss