![]() |
Flecs v4.1
A fast entity component system (ECS) for C & C++
|
Convenience macros for sorting tables. More...
Macros | |
| #define | ecs_sort_table(id) ecs_id(id##_sort_table) |
| Declare a table sort function. | |
| #define | ecs_compare(id) ecs_id(id##_compare_fn) |
| Declare a comparison function. | |
| #define | ECS_SORT_TABLE_WITH_COMPARE(id, op_name, compare_fn, ...) |
| Declare an efficient table sorting operation that uses the provided compare function. | |
| #define | ECS_SORT_TABLE(id, ...) ECS_SORT_TABLE_WITH_COMPARE(id, ecs_sort_table(id), ecs_compare(id), __VA_ARGS__) |
| Declare an efficient table sorting operation that uses the default component comparison operator. | |
| #define | ECS_COMPARE(id, ...) |
| Declare component comparison operations. | |
Convenience macros for sorting tables.
| #define ecs_compare | ( | id | ) | ecs_id(id##_compare_fn) |
| #define ECS_COMPARE | ( | id, | |
| ... ) |
Declare component comparison operations.
Parameters: ecs_entity_t e1, const void* ptr1, ecs_entity_t e2, const void* ptr2 Example:
| #define ecs_sort_table | ( | id | ) | ecs_id(id##_sort_table) |
| #define ECS_SORT_TABLE | ( | id, | |
| ... ) ECS_SORT_TABLE_WITH_COMPARE(id, ecs_sort_table(id), ecs_compare(id), __VA_ARGS__) |
Declare an efficient table sorting operation that uses the default component comparison operator.
For best results, use LTO or make the comparison operator visible in the same compilation unit. Variadic arguments are prepended before generated functions; use them to declare static or exported functions. Example:
| #define ECS_SORT_TABLE_WITH_COMPARE | ( | id, | |
| op_name, | |||
| compare_fn, | |||
| ... ) |
Declare an efficient table sorting operation that uses the provided compare function.
For best results, use LTO or make the function body visible in the same compilation unit. Variadic arguments are prepended before generated functions; use them to declare static or exported functions. Parameters of the comparison function: ecs_entity_t e1, const void* ptr1, ecs_entity_t e2, const void* ptr2 Parameters of the sort functions: ecs_world_t *world ecs_table_t *table ecs_entity_t *entities void *ptr int32_t elem_size int32_t lo int32_t hi ecs_order_by_action_t order_by - Pointer to the original comparison function. You are not supposed to use it. Example: