engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | 友元 | 所有成员列表
FObjectInitializer类 参考

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

#include <UObjectGlobals.h>

Public 成员函数

UObject * CreateDefaultSubobject (UObject *Outer, FName SubobjectFName, UClass *ReturnType, UClass *ClassToCreateByDefault, bool bIsRequired, bool bIsTransient) const
 Create a component or subobject 更多...
 
template<class TReturnType >
TReturnType * CreateDefaultSubobject (UObject *Outer, FName SubobjectName, bool bTransient=false) const
 Create a component or subobject 更多...
 
template<class TReturnType , class TClassToConstructByDefault >
TReturnType * CreateDefaultSubobject (UObject *Outer, FName SubobjectName, bool bTransient=false) const
 Create a component or subobject 更多...
 
template<class TReturnType >
TReturnType * CreateEditorOnlyDefaultSubobject (UObject *Outer, FName SubobjectName, bool bTransient=false) const
 Create a component or subobject only to be used with the editor. 更多...
 
UObject * CreateEditorOnlyDefaultSubobject (UObject *Outer, FName SubobjectName, UClass *ReturnType, bool bTransient=false) const
 Create a component or subobject only to be used with the editor. 更多...
 
template<class TReturnType >
TReturnType * CreateOptionalDefaultSubobject (UObject *Outer, FName SubobjectName, bool bTransient=false) const
 Create optional component or subobject. 更多...
 
FObjectInitializer const & DoNotCreateDefaultSubobject (FName SubobjectName) const
 Indicates that a base class should not create a component 更多...
 
 FObjectInitializer ()
 Default Constructor, used when you are using the C++ "new" syntax. 更多...
 
 FObjectInitializer (UObject *InObj, UObject *InObjectArchetype, bool bInCopyTransientsFromClassDefaults, bool bInShouldInitializeProps, struct FObjectInstancingGraph *InInstanceGraph=nullptr)
 Constructor 更多...
 
FORCEINLINE UObject * GetArchetype () const
 Return the archetype that this object will copy properties from later
 
UClass * GetClass () const
 Return the class of the object that is being constructed
 
FORCEINLINE UObject * GetObj () const
 Return the object that is being constructed
 
template<class T >
FObjectInitializer const & SetDefaultSubobjectClass (FName SubobjectName) const
 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. 更多...
 
FObjectInitializer const & SetDefaultSubobjectClass (FName SubobjectName, UClass *Class) const
 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 成员函数

static void AssertIfInConstructor (UObject *Outer, const TCHAR *ErrorMessage)
 Asserts with the specified message if code is executed inside UObject constructor
 
static FObjectInitializer & Get ()
 Gets ObjectInitializer for the currently constructed object. 更多...
 

友元

class FScriptIntegrationObjectHelper
 
class UObject
 

详细描述

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

构造及析构函数说明

◆ FObjectInitializer() [1/2]

FObjectInitializer::FObjectInitializer ( )

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

UObject::UObject will set the object pointer

◆ FObjectInitializer() [2/2]

FObjectInitializer::FObjectInitializer ( UObject *  InObj,
UObject *  InObjectArchetype,
bool  bInCopyTransientsFromClassDefaults,
bool  bInShouldInitializeProps,
struct FObjectInstancingGraph *  InInstanceGraph = nullptr 
)

Constructor

参数
InObjobject to initialize, from static allocate object, after construction
InObjectArchetypeobject to initialize properties from
bInCopyTransientsFromClassDefaults- if true, copy transient from the class defaults instead of the pass in archetype ptr (often these are the same)
bInShouldInitializePropsfalse is a special case for changing base classes in UCCMake
InInstanceGraphpassed instance graph

成员函数说明

◆ CreateDefaultSubobject() [1/3]

UObject * FObjectInitializer::CreateDefaultSubobject ( UObject *  Outer,
FName  SubobjectFName,
UClass *  ReturnType,
UClass *  ClassToCreateByDefault,
bool  bIsRequired,
bool  bIsTransient 
) const

