TSubclassOf

Template to allow TClassType's to be passed around with type safety

Windows
MacOS
Linux

Inheritance Hierarchy

TSubclassOf

TNonNullSubclassOf

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/Templates/SubclassOf.h

Include

#include "Templates/SubclassOf.h"

Syntax

template<class TClass>
class TSubclassOf

Remarks

Template to allow TClassType's to be passed around with type safety

Constructors

Name Description

Public function

TSubclassOf()

Default Constructor, defaults to null

Public function

TSubclassOf

(
    TClassType* From
)

Constructor that takes a UClass and does a runtime check to make sure this is a compatible class

Public function

TSubclassOf

(
    const TSubclassOf< TClassA >& From
)

Copy Constructor, will only compile if types are compatible

Functions

Name Description

Public function Const

UClass *

 

DebugAccessRawClassPtr()

This is a DEVELOPMENT ONLY debugging function and should not be relied upon.

Public function Const

TClassType &...

 

Get()

Dereference back into a UClass

Public function Const

TClass *

 

GetDefaultObject()

Get the CDO if we are referencing a valid class

Operators

Name Description

Public function Const

 

operator TClassType *()

Implicit conversion to UClass

Public function Const

TClassType &...

 

operator*()

Dereference back into a UClass, does runtime type checking

Public function

TSubclassOf ...

 

operator=

(
    const TSubclassOf< TClassA >& From
)

Assignment operator, will only compile if types are compatible

Public function

TSubclassOf ...

 

operator=

(
    TClassType* From
)

Assignment operator from UClass, the type is checked on get not on set

Public function Const

TClassType &...

 

operator->()

Dereference back into a UClass

Typedefs

Name

Description

TBaseType

TClassType

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