MObject
- Module
- Core
- Header
#include "Core/MObject.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
MObject() | MObject | |
virtual ~MObject() | ~MObject | |
MObject(const MObject&) = delete | MObject | Copy and move are deleted because MObjects have identity; subclasses that really mean value semantics opt in explicitly. |
MObject(MObject&&) = delete | MObject |
Public functions
| Returns | Name | Description |
|---|---|---|
MObject& | operator= | |
MObject& | operator= | |
FName | GetName | Defaults to the class name when not set. |
void | SetName | |
MObject* | GetOuter | Every MObject has an Outer that owns it (typically the world, or another MObject for nested types). |
void | SetOuter | |
class MClass* | GetClass | Resolves the concrete type via typeid(*this) against MClassRegistry, which MHT populates at static-init time — so subclasses get the right MClass without overriding. |
uint32_t | GetObjectIndex | Stable slot index in FMObjectArray. |
void | MarkPendingKill | Deferred destruction: the object stays allocated until the next GC pass (no dangling raw pointers mid-frame), but is dead to the world immediately — TWeakObjectPtr::IsValid goes false and the mark phase refuses to mark it (so the sweep collects it regardless of who still references it). |
bool | IsPendingKill | |
bool | IsPurgedByUnload | Killed because the module holding its code unloaded (FMObjectArray::PurgeModuleObjects). |
Function details
MObject
MObject()~MObject
virtual ~MObject()MObject
MObject(const MObject&) = deleteCopy and move are deleted because MObjects have identity; subclasses that really mean value semantics opt in explicitly.
MObject
MObject(MObject&&) = deleteoperator=
MObject& operator=(const MObject&) = deleteoperator=
MObject& operator=(MObject&&) = deleteGetName
FName GetName() constDefaults to the class name when not set.
SetName
void SetName(FName name)GetOuter
MObject* GetOuter() constEvery MObject has an Outer that owns it (typically the world, or another MObject for nested types). GC traces the Outer chain to find roots.
SetOuter
void SetOuter(MObject* outer)GetClass
virtual class MClass* GetClass() constResolves the concrete type via typeid(*this) against MClassRegistry, which MHT populates at static-init time — so subclasses get the right MClass without overriding. Out-of-line in MObject.cpp so the lookup doesn't drag MClassRegistry.h into every consumer.
GetObjectIndex
uint32_t GetObjectIndex() const noexceptStable slot index in FMObjectArray. Set by Register on construction; never changes for this object's lifetime. TWeakObjectPtr captures (m_objectIndex, captureSerial) so it can detect a swept-and-replaced slot.
MarkPendingKill
void MarkPendingKill() noexceptDeferred destruction: the object stays allocated until the next GC pass (no dangling raw pointers mid-frame), but is dead to the world immediately — TWeakObjectPtr::IsValid goes false and the mark phase refuses to mark it (so the sweep collects it regardless of who still references it).
IsPendingKill
bool IsPendingKill() const noexceptIsPurgedByUnload
bool IsPurgedByUnload() const noexceptKilled because the module holding its code unloaded (FMObjectArray::PurgeModuleObjects). The next mark clears every TObjectPtr that still names it, before the sweep frees it: unlike an ordinary pending kill, nothing can ever safely read it again — its vtable is unmapped memory.