![]() |
Flecs v4.1
A fast entity component system (ECS) for C & C++
|
C++ utility functions. More...
Go to the source code of this file.
Classes | |
| struct | ecs_cpp_component_desc_t |
| struct | ecs_cpp_get_mut_t |
| Result type for C++ set/assign operations. More... | |
Typedefs | |
| typedef void(* | ecs_cpp_type_action_t) (ecs_world_t *world, ecs_entity_t component) |
| typedef struct ecs_cpp_component_desc_t | ecs_cpp_component_desc_t |
| typedef struct ecs_cpp_get_mut_t | ecs_cpp_get_mut_t |
| Result type for C++ set/assign operations. | |
Functions | |
| 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 char * | ecs_cpp_get_symbol_name (char *symbol_name, const char *type_name, size_t len) |
| Get symbol name from type name. | |
| 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 const char * | ecs_cpp_trim_module (ecs_world_t *world, const char *type_name) |
| Trim module prefix from type name. | |
| 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 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 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 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. | |
| 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 ecs_member_t * | ecs_cpp_last_member (const ecs_world_t *world, ecs_entity_t type) |
| Get the last registered member for a type. | |
C++ utility functions.
This header contains utility functions that are accessible from both C and C++ code. These functions are not part of the public API and are not meant to be used directly by applications.
Definition in file flecs_cpp.h.
| typedef void(* ecs_cpp_type_action_t) (ecs_world_t *world, ecs_entity_t component) |
Definition at line 100 of file flecs_cpp.h.
| 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.
| world | The world. |
| entity | The entity. |
| component | The component ID. |
| new_ptr | Pointer to the new component value. |
| size | The size of the component. |
| FLECS_API ecs_entity_t ecs_cpp_component_register | ( | ecs_world_t * | world, |
| const ecs_cpp_component_desc_t * | desc ) |
Register a C++ component.
| world | The world. |
| desc | Component registration parameters. |
| 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.
| world | The world. |
| parent | The parent enum type entity. |
| id | The entity ID for the constant. |
| name | The constant name. |
| value | Pointer to the constant value. |
| value_type | The type of the constant value. |
| value_size | The size of the constant value. |
| 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.
| world | The world. |
| id | The entity ID for the enum type. |
| underlying_type | The underlying integer type of the enum. |
| 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.
| constant_name | Buffer to write the constant name to. |
| func_name | The compiler-generated function name. |
| len | The length of the constant name. |
| back_len | The number of characters to skip at the back. |
| FLECS_API char * ecs_cpp_get_symbol_name | ( | char * | symbol_name, |
| const char * | type_name, | ||
| size_t | len ) |
Get symbol name from type name.
| symbol_name | Buffer to write the symbol name to. |
| type_name | The type name. |
| len | The length of the type name. |
| 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.
| type_name | Buffer to write the type name to. |
| func_name | The compiler-generated function name. |
| len | The length of the type name. |
| front_len | The number of characters to skip at the front. |
| 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.
| world | The world. |
| type | The type entity. |
| 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++.
| world | The world. |
| parent | The parent entity. |
| name | The entity name. |
| sep | The path separator. |
| root_sep | The root path separator. |
| 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.
| world | The world. |
| entity | The entity. |
| component | The component ID. |
| new_ptr | Pointer to the new component value. |
| size | The size of the component. |
| FLECS_API const char * ecs_cpp_trim_module | ( | ecs_world_t * | world, |
| const char * | type_name ) |
Trim module prefix from type name.
| world | The world. |
| type_name | The type name to trim. |