Language:
Discover
By Skill Level
By Category

TSubclassOf

Choose your OS:

Syntax

template<class TClass>
class TSubclassOf

Remarks

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

Constructors

Name Description

Public function

TSubclassOf()

Default Constructor, defaults to null

Public function

TSubclassOf

(
    UClass * 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

UClass *

 

Get()

Dereference back into a UClass

Public function

TClass *

 

GetDefaultObject()

Get the CDO if we are referencing a valid class

the CDO, or null if class is null

Operators

Name Description

Public function

 

operator UClass *()

Implicit conversion to UClass

Public function

UClass *

 

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=

(
    UClass * From
)

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

Public function

UClass *

 

operator->()

Dereference back into a UClass

References

Module

CoreUObject

Header

Runtime/CoreUObject/Public/Templates/Casts.h