struct
TypeDescriptor
Describes all reflected properties of a component type.
- Module
- Reflection
- Header
#include "Reflection/TypeDescriptor.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
const char* | typeName | "LightComponent" |
const char* | displayName | "Light" (MDF node name / header label) |
ComponentID | componentId | |
const PropertyInfo* | properties | |
uint32_t | propertyCount | |
uint32_t | version | Bump 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* | functions | Reflected 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_t | functionCount | Default 0. |
uint32_t | instanceSize | CDO 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* | category | Editor Add Component grouping ("Rendering", "Physics", ...). Set by a struct-level MCATEGORY annotation; null buckets under "General". Default nullptr. |
const char* | description | One-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
| Returns | Name | Description |
|---|---|---|
void | Custom hooks for fields that can't be reflected (vectors, pointers, maps) These are called IN ADDITION to automatic property serialization. | |
void | ||
bool | Returns true if custom inspector fully handled drawing (skip auto properties) | |
void | Invoked before property deserialization when the node's stored version is below version. | |
void | ||
void | ||
const FunctionInfo* | FindFunction | Linear scan — function counts are small. |
Function details
void
C++
void (*customSerialize)(const void* comp, MdfNode& node) = nullptrCustom 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) = nullptrbool
C++
bool (*customInspector)(void* comp, Scene* scene, EntityID id) = nullptrReturns true if custom inspector fully handled drawing (skip auto properties)
void
C++
void (*migrate)(uint32_t fromVersion, MdfNode& node) = nullptrInvoked 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) = nullptrvoid
C++
void (*destructDefault)(void* dst) = nullptrFindFunction
C++
const FunctionInfo* FindFunction(const char* fnName) constLinear scan — function counts are small.
Generated from Reflection/TypeDescriptor.h via reflection.json · Oct 26, 2026Version 1.0.0