struct

TypeDescriptor

Describes all reflected properties of a component type.

Module
Reflection
Header
#include "Reflection/TypeDescriptor.h"
Namespace
Mowo

Properties

TypeNameDescription
const char*typeName"LightComponent"
const char*displayName"Light" (MDF node name / header label)
ComponentIDcomponentId
const PropertyInfo*properties
uint32_tpropertyCount
uint32_tversionBump whenever the serialized layout changes incompatibly (field rename, semantic shift, unit change). The serializer writes _version into every emitted MDF node; when it is missing the deserializer assumes 1, which keeps pre-versioning saves loading. Default 1.
const FunctionInfo*functionsReflected callable methods (MFUNCTION). Descriptors without methods leave these zero via aggregate init. The call-by-reflection layer looks a method up by name and invokes it through FunctionInfo::invoke. Default nullptr.
uint32_tfunctionCountDefault 0.
uint32_tinstanceSizeCDO support, filled by the MHT codegen; zero for descriptors that predate it, in which case delta-serialization falls back to writing every property. instanceSize plus placement-new default construction let the serializer diff against a Class Default Object so scenes persist only properties that differ from the defaults. Default 0.
const char*categoryEditor Add Component grouping ("Rendering", "Physics", ...). Set by a struct-level MCATEGORY annotation; null buckets under "General". Default nullptr.
const char*descriptionOne-line authored summary for the Add Component menu, from a struct-level MOWO_TOOLTIP. Null when the component never wrote one, in which case the picker falls back to a line derived from the type name, the category and the property count — which says what the component IS named, never what it does. Default nullptr.

Public functions

ReturnsNameDescription
voidCustom hooks for fields that can't be reflected (vectors, pointers, maps) These are called IN ADDITION to automatic property serialization.
void
boolReturns true if custom inspector fully handled drawing (skip auto properties)
voidInvoked before property deserialization when the node's stored version is below version.
void
void
const FunctionInfo*FindFunctionLinear scan — function counts are small.

Function details

void

C++
void (*customSerialize)(const void* comp, MdfNode& node) = nullptr

Custom hooks for fields that can't be reflected (vectors, pointers, maps) These are called IN ADDITION to automatic property serialization.

void

C++
void (*customDeserialize)(void* comp, const MdfNode& node) = nullptr

bool

C++
bool (*customInspector)(void* comp, Scene* scene, EntityID id) = nullptr

Returns true if custom inspector fully handled drawing (skip auto properties)

void

C++
void (*migrate)(uint32_t fromVersion, MdfNode& node) = nullptr

Invoked before property deserialization when the node's stored version is below version. It must rename / move / synthesise properties so the standard deserialization path finds the new schema; chain through every version that introduced a change. if (from < 2) { rename "color" → "tintColor"; from = 2; } if (from < 3) { split "size" Vec2 → "sizeX","sizeY"; from = 3; }

void

C++
void (*constructDefault)(void* dst) = nullptr

void

C++
void (*destructDefault)(void* dst) = nullptr

FindFunction

C++
const FunctionInfo* FindFunction(const char* fnName) const

Linear scan — function counts are small.

Generated from Reflection/TypeDescriptor.h via reflection.json · Oct 26, 2026Version 1.0.0