23#define ECS_FUNC_NAME_FRONT(type, name) ((sizeof(#type) + sizeof(" flecs::_::() [T = ") + sizeof(#name)) - 3u)
24#define ECS_FUNC_NAME_BACK (sizeof("]") - 1u)
25#define ECS_FUNC_NAME __PRETTY_FUNCTION__
26#elif defined(__GNUC__)
27#define ECS_FUNC_NAME_FRONT(type, name) ((sizeof(#type) + sizeof(" flecs::_::() [with T = ") + sizeof(#name)) - 3u)
28#define ECS_FUNC_NAME_BACK (sizeof("]") - 1u)
29#define ECS_FUNC_NAME __PRETTY_FUNCTION__
31#define ECS_FUNC_NAME_FRONT(type, name) ((sizeof(#type) + sizeof(" __cdecl flecs::_::<") + sizeof(#name)) - 3u)
32#define ECS_FUNC_NAME_BACK (sizeof(">(void)") - 1u)
33#define ECS_FUNC_NAME __FUNCSIG__
35#error "implicit component registration not supported"
38#define ECS_FUNC_TYPE_LEN(type, name, str)\
39 (flecs::string::length(str) - (ECS_FUNC_NAME_FRONT(type, name) + ECS_FUNC_NAME_BACK))
54 const char *func_name,
70 const char *type_name,
85 const char *func_name,
98 const char *type_name);
100typedef void (*ecs_cpp_type_action_t)(
106#ifdef FLECS_MULTI_WORLD
112 const char *cpp_name;
113 const char *cpp_symbol;
116 ecs_cpp_type_action_t lifecycle_action;
117 ecs_cpp_type_action_t enum_action;
119 bool explicit_registration;
222 const char *root_sep);
struct ecs_cpp_get_mut_t ecs_cpp_get_mut_t
Result type for C++ set/assign operations.
FLECS_API ecs_member_t * ecs_cpp_last_member(const ecs_world_t *world, ecs_entity_t type)
Get the last registered member for a type.
FLECS_API ecs_entity_t ecs_cpp_component_register(ecs_world_t *world, const ecs_cpp_component_desc_t *desc)
Register a C++ component.
FLECS_API FLECS_ALWAYS_INLINE ecs_cpp_get_mut_t ecs_cpp_set(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component, const void *new_ptr, size_t size)
Set a component value for a C++ entity.
FLECS_API char * ecs_cpp_get_type_name(char *type_name, const char *func_name, size_t len, size_t front_len)
Get type name from compiler-generated function name.
FLECS_API const char * ecs_cpp_trim_module(ecs_world_t *world, const char *type_name)
Trim module prefix from type name.
FLECS_API void ecs_cpp_enum_init(ecs_world_t *world, ecs_entity_t id, ecs_entity_t underlying_type)
Initialize a C++ enum type.
FLECS_API ecs_entity_t ecs_cpp_enum_constant_register(ecs_world_t *world, ecs_entity_t parent, ecs_entity_t id, const char *name, void *value, ecs_entity_t value_type, size_t value_size)
Register a C++ enum constant.
FLECS_API char * ecs_cpp_get_symbol_name(char *symbol_name, const char *type_name, size_t len)
Get symbol name from type name.
FLECS_API FLECS_ALWAYS_INLINE ecs_entity_t ecs_cpp_new(ecs_world_t *world, ecs_entity_t parent, const char *name, const char *sep, const char *root_sep)
Create a new entity from C++.
FLECS_API char * ecs_cpp_get_constant_name(char *constant_name, const char *func_name, size_t len, size_t back_len)
Get constant name from compiler-generated function name.
FLECS_API FLECS_ALWAYS_INLINE ecs_cpp_get_mut_t ecs_cpp_assign(ecs_world_t *world, ecs_entity_t entity, ecs_id_t component, const void *new_ptr, size_t size)
Assign a component value for a C++ entity.
struct ecs_stage_t ecs_stage_t
A stage enables modification while iterating and from multiple threads.
ecs_id_t ecs_entity_t
An entity identifier.
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
uint64_t ecs_id_t
IDs are the things that can be added to an entity.
Result type for C++ set/assign operations.
bool call_modified
Whether modified should be called.
ecs_stage_t * stage
The stage.
ecs_world_t * world
The world.
void * ptr
Pointer to the component data.
Element type of members vector in EcsStruct.