Flecs v3.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
ecs_query_desc_t Struct Reference

Used with ecs_query_init. More...

#include <flecs.h>

Public Attributes

int32_t _canary
 
ecs_filter_desc_t filter
 Filter for the query. More...
 
ecs_entity_t order_by_component
 Component to be used by order_by. More...
 
ecs_order_by_action_t order_by
 Callback used for ordering query results. More...
 
ecs_sort_table_action_t sort_table
 Callback used for ordering query results. More...
 
ecs_id_t group_by_id
 Id to be used by group_by. More...
 
ecs_group_by_action_t group_by
 Callback used for grouping results. More...
 
ecs_group_create_action_t on_group_create
 Callback that is invoked when a new group is created. More...
 
ecs_group_delete_action_t on_group_delete
 Callback that is invoked when an existing group is deleted. More...
 
void * group_by_ctx
 Context to pass to group_by. More...
 
ecs_ctx_free_t group_by_ctx_free
 Function to free group_by_ctx. More...
 
ecs_query_tparent
 If set, the query will be created as a subquery. More...
 

Detailed Description

Used with ecs_query_init.

Definition at line 807 of file flecs.h.

Member Data Documentation

◆ _canary

int32_t ecs_query_desc_t::_canary

Definition at line 808 of file flecs.h.

◆ filter

ecs_filter_desc_t ecs_query_desc_t::filter

Filter for the query.

Definition at line 811 of file flecs.h.

◆ group_by

ecs_group_by_action_t ecs_query_desc_t::group_by

Callback used for grouping results.

If the callback is not set, results will not be grouped. When set, this callback will be used to calculate a "rank" for each entity (table) based on its components. This rank is then used to sort entities (tables), so that entities (tables) of the same rank are "grouped" together when iterated.

Definition at line 835 of file flecs.h.

◆ group_by_ctx

void* ecs_query_desc_t::group_by_ctx

Context to pass to group_by.

Definition at line 846 of file flecs.h.

◆ group_by_ctx_free

ecs_ctx_free_t ecs_query_desc_t::group_by_ctx_free

Function to free group_by_ctx.

Definition at line 849 of file flecs.h.

◆ group_by_id

ecs_id_t ecs_query_desc_t::group_by_id

Id to be used by group_by.

This id is passed to the group_by function and can be used identify the part of an entity type that should be used for grouping.

Definition at line 828 of file flecs.h.

◆ on_group_create

ecs_group_create_action_t ecs_query_desc_t::on_group_create

Callback that is invoked when a new group is created.

The return value of the callback is stored as context for a group.

Definition at line 839 of file flecs.h.

◆ on_group_delete

ecs_group_delete_action_t ecs_query_desc_t::on_group_delete

Callback that is invoked when an existing group is deleted.

The return value of the on_group_create callback is passed as context parameter.

Definition at line 843 of file flecs.h.

◆ order_by

ecs_order_by_action_t ecs_query_desc_t::order_by

Callback used for ordering query results.

If order_by_id is 0, the pointer provided to the callback will be NULL. If the callback is not set, results will not be ordered.

Definition at line 819 of file flecs.h.

◆ order_by_component

ecs_entity_t ecs_query_desc_t::order_by_component

Component to be used by order_by.

Definition at line 814 of file flecs.h.

◆ parent

ecs_query_t* ecs_query_desc_t::parent

If set, the query will be created as a subquery.

A subquery matches at most a subset of its parent query. Subqueries do not directly receive (table) notifications from the world. Instead parent queries forward results to subqueries. This can improve matching performance, as fewer queries need to be matched with new tables. Subqueries can be nested.

Definition at line 857 of file flecs.h.

◆ sort_table

ecs_sort_table_action_t ecs_query_desc_t::sort_table

Callback used for ordering query results.

Same as order_by, but more efficient.

Definition at line 823 of file flecs.h.


The documentation for this struct was generated from the following file: