Skip to content
Flecs v4.1
flecs.hpp
Go to the documentation of this file.
1/**
2 * @file addons/cpp/flecs.hpp
3 * @brief Flecs C++17 API.
4 */
5
6#pragma once
7
8// STL includes
9#include <type_traits>
10
11/**
12 * @defgroup cpp C++ API
13 * @{
14 */
15
16namespace flecs
17{
18
19struct world;
20struct world_async_stage;
21struct iter;
22struct entity_view;
23struct entity;
24struct type;
25struct table;
26struct table_range;
28
29template <typename T>
30struct component;
31
32struct untyped_ref;
33template <typename T>
34struct ref;
35
36namespace _
37{
38template <typename T, typename U = int>
39struct type;
40
41template <typename Func, typename ... Components>
42struct each_delegate;
43
44} // namespace _
45} // namespace flecs
46
47// Types imported from C API
48#include "c_types.hpp"
49
50// C++ utilities
51#include "utils/utils.hpp"
52#include "utils/map.hpp"
53
54// Mixin forward declarations
55#include "mixins/id/decl.hpp"
56#include "mixins/term/decl.hpp"
57#include "mixins/query/decl.hpp"
58#include "mixins/event/decl.hpp"
60#ifdef FLECS_SYSTEM
62#endif
63#ifdef FLECS_PIPELINE
65#endif
66#ifdef FLECS_TIMER
67#include "mixins/timer/decl.hpp"
68#endif
69#ifdef FLECS_DOC
70#include "mixins/doc/decl.hpp"
71#endif
72#ifdef FLECS_REST
73#include "mixins/rest/decl.hpp"
74#endif
75#ifdef FLECS_META
76#include "mixins/meta/decl.hpp"
77#endif
78#ifdef FLECS_UNITS
79#include "mixins/units/decl.hpp"
80#endif
81#ifdef FLECS_STATS
82#include "mixins/stats/decl.hpp"
83#endif
84#ifdef FLECS_METRICS
86#endif
87#ifdef FLECS_ALERTS
89#endif
90#ifdef FLECS_JSON
91#include "mixins/json/decl.hpp"
92#endif
93#ifdef FLECS_APP
94#include "mixins/app/decl.hpp"
95#endif
96#ifdef FLECS_SCRIPT
98#endif
99
100#include "log.hpp"
101#include "pair.hpp"
102#include "lifecycle_traits.hpp"
103#include "utils/component_id.hpp"
105#include "world.hpp"
106#include "field.hpp"
107#include "iter.hpp"
108#include "ref.hpp"
109#include "entity.hpp"
110#include "delegate.hpp"
111#include "component.hpp"
113#include "type.hpp"
114#include "table.hpp"
115#include "utils/iterable.hpp"
116
117// Mixin implementations
118#include "mixins/id/impl.hpp"
119#ifdef FLECS_ENTITY_RANGES
121#endif
122#ifdef FLECS_FRAME
123#include "mixins/frame/impl.hpp"
124#endif
125#include "mixins/entity/impl.hpp"
126#ifdef FLECS_PREFAB
127#include "mixins/prefab/impl.hpp"
128#endif
130#include "mixins/term/impl.hpp"
131#include "mixins/query/impl.hpp"
133#include "mixins/event/impl.hpp"
134#include "mixins/enum/impl.hpp"
135#ifdef FLECS_MODULE
136#include "mixins/module/impl.hpp"
137#endif
138#ifdef FLECS_SYSTEM
139#include "mixins/system/impl.hpp"
140#endif
141#ifdef FLECS_PIPELINE
143#endif
144#ifdef FLECS_TIMER
145#include "mixins/timer/impl.hpp"
146#endif
147#ifdef FLECS_DOC
148#include "mixins/doc/impl.hpp"
149#endif
150#ifdef FLECS_REST
151#include "mixins/rest/impl.hpp"
152#endif
153#ifdef FLECS_META
154#include "mixins/meta/impl.hpp"
155#endif
156#ifdef FLECS_UNITS
157#include "mixins/units/impl.hpp"
158#endif
159#ifdef FLECS_STATS
160#include "mixins/stats/impl.hpp"
161#endif
162#ifdef FLECS_METRICS
164#endif
165#ifdef FLECS_ALERTS
166#include "mixins/alerts/impl.hpp"
167#endif
168#ifdef FLECS_SCRIPT
169#include "mixins/script/impl.hpp"
170#endif
171
172#include "impl/field.hpp"
173#include "impl/iter.hpp"
174#include "impl/world.hpp"
175
176/**
177 * @defgroup cpp_core Core
178 * Core ECS functionality (entities, storage, queries).
179 *
180 * @{
181 * @}
182 */
183
184/**
185 * @defgroup cpp_addons Addons
186 * C++ APIs for addons.
187 *
188 * @{
189 * @}
190 */
191
192/** @} */
Alert declarations.
Alerts module implementation.
App addon declarations.
Aliases for types/constants from C API.
Component mixin implementation.
Registering/obtaining info from components.
Wrappers around C++ functions that provide callbacks for C APIs.
Doc mixin declarations.
Doc mixin implementation.
Entity implementation.
Entity class.
Entity ranges implementation.
Enum implementation.
Event declarations.
Event implementation.
Wrapper classes for fields returned by flecs::iter.
Frame implementation.
ID class.
ID class implementation.
Field implementation.
Iterator implementation.
World implementation.
Wrapper classes for ecs_iter_t and component arrays.
Base class for iterable objects, like queries.
JSON addon declarations.
Utilities for discovering and registering component lifecycle hooks.
Logging functions.
Minimal C++ wrapper for ecs_map_t iteration.
Meta declarations.
Meta implementation.
Metrics declarations.
Metrics module implementation.
Event builder.
Module implementation.
Int to enum.
Definition component.hpp:18
Observer declarations.
Observer implementation.
Utilities for working with compile-time pairs.
Pipeline module declarations.
Pipeline module implementation.
Prefab implementation.
Query declarations.
Query implementation.
Class that caches data to speed up get operations.
Rest module declarations.
Rest module implementation.
Script declarations.
Script implementation.
Direct iteration of sparse component storages.
Stats module declarations.
Stats module implementation.
Component class.
Entity.
Definition entity.hpp:30
Class for iterating over query results.
Definition iter.hpp:68
Component reference.
Definition ref.hpp:109
Table range.
Definition table.hpp:205
Table.
Definition table.hpp:23
Type class.
Definition type.hpp:21
Untyped component class.
Untyped component reference.
Definition ref.hpp:22
The world.
Definition world.hpp:129
System module declarations.
System module implementation.
Direct access to table data.
Term declarations.
Term implementation.
Timer module declarations.
Timer module implementation.
Utility functions for ID vector.
Units module declarations.
Units module implementation.
Flecs STL (FTL?).
World class.