Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
Reflection.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
16#pragma once
17
18// =============================================================================
19// Reflection Macros
20// =============================================================================
21
46#define ES_COMPONENT(...)
47
95#define ES_PROPERTY(...)
96
106#define ES_METHOD(...)
107
119#define ES_ENUM(...)
120
129#define ES_CONST(...)
130
139#define ES_ENUM_VALUE(name)
140
141// =============================================================================
142// Metadata Extraction Markers
143// =============================================================================
144
152#define ES_REFLECT_BEGIN
153
157#define ES_REFLECT_END
158
159// =============================================================================
160// Type Traits for Reflection
161// =============================================================================
162
163namespace esengine {
164
173template<typename T>
174struct is_component : std::false_type {};
175
179template<typename T>
181
191template<typename T>
192inline constexpr const char* component_name() {
193 return "UnknownComponent";
194}
195
196} // namespace esengine
197
198// =============================================================================
199// Usage Examples
200// =============================================================================
201
constexpr bool is_component_v
Helper variable template for is_component.
constexpr const char * component_name()
Get the script name for a component type.
Type trait to detect if a type is a reflected component.