Create a component or subobject

参数
TReturnTypeclass of return type, all overrides must be of this type
TClassToConstructByDefaultif the derived class has not overridden, create a component of this type (default is TReturnType)
Outerouter to construct the subobject in
SubobjectNamename of the new component
bIsRequiredtrue if the component is required and will always be created even if DoNotCreateDefaultSubobject was specified.
bIsTransienttrue if the component is being assigned to a transient property

◆ CreateDefaultSubobject() [2/3]

template<class TReturnType >
TReturnType * FObjectInitializer::CreateDefaultSubobject ( UObject *  Outer,
FName  SubobjectName,
bool  bTransient = false 
) const
inline

Create a component or subobject

参数
TReturnTypeclass of return type, all overrides must be of this type
Outerouter to construct the subobject in
SubobjectNamename of the new component
bTransienttrue if the component is being assigned to a transient property

◆ CreateDefaultSubobject() [3/3]

template<class TReturnType , class TClassToConstructByDefault >
TReturnType * FObjectInitializer::CreateDefaultSubobject ( UObject *  Outer,
FName  SubobjectName,
bool  bTransient = false 
) const
inline

Create a component or subobject

参数
TReturnTypeclass of return type, all overrides must be of this type
TClassToConstructByDefaultclass to construct by default
Outerouter to construct the subobject in
SubobjectNamename of the new component
bTransienttrue if the component is being assigned to a transient property

◆ CreateEditorOnlyDefaultSubobject() [1/2]

template<class TReturnType >
TReturnType * FObjectInitializer::CreateEditorOnlyDefaultSubobject ( UObject *  Outer,
FName  SubobjectName,
bool  bTransient = false 
) const
inline

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

参数
TReturnTypeclass of return type, all overrides must be of this type
Outerouter to construct the subobject in
SubobjectNamename of the new component
bTransienttrue if the component is being assigned to a transient property

◆ CreateEditorOnlyDefaultSubobject() [2/2]

UObject * FObjectInitializer::CreateEditorOnlyDefaultSubobject ( UObject *  Outer,
FName  SubobjectName,
UClass *  ReturnType,
bool  bTransient = false 
) const

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

参数
TReturnTypeclass of return type, all overrides must be of this type
Outerouter to construct the subobject in
ReturnTypetype of the new component
SubobjectNamename of the new component
bTransienttrue if the component is being assigned to a transient property

◆ CreateOptionalDefaultSubobject()

template<class TReturnType >
TReturnType * FObjectInitializer::CreateOptionalDefaultSubobject ( UObject *  Outer,
FName  SubobjectName,
bool  bTransient = false 
) const
inline

Create optional component or subobject.

Optional subobjects may not get created when a derived class specified DoNotCreateDefaultSubobject with the subobject's name.

参数
TReturnTypeclass of return type, all overrides must be of this type
Outerouter to construct the subobject in
SubobjectNamename of the new component
bTransienttrue if the component is being assigned to a transient property

◆ DoNotCreateDefaultSubobject()

FObjectInitializer const & FObjectInitializer::DoNotCreateDefaultSubobject ( FName  SubobjectName) const
inline

Indicates that a base class should not create a component

参数
SubobjectNamename of the new component or subobject to not create

◆ Get()

static FObjectInitializer & FObjectInitializer::Get ( )
static

Gets ObjectInitializer for the currently constructed object.

Can only be used inside of a constructor of UObject-derived class.

◆ SetDefaultSubobjectClass() [1/2]

template<class T >
FObjectInitializer const & FObjectInitializer::SetDefaultSubobjectClass ( FName  SubobjectName) const
inline

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.

参数
SubobjectNamename of the new component or subobject

◆ SetDefaultSubobjectClass() [2/2]

FObjectInitializer const & FObjectInitializer::SetDefaultSubobjectClass ( FName  SubobjectName,
UClass *  Class 
) const
inline

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.

参数
SubobjectNamename of the new component or subobject
ClassThe class to use for the specified subobject or component.

该类的文档由以下文件生成: