|
| query_builder_i (ecs_query_desc_t *desc, int32_t term_index=0) |
|
template<typename T > |
Base & | order_by (int(*compare)(flecs::entity_t, const T *, flecs::entity_t, const T *)) |
| Sort the output of a query. More...
|
|
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. More...
|
|
template<typename T > |
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. More...
|
|
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. More...
|
|
template<typename T > |
Base & | group_by () |
| Group and sort matched tables. More...
|
|
Base & | group_by (flecs::entity_t component) |
| Group and sort matched tables. More...
|
|
Base & | group_by_ctx (void *ctx, ecs_ctx_free_t ctx_free=nullptr) |
| Specify context to be passed to group_by function. More...
|
|
Base & | on_group_create (ecs_group_create_action_t action) |
| Specify on_group_create action. More...
|
|
Base & | on_group_delete (ecs_group_delete_action_t action) |
| Specify on_group_delete action. More...
|
|
Base & | observable (const query_base &parent) |
| Specify parent query (creates subquery) More...
|
|
| filter_builder_i (ecs_filter_desc_t *desc, int32_t term_index=0) |
|
Base & | instanced () |
|
Base & | filter_flags (ecs_flags32_t flags) |
|
Base & | expr (const char *expr) |
|
Base & | with (Args &&... args) |
|
Base & | with (Args &&... args) |
|
Base & | with () |
|
Base & | without (Args &&... args) |
|
Base & | without (Args &&... args) |
|
Base & | without () |
|
Base & | write () |
|
Base & | write (Args &&... args) |
|
Base & | write (Args &&... args) |
|
Base & | write () |
|
Base & | read () |
|
Base & | read (Args &&... args) |
|
Base & | read (Args &&... args) |
|
Base & | read () |
|
Base & | scope_open () |
|
Base & | scope_close () |
|
Base & | term () |
|
Base & | term () |
|
Base & | term (id_t id) |
|
Base & | term (const char *name) |
|
Base & | term (const char *first, const char *second) |
|
Base & | term (entity_t r, entity_t o) |
|
Base & | term (entity_t r, const char *o) |
|
Base & | term (id_t o) |
|
Base & | term (const char *second) |
|
Base & | term () |
|
Base & | term (E value) |
|
Base & | term (flecs::term &term) |
|
Base & | term (flecs::term &&term) |
|
Base & | term_at (int32_t term_index) |
|
Base & | arg (int32_t term_index) |
|
| term_builder_i (ecs_term_t *term_ptr) |
|
Base & | term (id_t id) |
|
Base & | src () |
|
Base & | first () |
|
Base & | second () |
|
Base & | src (flecs::entity_t id) |
|
template<typename T > |
Base & | src () |
|
Base & | src (const char *name) |
|
Base & | first (flecs::entity_t id) |
|
template<typename T > |
Base & | first () |
|
Base & | first (const char *name) |
|
Base & | second (flecs::entity_t id) |
|
template<typename T > |
Base & | second () |
|
Base & | second (const char *name) |
|
Base & | role (id_t role) |
| Set role of term. More...
|
|
Base & | inout (flecs::inout_kind_t inout) |
| Set read/write access of term. More...
|
|
Base & | inout_stage (flecs::inout_kind_t inout) |
| Set read/write access for stage. More...
|
|
Base & | write () |
| Short for inout_stage(flecs::Out). More...
|
|
Base & | read () |
| Short for inout_stage(flecs::In). More...
|
|
Base & | read_write () |
| Short for inout_stage(flecs::InOut). More...
|
|
Base & | in () |
| Short for inout(flecs::In) More...
|
|
Base & | out () |
| Short for inout(flecs::Out) More...
|
|
Base & | inout () |
| Short for inout(flecs::InOut) More...
|
|
Base & | inout_none () |
| Short for inout(flecs::In) More...
|
|
Base & | oper (flecs::oper_kind_t oper) |
| Set operator of term. More...
|
|
Base & | and_ () |
|
Base & | or_ () |
|
Base & | not_ () |
|
Base & | optional () |
|
Base & | and_from () |
|
Base & | or_from () |
|
Base & | not_from () |
|
Base & | singleton () |
| Match singleton. More...
|
|
Base & | filter () |
|
Base & | self () |
|
Base & | up (flecs::entity_t trav=0) |
|
template<typename Trav > |
Base & | up () |
|
Base & | cascade (flecs::entity_t trav=0) |
|
template<typename Trav > |
Base & | cascade () |
|
Base & | parent () |
|
Base & | trav (flecs::entity_t trav, flecs::flags32_t flags=0) |
|
Base & | id (flecs::entity_t id) |
|
Base & | entity (flecs::entity_t entity) |
|
Base & | name (const char *name) |
|
Base & | var (const char *var_name) |
|
Base & | flags (flecs::flags32_t flags) |
|
template<typename Base, typename ... Components>
struct flecs::query_builder_i< Base, Components >
Query builder interface.
Definition at line 17 of file builder_i.hpp.
template<typename Base , typename ... Components>
template<typename T >
Base & flecs::query_builder_i< Base, Components >::group_by |
( |
uint64_t(*)(flecs::world_t *, flecs::table_t *table, flecs::id_t id, void *ctx) |
group_by_action | ) |
|
|
inline |
Group and sort matched tables.
Similar yo ecs_query_order_by, but instead of sorting individual entities, this operation only sorts matched tables. This can be useful of a query needs to enforce a certain iteration order upon the tables it is iterating, for example by giving a certain component or tag a higher priority.
The sorting function assigns a "rank" to each type, which is then used to sort the tables. Tables with higher ranks will appear later in the iteration.
Resorting happens when a query iterator is obtained, and only if the set of matched tables for a query has changed. If table sorting is enabled together with entity sorting, table sorting takes precedence, and entities will be sorted within each set of tables that are assigned the same rank.
- Template Parameters
-
T | The component used to determine the group rank. |
- Parameters
-
group_by_action | Callback that determines group id for table. |
Definition at line 84 of file builder_i.hpp.
template<typename Base , typename ... Components>
template<typename T >
Base & flecs::query_builder_i< Base, Components >::order_by |
( |
int(*)(flecs::entity_t, const T *, flecs::entity_t, const T *) |
compare | ) |
|
|
inline |
Sort the output of a query.
This enables sorting of entities across matched tables. As a result of this operation, the order of entities in the matched tables may be changed. Resorting happens when a query iterator is obtained, and only if the table data has changed.
If multiple queries that match the same (down)set of tables specify different sorting functions, resorting is likely to happen every time an iterator is obtained, which can significantly slow down iterations.
The sorting function will be applied to the specified component. Resorting only happens if that component has changed, or when the entity order in the table has changed. If no component is provided, resorting only happens when the entity order changes.
- Template Parameters
-
T | The component used to sort. |
- Parameters
-
compare | The compare function used to sort the components. |
Definition at line 49 of file builder_i.hpp.