8#include "../filter/builder_i.hpp"
16template<
typename Base,
typename ... Components>
49 Base&
order_by(
int(*compare)(flecs::entity_t,
const T*, flecs::entity_t,
const T*)) {
60 Base&
order_by(flecs::entity_t
component,
int(*compare)(flecs::entity_t,
const void*, flecs::entity_t,
const void*)) {
84 Base&
group_by(uint64_t(*group_by_action)(flecs::world_t*, flecs::table_t *
table, flecs::id_t
id,
void* ctx)) {
95 Base&
group_by(flecs::entity_t
component, uint64_t(*group_by_action)(flecs::world_t*, flecs::table_t *
table, flecs::id_t
id,
void* ctx)) {
106 template <
typename T>
117 return this->
group_by(component,
nullptr);
149 virtual flecs::world_t* world_v() = 0;
153 return *
static_cast<Base*
>(
this);
uint64_t(* ecs_group_by_action_t)(ecs_world_t *world, ecs_table_t *table, ecs_id_t group_id, void *ctx)
Callback used for grouping tables in a query.
void(* ecs_ctx_free_t)(void *ctx)
Function to cleanup context data.
int(* ecs_order_by_action_t)(ecs_entity_t e1, const void *ptr1, ecs_entity_t e2, const void *ptr2)
Callback used for comparing components.
Used with ecs_query_init.
ecs_order_by_action_t order_by
Callback used for ordering query results.
ecs_id_t group_by_id
Id to be used by group_by.
ecs_group_by_action_t group_by
Callback used for grouping results.
ecs_ctx_free_t group_by_ctx_free
Function to free group_by_ctx.
void * group_by_ctx
Context to pass to group_by.
ecs_group_create_action_t on_group_create
Callback that is invoked when a new group is created.
ecs_entity_t order_by_component
Component to be used by order_by.
ecs_filter_desc_t filter
Filter for the query.
ecs_group_delete_action_t on_group_delete
Callback that is invoked when an existing group is deleted.
Filter builder interface.
Base & group_by()
Group and sort matched tables.
Base & on_group_delete(ecs_group_delete_action_t action)
Specify on_group_delete action.
Base & group_by(flecs::entity_t component, uint64_t(*group_by_action)(flecs::world_t *, flecs::table_t *table, flecs::id_t id, void *ctx))
Group and sort matched tables.
Base & on_group_create(ecs_group_create_action_t action)
Specify on_group_create action.
Base & group_by(flecs::entity_t component)
Group and sort matched tables.
Base & observable(const query_base &parent)
Specify parent query (creates subquery)
Base & group_by(uint64_t(*group_by_action)(flecs::world_t *, flecs::table_t *table, flecs::id_t id, void *ctx))
Group and sort matched tables.
Base & order_by(int(*compare)(flecs::entity_t, const T *, flecs::entity_t, const T *))
Sort the output of a query.
Base & group_by_ctx(void *ctx, ecs_ctx_free_t ctx_free=nullptr)
Specify context to be passed to group_by function.
Base & order_by(flecs::entity_t component, int(*compare)(flecs::entity_t, const void *, flecs::entity_t, const void *))
Sort the output of a query.