Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
ComponentRegistry.h File Reference

Classes

class  ComponentRegistry
 Registry for component metadata. More...

Macros

#define COMPONENT_REGISTRY_API
#define REGISTER_COMPONENT(ClassName)
 Automatically register a component at static initialization.

Macro Definition Documentation

◆ COMPONENT_REGISTRY_API

#define COMPONENT_REGISTRY_API

◆ REGISTER_COMPONENT

#define REGISTER_COMPONENT ( ClassName)
Value:
static struct ClassName##_Registrar \
{ \
ClassName##_Registrar() \
{ \
ComponentRegistry::Instance().Register(&ClassName::GetComponentMeta()); \
} \
} s_##ClassName##_Registrar

Automatically register a component at static initialization.

Uses GetComponentMeta() which returns a reference to a function-local static, ensuring the metadata is initialized before first use (avoids SIOF).

On embedded platforms, this macro is a no-op since:

  • GetComponentMeta() is not declared (guarded by DEKI_EDITOR)
  • ComponentRegistry is not needed for runtime scene loading

Usage in .cpp file: REGISTER_COMPONENT(MyComponent)