Loading...
Searching...
No Matches
Export.h
Go to the documentation of this file.
1// Copyright (c) 2025 Dave R. Smith. All rights reserved.
2// Malena Framework — Proprietary Software. See LICENSE for terms.
3
4#pragma once
5// ============================================================
6// include/Malena/Core/Export.h
7// ============================================================
8//
9// Defines ML_EXPORT for Fireable types only.
10// Plugin.h includes this and redefines ML_EXPORT to also handle plugins.
11//
12// Include graph (no circular dependencies):
13// Fireable.h → Export.h (Fireable-only ML_EXPORT)
14// Plugin.h → Export.h (then #undef + redefines ML_EXPORT)
15// common.hpp → Plugin.h (full ML_EXPORT always available)
16//
17// ============================================================
18
20
21namespace ml
22{
23 class Fireable; // forward declare only
24}
25
31
43#define ML_EXPORT(ClassName) \
44 namespace ml::exports { \
45 \
46 inline struct _Register_##ClassName \
47 { \
48 _Register_##ClassName() \
49 { \
50 /* FireableHelper selects the correct specialization at */ \
51 /* compile time. new ClassName() only appears in the Fireable */ \
52 /* specialization — never type-checked for non-Fireable types. */ \
53 ml::exports::FireableHelper<ClassName>::doRegister(); \
54 } \
55 } _instance_##ClassName; \
56 \
57 }
Definition Component.h:22