|
| QueryInfo & | fetch () |
| | Fetches the QueryInfo object. Creates or refreshes the backing QueryInfo if needed.
|
| |
| void | match_all (QueryInfo &queryInfo) |
| | Matches the query against all relevant archetypes.
|
| |
| GAIA_NODISCARD bool | match_one (QueryInfo &queryInfo, const Archetype &archetype, EntitySpan targetEntities) |
| | Matches the query against a single archetype.
|
| |
| GAIA_NODISCARD bool | matches_any (QueryInfo &queryInfo, const Archetype &archetype, EntitySpan targetEntities) |
| | Returns whether any supplied target entity matches the query on archetype.
|
| |
| GAIA_NODISCARD QueryCachePolicy | cache_policy () |
| | Returns the effective cache policy chosen for the query.
|
| |
|
QueryImpl & | cache_src_trav (uint16_t maxItems) |
| | Enables traversed-source snapshot reuse and caps the cached source closure size. This only matters for queries using traversed sources (for example src(...).trav()). For queries without source traversal the value is normalized away, so it does not affect shared cache identity. Use this only when traversed source closures stay small and stable enough for snapshot reuse to be cheaper than rebuilding them on demand.
|
| |
| GAIA_NODISCARD uint16_t | cache_src_trav () const |
| | Returns the traversed-source snapshot cap. 0 disables explicit traversed-source snapshot caching.
|
| |
| QueryImpl & | kind (QueryCacheKind cacheKind) |
| | Sets the hard cache-kind requirement for the query.
|
| |
| QueryImpl & | scope (QueryCacheScope cacheScope) |
| | Sets the cache scope used by cached queries.
|
| |
| QueryImpl & | match_prefab () |
| | Makes the query include prefab entities in matches.
|
| |
| GAIA_NODISCARD QueryCacheScope | scope () const |
| | Returns the currently requested cache scope.
|
| |
| GAIA_NODISCARD QueryCacheKind | kind () const |
| | Returns the currently requested cache kind.
|
| |
| GAIA_NODISCARD QueryKindRes | kind_error () |
| | Returns the validation result for the current query shape and requested kind.
|
| |
| GAIA_NODISCARD const char * | kind_error_str () |
| | Returns a human-readable description of the current kind validation result.
|
| |
| GAIA_NODISCARD bool | valid () |
| | Returns whether the current query shape satisfies the requested kind.
|
| |
|
GAIA_NODISCARD bool | can_process_archetype (const QueryInfo &queryInfo, const Archetype &archetype) const |
| |
| GAIA_NODISCARD bool | can_process_archetype_inter (const QueryInfo &queryInfo, const Archetype &archetype, Constraints constraints, int8_t barrierPasses=-1) const |
| | Checks whether a matched archetype can be processed for the current row constraints.
|
| |
|
template<typename Func , typename TMode , QueryExecType ExecType> |
| GAIA_NODISCARD SchedJob | add_parallel_query_job (Func func) |
| |
|
template<bool HasFilters> |
| void | collect_runtime_parallel_batches (const QueryInfo &queryInfo, const QueryPlan &plan, Constraints constraints) |
| |
|
template<typename Func > |
| GAIA_NODISCARD SchedJob | add_query_task_job (Func func, QueryExecType execType) |
| |
|
template<typename Func , QueryExecType ExecType> |
| GAIA_NODISCARD SchedJob | add_iter_parallel_job (Func func) |
| |
|
template<bool HasFilters, typename TMode , typename Func > |
| void | run_query_batch_no_group_id (const QueryInfo &queryInfo, const uint32_t idxFrom, const uint32_t idxTo, Func func) |
| |
|
template<bool HasFilters, typename TMode , typename Func , QueryExecType ExecType> |
| void | run_query_batch_no_group_id_par (const QueryInfo &queryInfo, const uint32_t idxFrom, const uint32_t idxTo, Func func) |
| |
|
template<bool HasFilters, typename TMode , typename Func > |
| void | run_query_batch_with_group_id (const QueryInfo &queryInfo, const uint32_t idxFrom, const uint32_t idxTo, Func func) |
| |
|
template<bool HasFilters, typename TMode , typename Func , QueryExecType ExecType> |
| void | run_query_batch_with_group_id_par (const QueryInfo &queryInfo, const uint32_t idxFrom, const uint32_t idxTo, Func func) |
| |
|
template<bool HasFilters, QueryExecType ExecType, typename TMode , typename Func > |
| void | run_query (const QueryInfo &queryInfo, Func func) |
| |
|
template<QueryExecType ExecType, typename Func > |
| void | run_query_on_archetypes (QueryInfo &queryInfo, Func func, Constraints constraints) |
| |
|
template<QueryExecType ExecType, typename TMode , typename Func > |
| void | run_query_on_chunks (QueryInfo &queryInfo, Func func) |
| |
|
template<bool HasFilters, typename Func > |
| void | run_query_batch_no_group_id_runtime (const QueryInfo &queryInfo, const QueryPlan &plan, Constraints constraints, Func func) |
| |
|
template<bool HasFilters, typename Func , QueryExecType ExecType> |
| void | run_query_batch_no_group_id_runtime_par (const QueryInfo &queryInfo, const QueryPlan &plan, Constraints constraints, Func func) |
| |
|
template<bool HasFilters, typename Func > |
| void | run_query_batch_with_group_id_runtime (const QueryInfo &queryInfo, const QueryPlan &plan, Constraints constraints, Func func) |
| |
|
template<bool HasFilters, typename Func , QueryExecType ExecType> |
| void | run_query_batch_with_group_id_runtime_par (const QueryInfo &queryInfo, const QueryPlan &plan, Constraints constraints, Func func) |
| |
|
template<bool HasFilters, QueryExecType ExecType, typename Func > |
| void | run_query_runtime_planned (const QueryInfo &queryInfo, const QueryPlan &plan, Constraints constraints, Func func) |
| |
| template<QueryExecType ExecType, typename Func > |
| void | run_query_on_chunks_runtime_planned (QueryInfo &queryInfo, const QueryPlan &plan, Constraints constraints, Func func) |
| | Runs public iterator chunk execution from an already prepared plan.
|
| |
| GAIA_NODISCARD bool | can_use_direct_chunk_iteration_fastpath (const QueryInfo &queryInfo) const |
| | Checks whether typed callbacks can use dense chunk iteration while preserving required cache ordering.
|
| |
| GAIA_NODISCARD QueryCacheRange | selected_query_cache_range (const QueryInfo &queryInfo) const |
| | Selects the cache range visible to this query, applying a selected group id when present.
|
| |
| GAIA_NODISCARD QueryPlan | prepare_query_plan (const QueryInfo &queryInfo, const TypedQueryExecState &state) const |
| | Selects the prepared execution plan for typed callbacks.
|
| |
| template<bool HasFilters, typename Func , typename... T> |
| void | run_query_on_chunks_direct_typed (QueryInfo &queryInfo, const QueryPlan &plan, const TypedQueryExecState &state, Func &func, core::func_type_list< T... >) |
| | Runs the prepared direct typed row path for simple cached queries.
|
| |
|
void | run_query_on_chunks_direct (QueryInfo &queryInfo, const QueryPlan &plan, const TypedQueryExecState &state, void *pFunc, void(*runChunk)(QueryImpl &, Iter &, void *, const TypedQueryExecState &)) |
| |
|
void | run_query_on_chunks_direct_iter (QueryInfo &queryInfo, const QueryPlan &plan, const TypedQueryExecState &state, void *pFunc, void(*runChunk)(QueryImpl &, Iter &, void *, const TypedQueryExecState &)) |
| |
|
template<QueryExecType ExecType> |
| void | each_inter (QueryInfo &queryInfo, const QueryPlan &plan, void *pFunc, const TypedQueryExecState &state, void(*runDirectFastChunk)(QueryImpl &, Iter &, void *, const TypedQueryExecState &), void(*runDirectChunk)(QueryImpl &, Iter &, void *, const TypedQueryExecState &), void(*runMappedChunk)(QueryImpl &, const QueryInfo &, Iter &, void *, const TypedQueryExecState &), bool needsInheritedArgIds, void(*invokeInherited)(World &, Entity, const Entity *, void *)) |
| |
|
void | each_typed_erased (QueryExecType execType, void *pFunc, const TypedQueryExecState &state, void(*runDirectFastChunk)(QueryImpl &, Iter &, void *, const TypedQueryExecState &), void(*runDirectChunk)(QueryImpl &, Iter &, void *, const TypedQueryExecState &), void(*runMappedChunk)(QueryImpl &, const QueryInfo &, Iter &, void *, const TypedQueryExecState &), bool needsInheritedArgIds, void(*invokeInherited)(World &, Entity, const Entity *, void *)) |
| |
|
template<QueryExecType ExecType, typename Func > |
| void | each_typed_inter (QueryInfo &queryInfo, Func func) |
| |
|
template<QueryExecType ExecType> |
| void | each_iter_inter_erased (QueryInfo &queryInfo, const QueryPlan &plan, void *pFunc, const TypedQueryExecState &state, void(*runDirectFastChunk)(QueryImpl &, Iter &, void *, const TypedQueryExecState &), void(*runMappedChunk)(QueryImpl &, const QueryInfo &, Iter &, void *, const TypedQueryExecState &)) |
| |
|
void | each_walk_inter (QueryInfo &queryInfo, std::span< const Entity > entities, Constraints constraints, void *pFunc, const TypedQueryExecState &state, void(*runChunk)(QueryImpl &, const QueryInfo &, Iter &, void *, const TypedQueryExecState &)) |
| |
| GAIA_NODISCARD QueryPlan | prepare_query_plan (const QueryInfo &queryInfo, Constraints constraints) const |
| | Selects the prepared execution plan for public iterator callbacks.
|
| |
| template<bool HasFilters, bool HasGroups, typename Func > |
| void | run_query_on_chunks_runtime_direct_plain_impl (QueryInfo &queryInfo, const QueryPlan &plan, Constraints constraints, Func &func) |
| | Runs a public Iter callback over cached chunks without creating chunk batches.
|
| |
| template<QueryExecType ExecType, typename Func > |
| void | each_runtime_inter (Func func, Constraints constraints=Constraints::EnabledOnly) |
| | Runs a public iterator callback through the fastest supported runtime path.
|
| |
| void | each_runtime_erased (QueryExecType execType, void *pFunc, void(*invoke)(void *, Iter &), Constraints constraints) |
| | Runs a type-erased public iterator callback through generic query execution.
|
| |
| void | each_runtime_erased (QueryInfo &queryInfo, const QueryPlan &plan, QueryExecType execType, void *pFunc, void(*invoke)(void *, Iter &), Constraints constraints) |
| | Runs a type-erased public iterator callback using an already prepared query cache and plan.
|
| |
|
GAIA_NODISCARD std::span< const detail::BfsChunkRun > | cached_direct_seed_runs (QueryInfo &queryInfo, const QueryTerm &seedTerm, const DirectEntitySeedInfo &seedInfo, Constraints constraints) |
| |
|
GAIA_NODISCARD std::span< const Entity > | cached_direct_seed_chunk_entities (QueryInfo &queryInfo, const QueryTerm &seedTerm, const DirectEntitySeedInfo &seedInfo, Constraints constraints) |
| |
| template<typename Func > |
| void | for_each_direct_or_union (World &world, const QueryInfo &queryInfo, Constraints constraints, Func &&func) |
| | Visits the deduplicated OR union for direct-seeded queries without materializing an entity seed array first.
|
| |
| template<bool UseFilters> |
| GAIA_NODISCARD bool | empty_inter (const QueryInfo &queryInfo, Constraints constraints) const |
| | Fast empty() path for direct non-fragmenting queries that can seed from entity-backed indices.
|
| |
| GAIA_NODISCARD bool | matches_target_entities (QueryInfo &queryInfo, const Archetype &archetype, EntitySpan targetEntities) |
| | Returns whether any of the provided target entities matches the query semantics.
|
| |
| template<bool UseFilters> |
| GAIA_NODISCARD uint32_t | count_inter (const QueryInfo &queryInfo, Constraints constraints) const |
| | Fast count() path for direct non-fragmenting queries that can seed from entity-backed indices.
|
| |
|
template<typename Func > |
| void | each_chunk_runs_iter (QueryInfo &queryInfo, std::span< const detail::BfsChunkRun > runs, Constraints constraints, Func func) |
| |
|
template<typename Func > |
| void | each_direct_entities_iter (QueryInfo &queryInfo, std::span< const Entity > entities, Constraints constraints, Func func) |
| |
| template<typename Func > |
| void | each_direct_iter_inter (QueryInfo &queryInfo, Constraints constraints, Func func) |
| | Runs an iterator-based each() callback over directly seeded entities using one-row chunk views.
|
| |
|
void | each_direct_inter (QueryInfo &queryInfo, Constraints constraints, void *pFunc, const TypedQueryExecState &state, void(*runDirectChunk)(QueryImpl &, Iter &, void *, const TypedQueryExecState &), bool needsInheritedArgIds, void(*invokeInherited)(World &, Entity, const Entity *, void *)) |
| | Runs a typed each() callback over directly seeded entities.
|
| |
|
template<bool UseFilters, typename ContainerOut > |
| void | arr_inter (QueryInfo &queryInfo, ContainerOut &outArray, Constraints constraints) |
| |
|
| QueryImpl (World &world, QueryCache &queryCache, ArchetypeId &nextArchetypeId, uint32_t &worldVersion, const EntityToArchetypeMap &entityToArchetypeMap, const EntityToArchetypeVersionMap &entityToArchetypeMapVersions, const ArchetypeDArray &allArchetypes) |
| |
| GAIA_NODISCARD QueryId | id () const |
| | Returns the cache handle id of this query.
|
| |
| GAIA_NODISCARD uint32_t | gen () const |
| | Returns the cache handle generation of this query.
|
| |
|
void | reset () |
| | Release any data allocated by the query.
|
| |
|
void | destroy () |
| | Destroys the current cached query state and local scratch data.
|
| |
| GAIA_NODISCARD bool | is_cached () const |
| | Returns whether the query is stored in the query cache.
|
| |
| QueryImpl & | add (const char *str,...) |
| | Creates a query from a null-terminated expression string.
|
| |
| QueryImpl & | add (QueryInput item) |
| | Adds a prebuilt query input item.
|
| |
| QueryImpl & | is (Entity entity, const QueryTermOptions &options=QueryTermOptions{}) |
| | Adds a semantic Is(entity) requirement.
|
| |
| QueryImpl & | in (Entity entity, QueryTermOptions options=QueryTermOptions{}) |
| | Adds an inherited in(entity) requirement.
|
| |
| QueryImpl & | all (Entity entity, const QueryTermOptions &options=QueryTermOptions{}) |
| | Adds a required entity or pair term.
|
| |
| template<typename T > |
| QueryImpl & | all (const QueryTermOptions &options) |
| | Adds a required typed term.
|
| |
| template<typename T > |
| QueryImpl & | all () |
| | Adds a required typed term.
|
| |
| QueryImpl & | any (Entity entity, const QueryTermOptions &options=QueryTermOptions{}) |
| | Adds an optional entity or pair term.
|
| |
| template<typename T > |
| QueryImpl & | any (const QueryTermOptions &options) |
| | Adds an optional typed term.
|
| |
| template<typename T > |
| QueryImpl & | any () |
| | Adds an optional typed term.
|
| |
| QueryImpl & | or_ (Entity entity, const QueryTermOptions &options=QueryTermOptions{}) |
| | OR terms (at least one has to match). A single OR term is canonicalized to ALL during query normalization.
|
| |
| template<typename T > |
| QueryImpl & | or_ (const QueryTermOptions &options) |
| | Adds an OR typed term.
|
| |
| template<typename T > |
| QueryImpl & | or_ () |
| | Adds an OR typed term.
|
| |
| QueryImpl & | no (Entity entity, const QueryTermOptions &options=QueryTermOptions{}) |
| | Adds an excluded entity or pair term.
|
| |
| template<typename T > |
| QueryImpl & | no (const QueryTermOptions &options) |
| | Adds an excluded typed term.
|
| |
| template<typename T > |
| QueryImpl & | no () |
| | Adds an excluded typed term.
|
| |
| QueryImpl & | var_name (Entity varEntity, util::str_view name) |
| | Assigns a human-readable name to a query variable entity (Var0..Var7). The name can be used later by set_var(name, value).
|
| |
|
QueryImpl & | var_name (Entity varEntity, const char *name) |
| | Assigns a human-readable name to a query variable entity (Var0..Var7).
|
| |
| QueryImpl & | set_var (Entity varEntity, Entity value) |
| | Binds a query variable (Var0..Var7) to a concrete entity value. Bound values are applied at runtime before query evaluation.
|
| |
| QueryImpl & | set_var (util::str_view name, Entity value) |
| | Binds a named query variable to a concrete entity value.
|
| |
|
QueryImpl & | set_var (const char *name, Entity value) |
| | Binds a named query variable to a concrete entity value.
|
| |
|
QueryImpl & | clear_var (Entity varEntity) |
| | Clears binding for a single query variable (Var0..Var7). The variable becomes unbound for the next query evaluation.
|
| |
|
QueryImpl & | clear_vars () |
| | Clears all runtime variable bindings.
|
| |
| QueryImpl & | changed (Entity entity) |
| | Marks a runtime component or pair for changed() filtering.
|
| |
| template<typename T > |
| QueryImpl & | changed () |
| | Marks a typed term for changed() filtering.
|
| |
| QueryImpl & | sort_by (Entity entity, TSortByFunc func) |
| | Sorts the query by the specified entity and function.
|
| |
| template<typename T > |
| QueryImpl & | sort_by (TSortByFunc func) |
| | Sorts the query by the specified component and function.
|
| |
| template<typename Rel , typename Tgt > |
| QueryImpl & | sort_by (TSortByFunc func) |
| | Sorts the query by the specified pair and function.
|
| |
| GAIA_NODISCARD OrderByTravView | order_by (Entity relation, TravOrder order) |
| | Iterates matching entities in an explicit relation traversal order.
|
| |
| template<typename Rel > |
| GAIA_NODISCARD OrderByTravView | order_by (TravOrder order) |
| | Iterates matching entities in an explicit typed relation traversal order.
|
| |
| QueryImpl & | depth_order (Entity relation=ChildOf) |
| | Orders cached query entries by fragmenting relation depth so iteration runs breadth-first top-down. Intended only for fragmenting relations such as ChildOf or DependsOn where the target participates in archetype identity. Unlike order_by(relation, TravOrder), this affects the cached query iteration order itself and can therefore prune fragmenting disabled subtrees at the archetype level. For non-fragmenting relations such as Parent, use order_by(...) instead.
|
| |
| template<typename Rel > |
| QueryImpl & | depth_order () |
| | Orders cached query entries by fragmenting relation depth so iteration runs breadth-first top-down.
|
| |
| QueryImpl & | group_by (Entity entity, TGroupByFunc func=group_by_func_default) |
| | Organizes matching archetypes into groups according to the grouping function and entity. Does not order iteration by group id. Use group_id(...) to filter one group. Use depth_order(...) or sort_by(...) when iteration order matters.
|
| |
| template<typename T > |
| QueryImpl & | group_by (TGroupByFunc func=group_by_func_default) |
| | Organizes matching archetypes into groups according to the grouping function. Does not order iteration by group id. Use group_id(...) to filter one group. Use depth_order(...) or sort_by(...) when iteration order matters.
|
| |
| template<typename Rel , typename Tgt > |
| QueryImpl & | group_by (TGroupByFunc func=group_by_func_default) |
| | Organizes matching archetypes into groups according to the grouping function. Does not order iteration by group id. Use group_id(...) to filter one group. Use depth_order(...) or sort_by(...) when iteration order matters.
|
| |
| QueryImpl & | group_dep (Entity relation) |
| | Declares an explicit relation dependency for grouped cache invalidation. Useful for custom group_by callbacks that depend on hierarchy or relation topology.
|
| |
| template<typename Rel > |
| QueryImpl & | group_dep () |
| | Declares an explicit relation dependency for grouped cache invalidation. Useful for custom group_by callbacks that depend on hierarchy or relation topology.
|
| |
| QueryImpl & | group_id (GroupId groupId) |
| | Selects the group to iterate over.
|
| |
| QueryImpl & | group_id (Entity entity) |
| | Selects the group to iterate over.
|
| |
| template<typename T > |
| QueryImpl & | group_id () |
| | Selects the group to iterate over.
|
| |
| template<typename Func > |
| GAIA_NODISCARD SchedJob | job (Func func, QueryExecType execType) |
| | Adds a query execution job without submitting it.
|
| |
| template<typename Func , std::enable_if_t< detail::is_query_iter_callback_v< Func >, int > = 0> |
| void | each (Func func) |
| | Iterates query matches using the default execution mode.
|
| |
|
template<typename Func , std::enable_if_t<!detail::is_query_iter_callback_v< Func >, int > = 0> |
| void | each (Func func) |
| |
| template<typename Func , std::enable_if_t< detail::is_query_iter_callback_v< Func >, int > = 0> |
| void | each (Func func, QueryExecType execType) |
| | Iterates query matches using the selected execution mode.
|
| |
|
template<typename Func , std::enable_if_t< detail::is_query_iter_callback_v< Func >, int > = 0> |
| void | each (Func func, Constraints constraints) |
| |
|
template<typename Func , std::enable_if_t< detail::is_query_iter_callback_v< Func >, int > = 0> |
| void | each (Func func, QueryExecType execType, Constraints constraints) |
| |
|
template<typename Func , std::enable_if_t<!detail::is_query_iter_callback_v< Func >, int > = 0> |
| void | each (Func func, QueryExecType execType) |
| |
| template<typename Func > |
| void | each_iter (Iter &it, Func func) |
| | Runs a typed callback against an already prepared iterator. This is used by higher-level adapters that normalize execution to Iter& first and then materialize typed arguments on top of the iterator.
|
| |
|
void | each_iter_erased (QueryExecType execType, void *pFunc, const TypedQueryExecState &state, void(*runDirectFastChunk)(QueryImpl &, Iter &, void *, const TypedQueryExecState &), void(*runMappedChunk)(QueryImpl &, const QueryInfo &, Iter &, void *, const TypedQueryExecState &)) |
| |
|
void | each_iter_erased (Iter &it, void *pFunc, const TypedQueryExecState &state, void(*runDirectFastChunk)(QueryImpl &, Iter &, void *, const TypedQueryExecState &), void(*runMappedChunk)(QueryImpl &, const QueryInfo &, Iter &, void *, const TypedQueryExecState &)) |
| |
| template<typename Func > |
| void | each_arch (Func func, Constraints constraints=Constraints::EnabledOnly) |
| | Iterates matching archetypes instead of individual entities.
|
| |
| bool | empty (Constraints constraints=Constraints::EnabledOnly) |
| | Returns true or false depending on whether there are any entities matching the query.
|
| |
| uint32_t | count (Constraints constraints=Constraints::EnabledOnly) |
| | Calculates the number of entities matching the query.
|
| |
| void | each_entity_enabled (void *pCtx, void(*func)(void *, Entity)) |
| | Iterates matching enabled entities through a non-template erased callback.
|
| |
|
void | collect_entities_enabled (cnt::darray< Entity > &out) |
| |
| template<typename Container > |
| void | arr (Container &outArray, Constraints constraints=Constraints::EnabledOnly) |
| | Appends all components or entities matching the query to the output array.
|
| |
| GAIA_NODISCARD std::span< const Entity > | ordered_entities_walk (QueryInfo &queryInfo, Entity relation, TravOrder order, Constraints constraints=Constraints::EnabledOnly) |
| | Builds and caches relation traversal order for the current query result.
|
| |
| template<typename Func , std::enable_if_t< detail::is_query_walk_core_callback_v< Func >, int > = 0> |
| void | each_walk (Func func, Entity relation, TravOrder order=TravOrder::Down, Constraints constraints=Constraints::EnabledOnly) |
| | Iterates entities matching the query in a requested relation traversal order. For relation R this treats Pair(R, X) on entity E as "E points at X". Traversal changes only visit order. Nodes with the same parent are ordered by entity id.
|
| |
|
template<typename Func , std::enable_if_t<!detail::is_query_walk_core_callback_v< Func >, int > = 0> |
| void | each_walk (Func func, Entity relation, TravOrder order=TravOrder::Down, Constraints constraints=Constraints::EnabledOnly) |
| |
|
void | diag () |
| | Run diagnostics.
|
| |
| GAIA_NODISCARD util::str | bytecode () |
| | Returns a textual dump of the generated query VM bytecode.
|
| |
|
void | diag_bytecode () |
| | Prints a textual dump of the generated query VM bytecode.
|
| |
|
template<typename Rel > |
| QueryImpl::OrderByTravView | order_by (TravOrder order) |
| |
|
Stores raw, user-owned data on this query and exposes it to iterator-style callbacks.
- See also
- Iter::ctx() const
-
SystemBuilder::ctx(void*)
|
| QueryImpl & | ctx (void *pCtx) |
| | Sets the user-owned context pointer visible through Iter::ctx() during iterator callbacks. Changing the pointer does not affect query identity, query matching, shared-cache lookup, or cached query storage. Identical shared-cache query shapes may therefore keep different context pointers.
|
| |
| GAIA_NODISCARD void * | ctx () const |
| | Returns the user-owned context pointer attached to this query.
|
| |
|
Marks whether this query must run on the main thread/serial path.
Use this for callbacks with side effects that are not captured by component read/write declarations, such as external APIs that are main-thread-only. This flag is scheduling metadata only and does not affect query matching, hashing, shared-cache identity, or cache invalidation. - Parameters
-
| required | True when the query requires the main thread/serial path. |
- Returns
- Self reference.
|
|
QueryImpl & | main_thread (bool required=true) |
| |
| GAIA_NODISCARD bool | main_thread_required () const |
| | Returns whether this query must run on the main thread/serial path.
|
| |
|
Declares an additional id read by this query callback.
Use this for data accessed inside the query kernel but not present as a positive query term. The declaration is scheduling metadata only; it does not change query matching or cache identity. - Parameters
-
| entity | Component/entity id read by user code. |
- Returns
- Self reference.
- See also
- writes(Entity)
|
|
QueryImpl & | reads (Entity entity) |
| |
| template<typename T > |
| QueryImpl & | reads () |
| | Declares an additional component or pair type read by this query callback.
|
| |
| QueryImpl & | writes (Entity entity) |
| | Declares an additional id written by this query callback.
|
| |
| template<typename T > |
| QueryImpl & | writes () |
| | Declares an additional component or pair type written by this query callback.
|
| |
| GAIA_NODISCARD std::span< const Entity > | custom_reads () const |
| | Returns explicitly declared read ids that are not query terms.
|
| |
| GAIA_NODISCARD std::span< const Entity > | custom_writes () const |
| | Returns explicitly declared write ids that are not query terms.
|
| |
| GAIA_NODISCARD QueryAccess | access (Entity entity) |
| | Returns the effective read/write access for an id.
|
| |
| GAIA_NODISCARD bool | conflicts_with (QueryImpl &other) |
| | Returns whether this query conflicts with another query's effective access declarations.
|
| |
| GAIA_NODISCARD bool | can_run_parallel (QueryImpl &other) |
| | Returns whether this query can run concurrently with another query based on declared scheduling metadata.
|
| |
|
| static GAIA_NODISCARD bool | match_filters (const Chunk &chunk, const QueryInfo &queryInfo, uint32_t changedWorldVersion, std::span< const uint8_t > compIndices) |
| | Returns whether a chunk passes the query's changed filters.
|
| |
| static GAIA_NODISCARD bool | match_filters (const Chunk &chunk, const QueryInfo &queryInfo, uint32_t changedWorldVersion) |
| | Returns whether a chunk passes the query's changed filters.
|
| |
| static GAIA_NODISCARD bool | has_depth_order_hierarchy_enabled_barrier (const QueryInfo &queryInfo) |
| | Checks whether depth-order grouping can prune disabled hierarchy subtrees.
|
| |
| static GAIA_NODISCARD bool | needs_depth_order_hierarchy_barrier_cache (const QueryInfo &queryInfo, Constraints constraints) |
| | Checks whether the current row constraints require the depth-order hierarchy barrier cache.
|
| |
| static void | chunk_effective_range (Chunk *pChunk, Constraints constraints, bool needsBarrierCache, bool barrierPasses, uint16_t &from, uint16_t &to) noexcept |
| | Calculates the row range of a chunk after applying row constraints and depth-order barrier state.
|
| |
| static GAIA_NODISCARD bool | depth_order_hierarchy_barrier_prunes (const QueryInfo &queryInfo) |
| | Checks whether cached depth-order barrier results can prune any matched archetype.
|
| |
| static GAIA_NODISCARD bool | survives_cascade_hierarchy_enabled_barrier (const QueryInfo &queryInfo, const Archetype &archetype) |
| | Fast enabled-subtree gate for cached depth_order(...) queries over fragmenting hierarchy relations. ChildOf is the native built-in example, but the rule is semantic: the relation must support depth_order(...) and also form a fragmenting hierarchy chain. For such relations, all rows in the archetype share the same direct parent target. That lets us prune the entire archetype when its parent chain crosses a disabled entity. Non-fragmenting hierarchy relations such as Parent cannot use this archetype-level check and must stay on the per-entity traversal path instead.
|
| |
|
template<typename TIter > |
| static void | finish_iter_writes (TIter &it) |
| |
|
static void | finish_typed_chunk_writes_runtime (World &world, Chunk *pChunk, uint16_t from, uint16_t to, const Entity *pArgIds, const bool *pWriteFlags, uint32_t argCnt, uint32_t firstWriteArg) |
| |
|
template<typename... T> |
| static void | finish_typed_chunk_writes (World &world, Chunk *pChunk, uint16_t from, uint16_t to) |
| |
|
static void | finish_typed_iter_writes_runtime (Iter &it, const Entity *pArgIds, const bool *pWriteFlags, uint32_t argCnt, uint32_t firstWriteArg) |
| |
| static GAIA_NODISCARD ExecPayloadKind | exec_payload_kind (const QueryInfo &queryInfo, Constraints constraints) |
| | Classifies the generic batch payload needed for a matched query under row constraints.
|
| |
| template<typename TMode > |
| static GAIA_NODISCARD constexpr Constraints | iter_mode_constraints () |
| | Maps an iteration-mode tag to the runtime row constraints used by iterators.
|
| |
| template<typename Func , typename TMode > |
| static void | run_query_func (World *pWorld, Func func, ChunkBatch &batch) |
| | Executes an iterator callback for one prepared chunk batch.
|
| |
| template<typename Func > |
| static void | run_query_arch_func (World *pWorld, Func func, ChunkBatch &batch, Constraints constraints) |
| | Executes an archetype-level iterator callback for one prepared chunk batch. The iterator is initialized with archetype metadata but no chunk rows.
|
| |
| template<typename Func , typename TMode > |
| static void | run_query_func (World *pWorld, Func func, std::span< ChunkBatch > batches) |
| | Executes an iterator callback over a contiguous list of prepared chunk batches.
|
| |
|
template<typename Func > |
| static void | invoke_query_task_job (void *pCtx) |
| |
|
template<typename Func > |
| static void | cleanup_query_task_job (void *pCtx) |
| |
|
template<typename Func , typename TMode > |
| static void | cleanup_query_job (void *pCtx) |
| |
|
template<typename Func > |
| static void | run_query_func_runtime (World *pWorld, Func func, std::span< ChunkBatch > batches, Constraints constraints) |
| |
| template<typename Func , typename TIter > |
| static void | invoke_runtime_iter (void *pFunc, TIter &it) |
| | Invokes a type-erased public iterator callback.
|
| |
| static GAIA_NODISCARD bool | is_adjunct_direct_term (const World &world, const QueryTerm &term) |
| | Returns whether a direct term is backed by non-fragmenting storage and must be evaluated per entity.
|
| |
| static GAIA_NODISCARD bool | uses_semantic_is_matching (const QueryTerm &term) |
| | Returns whether a term uses semantic Is matching rather than direct storage matching.
|
| |
| static GAIA_NODISCARD bool | uses_in_is_matching (const QueryTerm &term) |
| | Returns whether a term uses strict semantic Is matching that excludes the base entity itself.
|
| |
| static GAIA_NODISCARD bool | uses_non_direct_is_matching (const QueryTerm &term) |
| | Returns whether a term uses any semantic Is matching rather than direct storage matching.
|
| |
| static GAIA_NODISCARD bool | uses_potential_inherited_id_matching (const QueryTerm &term) |
| | Returns whether a term could use inherited-id matching based on query shape alone. This intentionally ignores mutable world metadata such as current OnInstantiate policy.
|
| |
| static GAIA_NODISCARD bool | uses_inherited_id_matching (const World &world, const QueryTerm &term) |
| | Returns whether a term uses semantic inherited-id matching rather than direct storage matching.
|
| |
|
static GAIA_NODISCARD bool | match_entity_term (const World &world, Entity entity, const QueryTerm &term) |
| | Evaluates term presence for a concrete entity using either direct or semantic semantics.
|
| |
|
static GAIA_NODISCARD bool | match_single_direct_target_term (const World &world, Entity entity, Entity termId, QueryCtx::DirectTargetEvalKind kind) |
| | Evaluates a compiled single-term direct-target query without re-walking the generic term loop.
|
| |
|
static GAIA_NODISCARD uint32_t | count_direct_term_entities (const World &world, const QueryTerm &term) |
| |
|
static void | collect_direct_term_entities (const World &world, const QueryTerm &term, cnt::darray< Entity > &out) |
| |
|
template<typename Func > |
| static GAIA_NODISCARD bool | for_each_direct_term_entity (const World &world, const QueryTerm &term, Func &&func) |
| |
|
static GAIA_NODISCARD bool | can_use_direct_entity_seed_eval (const QueryInfo &queryInfo) |
| | Detects queries that can skip archetype seeding and start directly from entity-backed term indices.
|
| |
|
static GAIA_NODISCARD bool | can_use_direct_target_eval (const QueryInfo &queryInfo) |
| | Detects queries whose terms can be evaluated directly against concrete target entities.
|
| |
|
static GAIA_NODISCARD bool | has_only_direct_or_terms (const QueryInfo &queryInfo) |
| | Detects the special direct OR/NOT shape that can be answered from a union of direct term entity sets.
|
| |
|
static void | add_chunk_run (cnt::darray< detail::BfsChunkRun > &runs, const EntityContainer &ec, uint32_t entityOffset) |
| |
|
static GAIA_NODISCARD bool | should_prefer_direct_seed_term (const World &world, const QueryTerm &candidate, uint32_t candidateCount, const DirectEntitySeedPlan &plan) |
| | Chooses the narrowest available seed for direct non-fragmenting evaluation.
|
| |
|
static GAIA_NODISCARD DirectEntitySeedPlan | direct_entity_seed_plan (const World &world, const QueryInfo &queryInfo) |
| |
|
static GAIA_NODISCARD bool | match_direct_entity_terms (const World &world, Entity entity, const QueryInfo &queryInfo, const DirectEntitySeedInfo &seedInfo) |
| | Evaluates the remaining direct terms for a single seeded entity after the seed term itself was consumed.
|
| |
|
static GAIA_NODISCARD const QueryTerm * | find_direct_all_seed_term (const QueryInfo &queryInfo, const DirectEntitySeedPlan &plan) |
| |
|
static GAIA_NODISCARD DirectEntitySeedEvalPlan | direct_all_seed_eval_plan (const QueryInfo &queryInfo, const DirectEntitySeedInfo &seedInfo) |
| |
| static GAIA_NODISCARD bool | can_use_direct_seed_run_cache (const World &world, const QueryInfo &queryInfo, const QueryTerm &seedTerm) |
| | Returns whether a repeated semantic or inherited seed can be cached as chunk runs.
|
| |
|
template<typename Func > |
| static GAIA_NODISCARD bool | for_each_direct_all_seed (const World &world, const QueryInfo &queryInfo, const DirectEntitySeedPlan &plan, Constraints constraints, Func &&func) |
| |
|
static GAIA_NODISCARD bool | match_direct_entity_constraints (const World &world, const QueryInfo &queryInfo, Entity entity, Constraints constraints) |
| | Applies iterator-specific entity state constraints to the direct seeded path.
|
| |
|
static GAIA_NODISCARD bool | can_use_archetype_bucket_count (const World &world, const QueryInfo &queryInfo, const DirectEntitySeedInfo &seedInfo) |
| | Detects when a direct seed can be counted by archetype buckets instead of per entity checks.
|
| |
|
static GAIA_NODISCARD uint32_t | count_direct_entity_seed_by_archetype (const World &world, const QueryInfo &queryInfo, const cnt::darray< Entity > &seedEntities, const DirectEntitySeedInfo &seedInfo, Constraints constraints) |
| | Groups seeded entities by archetype and counts whole buckets when only structural ALL/NOT terms remain.
|
| |
|
static GAIA_NODISCARD uint32_t | count_direct_or_union (const World &world, const QueryInfo &queryInfo, Constraints constraints) |
| | Counts the union of direct OR term entity sets while deduplicating entities across terms.
|
| |
| static GAIA_NODISCARD bool | is_empty_direct_or_union (const World &world, const QueryInfo &queryInfo, Constraints constraints) |
| | Returns whether the direct OR union becomes empty after applying NOT terms and iterator constraints.
|
| |
|
static DirectEntitySeedInfo | build_direct_entity_seed (const World &world, const QueryInfo &queryInfo, cnt::darray< Entity > &out) |
| | Builds the best direct entity seed set from the smallest positive ALL term or the OR union fallback.
|
| |
| static GAIA_NODISCARD bool | has_direct_not_terms (const QueryInfo &queryInfo) |
| | Returns whether direct OR evaluation still has direct NOT terms that must be checked per entity.
|
| |
|
static GAIA_NODISCARD bool | match_entity_filters (const World &world, Entity entity, const QueryInfo &queryInfo) |
| | Evaluates the entity-level terms that are not fully represented by archetype membership.
|
| |
|
static void | init_direct_entity_iter (const QueryInfo &queryInfo, const World &world, const EntityContainer &ec, Iter &it, uint8_t *pIndices, Entity *pTermIds, const Archetype *&pLastArchetype) |
| |
|
static void | init_direct_entity_iter (const QueryInfo &queryInfo, const World &world, Entity entity, Iter &it, uint8_t *pIndices, Entity *pTermIds) |
| |
| static GAIA_NODISCARD bool | can_use_direct_chunk_term_eval_arg (World &world, const QueryInfo &queryInfo, const DirectChunkArgEvalDesc &desc) |
| | Returns whether a runtime query argument descriptor can use direct chunk access.
|
| |
|
static GAIA_NODISCARD bool | can_use_direct_chunk_term_eval_descs (World &world, const QueryInfo &queryInfo, const DirectChunkArgEvalDesc *pDescs, uint32_t descCnt) |
| |