class

MClass

MClass — the reflection descriptor for an MObject-derived type. One static instance per MCLASS type lives in the codegen-emitted .refl.cpp; MClassRegistry maps typeid → MClass. Aggregate — codegen brace-initialises every field in declaration order; keep new fields at the end.

Module
Core
Header
#include "Core/MObject.h"
Namespace
Mowo

Properties

TypeNameDescription
FNameclassName
FNamesuperClassNameName of the direct base class as parsed from the header. The base may live in another module's .refl.cpp (or not be registered at all — e.g. MObject itself for hand-written roots), so the pointer link resolves lazily by name.
MClass*superClassLazily resolved + cached by GetSuperClass(). nullptr until the first lookup (or forever, when the super isn't registered). Default nullptr.
uint32_tclassSizeDefault 0.
const FMFunctionInfo*functionsCodegen-emitted MFUNCTION table — this class's OWN reflected methods. A bare array (not an accessor like getProperties) because the thunks are free functions in the generated TU that only call PUBLIC methods, so no befriended access is needed. nullptr when the class has no MFUNCTION methods. Kept at the end so the codegen's aggregate init stays ABI-additive. Default nullptr.
uint32_tfunctionCountDefault 0.
void*userDataSubsystem extension slot — opaque per-class data a higher layer can attach without Core knowing the type. Visual Scripting uses it to point a synthetic (data-driven) MClass back at its VisualScriptClass definition (the source of the BeginPlay/Tick graphs). Codegen never sets it: aggregate brace-init of a generated MClass omits trailing fields, leaving this value-initialised — trailing placement keeps the layout ABI-additive. Default nullptr.
MObject*defaultObjectCached Class Default Object — see GetDefaultObject(). Codegen never sets it (trailing field, value-initialised by aggregate init). Default nullptr.
const FName*interfacesMIMPLEMENTS interface names — this class's OWN declarations; walk the super chain with ImplementsInterface for inherited ones. Bound by a follow-up initialiser in the generated TU (they trail the value-initialised fields, so the aggregate stays ABI-additive). Default nullptr.
uint32_tinterfaceCountDefault 0.
uint32_tclassFlagsFMClassFlags, and the open metadata MCLASS(...) carried — bound by the same follow-up initialiser as the interfaces. Default FMClassFlags::None.
const FMMetaEntry*metaDefault nullptr.
uint32_tmetaCountDefault 0.

Public functions

ReturnsNameDescription
voidCodegen-emitted GC trace — walks this class's OWN MPROPERTY fields (not inherited ones; the GC walks the super chain).
boolHasClassFlag
const char*FindMetaThe value of an own meta entry (no super-chain walk), or nullptr.
const FMFunctionInfo*FindFunctionFind an own reflected method by name (no super-chain walk).
MObject*GetDefaultObjectClass Default Object.
boolImplementsInterfaceChain-aware MIMPLEMENTS query — the data-driven complement of a dynamic_cast to the C++ interface.
MClass*GetSuperClassResolve + cache the super MClass via MClassRegistry name lookup.
boolIsChildOfWalks the super chain.
const FMPropertyInfo*GetPropertiesReturns nullptr + count 0 when the class has no MPROPERTY fields.
const FMPropertyInfo*FindPropertyFind an own property by name (no super-chain walk).

Function details

void

C++
void (*gcTrace)(MObject* self, FReferenceCollector& collector) = nullptr

Codegen-emitted GC trace — walks this class's OWN MPROPERTY fields (not inherited ones; the GC walks the super chain). nullptr when the class has no MPROPERTY fields.

HasClassFlag

C++
bool HasClassFlag(uint32_t flag) const

FindMeta

C++
const char* FindMeta(const char* key) const

The value of an own meta entry (no super-chain walk), or nullptr.

FindFunction

C++
const FMFunctionInfo* FindFunction(FName name) const

Find an own reflected method by name (no super-chain walk).

GetDefaultObject

C++
MObject* GetDefaultObject()

Class Default Object. Lazily constructed via the codegen factory on first request, GC-rooted for process lifetime, named "Default__<Class>". SpawnActorByClass clones the CDO's reflected values onto a fresh actor and the scene writer emits only the properties that differ from it, so raising a class default reaches every instance that never overrode the field. Both go through FActorSerializer, which owns the supported-value-kind rule: an edge into the archetype itself or its own components is never cloned (constructors and BeginPlay re-establish it), while value containers, reflected structs, Custom fields and references to other placed actors are cloned and diffed. Returns nullptr for abstract / non-default-constructible classes, in which case spawn constructs plainly and the writer emits the full property set.

ImplementsInterface

C++
bool ImplementsInterface(FName interfaceName)

Chain-aware MIMPLEMENTS query — the data-driven complement of a dynamic_cast to the C++ interface. Non-const: walks lazy supers.

GetSuperClass

C++
MClass* GetSuperClass()

Resolve + cache the super MClass via MClassRegistry name lookup. Benign race: concurrent callers write the same pointer. Returns nullptr for roots and for supers that aren't registered.

IsChildOf

C++
bool IsChildOf(const MClass* base)

Walks the super chain. Non-const because the walk resolves lazy super links.

GetProperties

C++
const FMPropertyInfo* GetProperties(uint32_t& outCount)

Returns nullptr + count 0 when the class has no MPROPERTY fields.

FindProperty

C++
const FMPropertyInfo* FindProperty(FName name)

Find an own property by name (no super-chain walk).

Generated from Core/MObject.h via core.json · Nov 5, 2026Version 1.0.0