FObjectInitializer

Internal class to finalize [UObject](API\Runtime\CoreUObject\UObject\UObject) creation (initialize properties) after the real C++ constructor is called.

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/UObjectGlobals.h

Include

#include "UObject/UObjectGlobals.h"

Syntax

class FObjectInitializer

Remarks

Internal class to finalize UObject creation (initialize properties) after the real C++ constructor is called.

Constructors

Name Description

Public function

FObjectInitializer()

Default Constructor, used when you are using the C++ "new" syntax.

Public function

FObjectInitializer

(
    UObject* InObj,
    const FStaticConstructObjectParamet...
)

Special constructor for static construct object internal that passes along the params block directly

Public function

FObjectInitializer

(
    UObject* InObj,
    UObject* InObjectArchetype,
    EObjectInitializerOptions InOptions,
    FObjectInstancingGraph* InInst...
)

Constructor

Public function

FObjectInitializer

(
    UObject* InObj,
    UObject* InObjectArchetype,
    bool bInCopyTransientsFromClassDefa...,
    bool bInShouldInitializeProps,
    FObjectInstancingGraph* InInst...
)

Use version that takes EObjectInitializerOptions

Destructors

Name Description

Public function

~FObjectInitializer()

Destructor for internal class to finalize UObject creation (initialize properties) after the real C++ constructor is called.

Functions

Name Description

Public function Static

void

 

AssertIfInConstructor

(
    UObject* Outer,
    const TCHAR* ErrorMessage
)

Asserts with the specified message if code is executed inside UObject constructor

Public function Const

UObject *...

 

CreateDefaultSubobject

(
    UObject* Outer,
    FName SubobjectFName,
    const UClass* ReturnType,
    const UClass* ClassToCreateByD...,
    bool bIsRequired,
    bool bIsTransient
)

Create a component or subobject

Public function Const

TReturnType ...

 

CreateDefaultSubobject

(
    UObject* Outer,
    FName SubobjectName,
    bool bTransient
)

Create a component or subobject

Public function Const

TReturnType ...

 

CreateDefaultSubobject

(
    UObject* Outer,
    FName SubobjectName,
    bool bTransient
)

Create a component or subobject

Public function Const

UObject *...

 

CreateEditorOnlyDefaultSubobject

(
    UObject* Outer,
    FName SubobjectName,
    const UClass* ReturnType,
    bool bTransient
)

Create a component or subobject only to be used with the editor.

Public function Const

TReturnType ...

 

CreateEditorOnlyDefaultSubobject

(
    UObject* Outer,
    FName SubobjectName,
    bool bTransient
)

Create a component or subobject only to be used with the editor.

Public function Const

TReturnType ...

 

CreateOptionalDefaultSubobject

(
    UObject* Outer,
    FName SubobjectName,
    bool bTransient
)

Create optional component or subobject.

Public function Const

const FObjec...

 

DoNotCreateDefaultSubobject

(
    FName SubobjectName
)

Indicates that a base class should not create a component

Public function Const

const FObjec...

 

DoNotCreateNestedDefaultSubobject

(
    FStringView SubobjectName
)

Indicates that a subobject should not create a component if created using CreateOptionalDefaultSubobject

Public function Const

const FObjec...

 

DoNotCreateNestedDefaultSubobject

(
    TArrayView< const FName > Subobject...
)

Indicates that a subobject should not create a component if created using CreateOptionalDefaultSubobject

Public function

void

 

FinalizeSubobjectClassInitialization()

Public function Static

FObjectIniti...

 

Get()

Gets ObjectInitializer for the currently constructed object.

Public function Const

UObject *...

 

GetArchetype()

Return the archetype that this object will copy properties from later

Public function Const

UClass *

 

GetClass()

Return the class of the object that is being constructed

Public function Const

UObject *...

 

GetObj()

Return the object that is being constructed

Public function Const

const FObjec...

 

SetDefaultSubobjectClass

(
    FName SubobjectName
)

Sets the class to use for a subobject defined in a base class, the class must be a subclass of the class used by the base class.

Public function Const

const FObjec...

 

SetDefaultSubobjectClass

(
    FName SubobjectName,
    const UClass* Class
)

Sets the class to use for a subobject defined in a base class, the class must be a subclass of the class used by the base class.

Public function Const

const FObjec...

 

SetNestedDefaultSubobjectClass

(
    FStringView SubobjectName
)

Sets the class to use for a subobject defined in a nested subobject, the class must be a subclass of the class used when calling CreateDefaultSubobject.

Public function Const

const FObjec...

 

SetNestedDefaultSubobjectClass

(
    TArrayView< const FName > Subobject...
)

Sets the class to use for a subobject defined in a nested subobject, the class must be a subclass of the class used when calling CreateDefaultSubobject.

Public function Const

const FObjec...

 

SetNestedDefaultSubobjectClass

(
    FStringView SubobjectName,
    const UClass* Class
)

Sets the class to use for a subobject defined in a nested subobject, the class must be a subclass of the class used when calling CreateDefaultSubobject.

Public function Const

const FObjec...

 

SetNestedDefaultSubobjectClass

(
    TArrayView< const FName > Subobject...,
    const UClass* Class
)

Sets the class to use for a subobject defined in a nested subobject, the class must be a subclass of the class used when calling CreateDefaultSubobject.

Deprecated Functions

Name Description

Public function

 

FObjectInitializer

(
    UObject* InObj,
    UObject* InObjectArchetype,
    bool bInCopyTransientsFromClassDefa...,
    bool bInShouldInitializeProps,
    FObjectInstancingGraph* InInst...
)

Use version that takes EObjectInitializerOptions

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