FObjectInitializer

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

Windows
MacOS
Linux

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,
    UObject* InObjectArchetype,
    bool bInCopyTransientsFromClassDefa...,
    bool bInShouldInitializeProps,
    FObjectInstancingGraph* InInst...
)

Constructor

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,
    UClass* ReturnType,
    UClass* ClassToCreateByDefault,
    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

TReturnType ...

 

CreateEditorOnlyDefaultSubobject

(
    UObject* Outer,
    FName SubobjectName,
    bool bTransient
)

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

Public function Const

UObject *...

 

CreateEditorOnlyDefaultSubobject

(
    UObject* Outer,
    FName SubobjectName,
    UClass* ReturnType,
    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

FObjectIniti...

 

DoNotCreateDefaultSubobject

(
    FName SubobjectName
)

Indicates that a base class should not create a component

Public function Const

FObjectIniti...

 

DoNotCreateDefaultSubobject

(
    TCHAR const* SubobjectName
)

Indicates that a base class should not create a component

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

bool

 

IslegalOverride

(
    FName InComponentName,
    UClass* DerivedComponentClass,
    UClass* BaseComponentClass
)

Internal use only, checks if the override is legal and if not deal with error messages

Public function Const

FObjectIniti...

 

SetDefaultSubobjectClass

(
    FName SubobjectName
)

Sets the class of a subobject for a base class

Public function Const

FObjectIniti...

 

SetDefaultSubobjectClass

(
    TCHAR const* SubobjectName
)

Sets the class of a subobject for a base class

Deprecated Functions

Name Description

Public function Const

TReturnType ...

 

CreateAbstractDefaultSubobject

(
    UObject* Outer,
    FName SubobjectName,
    bool bTransient
)

CreateAbstract did not work as intended and has been deprecated in favor of CreateDefaultObject

Public function Const

UObject *...

 

CreateDefaultSubobject

(
    UObject* Outer,
    FName SubobjectFName,
    UClass* ReturnType,
    UClass* ClassToCreateByDefault,
    bool bIsRequired,
    bool bAbstract,
    bool bIsTransient
)

CreateDefaultSubobject no longer takes bAbstract as a parameter.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback