Loading...
Searching...
No Matches
Export.h
Go to the documentation of this file.
1#pragma once
2// ============================================================
3// include/Malena/Core/Export.h
4// ============================================================
5//
6// Defines ML_EXPORT for Fireable types only.
7// Plugin.h includes this and redefines ML_EXPORT to also handle plugins.
8//
9// Include graph (no circular dependencies):
10// Fireable.h → Export.h (Fireable-only ML_EXPORT)
11// Plugin.h → Export.h (then #undef + redefines ML_EXPORT)
12// common.hpp → Plugin.h (full ML_EXPORT always available)
13//
14// ============================================================
15
16namespace ml
17{
18 class Fireable; // forward declare only
19}
20
26
38#define ML_EXPORT(ClassName) \
39 namespace ml::exports { \
40 \
41 inline struct _Register_##ClassName \
42 { \
43 _Register_##ClassName() \
44 { \
45 /* FireableHelper selects the correct specialization at */ \
46 /* compile time. new ClassName() only appears in the Fireable */ \
47 /* specialization — never type-checked for non-Fireable types. */ \
48 ml::exports::FireableHelper<ClassName>::doRegister(); \
49 } \
50 } _instance_##ClassName; \
51 \
52 }
Definition Component.h:18