![]() |
Gaia-ECS v1.0.0
A simple and powerful entity component system
|
Builds, caches, and executes a Gaia-ECS query. More...
#include <query.h>
Classes | |
| struct | IterModeAcceptAll |
| Tag selecting unconstrained row iteration for prepared query iteration. More... | |
| struct | IterModeDisabledOnly |
| Tag selecting disabled-only row constraints for prepared query iteration. More... | |
| struct | IterModeEnabled |
| Tag selecting enabled-only row constraints for prepared query iteration. More... | |
| class | OrderByTravView |
| Lightweight view that executes a query in deterministic relation traversal order. More... | |
| class | ParallelScope |
Records OnSet notifications and sorted-query invalidations produced by a parallel region instead of applying them from worker threads, then applies them on the coordinator thread once the region joins. Observers therefore always run on the thread that started the query, in work-item order, exactly like the serial path. Sorted-query invalidation flips a shared SortEntities dirty bit that is not safe to touch from a worker thread. The observer channel is active only when GAIA_OBSERVERS_ENABLED; the sorted-query channel always defers. More... | |
| class | ParallelSlot |
Binds a parallel work-item range to its shared deferred-notification slot for the lifetime of the scope. Work items are distributed in disjoint ranges, so the first item of a range identifies a queue no other thread writes to. Both the observer (OnSet) and sorted-query-invalidation deferral channels read this same slot, so a single binding serves both. More... | |
| struct | QueryCacheRange |
| Cache range selected by the query's optional group id filter. More... | |
| struct | QueryPlan |
| Prepared query execution metadata shared by typed callbacks and public Iter callbacks. More... | |
Public Types | |
| enum class | ExecPayloadKind : uint8_t { Plain , Grouped , NonTrivial } |
| Runtime payload layout required by generic chunk-batch execution. More... | |
| enum class | QueryPlanMode : uint8_t { Empty , General , EntitySeed , DirectDense , MappedDense , SparseDense , Sorted , Traversal } |
| Prepared query runner mode shared by typed callbacks and public Iter callbacks. More... | |
| enum | QueryPlanFlags : uint8_t { QueryPlanFlag_None = 0 , QueryPlanFlag_Filtered = 1 << 0 , QueryPlanFlag_EntityFilter = 1 << 1 , QueryPlanFlag_InheritedPayload = 1 << 2 , QueryPlanFlag_Grouped = 1 << 3 , QueryPlanFlag_Sorted = 1 << 4 , QueryPlanFlag_BarrierCache = 1 << 5 } |
| Orthogonal flags attached to a prepared query plan. More... | |
Public Member Functions | |
| 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 |
| Returns whether an archetype is eligible for query execution. | |
| 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. | |
| 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. | |
| 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 an erased typed callback over entities selected by a direct sparse or target-term seed. | |
| QueryImpl (World &world, QueryCache &queryCache, ArchetypeId &nextArchetypeId, uint32_t &worldVersion, const EntityToArchetypeMap &entityToArchetypeMap, const EntityToArchetypeVersionMap &entityToArchetypeMapVersions, const ArchetypeDArray &allArchetypes) | |
| Creates a query bound to a world's query and archetype state. | |
| 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 Container > | |
| void | groups (Container &out, bool sortGroups) |
| Collects active non-zero group ids for a grouped query. The ids can be fed back to group_id(...) to process each group without knowing group ids ahead of time. | |
| 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) |
| Iterates query matches with a typed component callback 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, 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) |
| Iterates query matches with an iterator callback under the selected row 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) |
| Iterates query matches with an iterator callback using the selected execution mode and row constraints. | |
| 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 with a typed component callback using the selected execution mode. | |
| 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. | |
| 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. | |
| 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) |
| Iterates matching entities in relation order with a typed component callback. | |
| 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. | |
Query context | |
Stores raw, user-owned data on this query and exposes it to iterator-style callbacks.
| |
| 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. | |
Scheduling declarations | |
Scheduling metadata used when coordinating query execution. | |
| QueryImpl & | main_thread (bool required=true) |
| Marks whether this query must run on the main thread/serial path. | |
| GAIA_NODISCARD bool | main_thread_required () const |
| Returns whether this query must run on the main thread/serial path. | |
Query access declarations | |
Explicit access metadata for data used outside positive query terms. | |
| QueryImpl & | reads (Entity entity) |
| Declares an additional id read by this query callback. | |
| 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 Public Member Functions | |
| 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. | |
| 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 , typename TIter > | |
| static void | invoke_runtime_iter (void *pFunc, TIter &it) |
| Invokes a type-erased public iterator callback. | |
| static GAIA_NODISCARD bool | is_non_fragmenting_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 Public Attributes | |
| static bool | SilenceInvalidCacheKindAssertions = false |
| Suppresses assertions when an invalid cache-kind combination is queried for diagnostics. | |
Friends | |
| class | SystemBuilder |
Builds, caches, and executes a Gaia-ECS query.
|
strong |
Runtime payload layout required by generic chunk-batch execution.
| enum gaia::ecs::detail::QueryImpl::QueryPlanFlags : uint8_t |
Orthogonal flags attached to a prepared query plan.
Flags describe properties that can apply to multiple runner modes. Keep them separate from QueryPlanMode so filtered and unfiltered variants do not multiply execution-mode values.
|
strong |
Prepared query runner mode shared by typed callbacks and public Iter callbacks.
The mode is selected after the query cache has been matched. It describes the runner family independently from orthogonal query properties such as filters. Public C++ templates are expected to remain thin adapters on top of this prepared execution metadata.
| Enumerator | |
|---|---|
| Empty | The selected group/range has no matching archetypes, so execution can return immediately. |
| General | Use the generic query execution path because no specialized runner is valid. |
| EntitySeed | Direct entity-seed evaluation over explicitly selected entities. |
| DirectDense | Direct cached archetype/chunk iteration with query-term indices matching storage layout. |
| MappedDense | Typed dense cached archetype/chunk iteration using mapped component access. Public Iter callbacks use DirectDense with iterator component-index mapping instead. |
| SparseDense | Typed cached chunk iteration with compile-time sparse payload access. |
| Sorted | Sorted payload execution that must preserve cache-provided chunk order. |
| Traversal | Traversal or inherited payload execution that requires the mapped generic path. |
|
inline |
Creates a query bound to a world's query and archetype state.
| world | World that owns the query. |
| queryCache | Cache used to store prepared query data. |
| nextArchetypeId | Highest archetype identifier allocated by the world. |
| worldVersion | Current world version used by changed filters. |
| entityToArchetypeMap | Entity-to-archetype lookup used during matching. |
| entityToArchetypeMapVersions | Versions associated with entity-to-archetype mappings. |
| allArchetypes | World archetypes available for query matching. |
|
inline |
Returns the effective read/write access for an id.
Effective access combines positive query terms and explicit reads()/writes() declarations. Pair query terms do not imply data access. Use explicit reads(Entity) or writes(Entity) when a pair id is a custom scheduling key.
| entity | Component/entity id to inspect. |
|
inline |
Creates a query from a null-terminated expression string.
Expression is a string between separators. Spaces are trimmed automatically.
Supported modifiers: "," - separates expressions "||" - query::or_(OR chain with at least two OR terms) "?" - query::any (optional) "!" - query::none "&" - read-write access "%e" - entity value "(rel,tgt)" - relationship pair, a wildcard character in either rel or tgt is translated into All "$name" - query variable ($this is reserved) "Id(src)" - source lookup (src can be a variable, e.g. Planet($planet), or $this for default source)
Example: struct Position {...}; struct Velocity {...}; struct RigidBody {...}; struct Fuel {...}; auto player = w.add(); w.query().add("&Position, !Velocity, ?RigidBody, (Fuel,*), %e", player.value()); Translates into: w.query() .all<Position&>() .no<Velocity>() .any<RigidBody>() .all(Pair(w.add<Fuel>().entity, All)>() .all(Player);
Adds one or more query terms described by a string expression. Component names are resolved immediately while the expression is parsed and the resulting component ids are baked into the query terms. Later scope, path or alias changes do not rewrite an already parsed query. Names in str are resolved while add(...) parses the expression and the resulting ids are baked into the query. Active component scope and lookup-path state affect parsing only at that moment and do not rewrite the query later.
| str | Null-terminated string with the query expression. |
| ... | Optional varargs consumed by e substitutions inside str. |
|
inline |
Adds a prebuilt query input item.
| item | Query term or filter description. |
| QueryImpl & gaia::ecs::detail::QueryImpl::all | ( | ) |
| QueryImpl & gaia::ecs::detail::QueryImpl::all | ( | const QueryTermOptions & | options | ) |
Adds a required typed term.
| T | Component or pair type. |
| options | Term options. |
|
inline |
Adds a required entity or pair term.
| entity | Required entity or pair id. |
| options | Term options. |
| QueryImpl & gaia::ecs::detail::QueryImpl::any | ( | ) |
| QueryImpl & gaia::ecs::detail::QueryImpl::any | ( | const QueryTermOptions & | options | ) |
Adds an optional typed term.
| T | Component or pair type. |
| options | Term options. |
|
inline |
Adds an optional entity or pair term.
| entity | Optional entity or pair id. |
| options | Term options. |
| void gaia::ecs::detail::QueryImpl::arr | ( | Container & | outArray, |
| Constraints | constraints = Constraints::EnabledOnly |
||
| ) |
Appends all components or entities matching the query to the output array.
| Container | Container type |
| [out] | outArray | Container storing entities or components |
| constraints | QueryImpl constraints |
|
inline |
Returns a textual dump of the generated query VM bytecode.
|
inline |
Returns the effective cache policy chosen for the query.
|
inline |
Returns the traversed-source snapshot cap. 0 disables explicit traversed-source snapshot caching.
|
inline |
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.
| maxItems | Maximum number of traversed source entities retained in a snapshot. Zero disables explicit reuse. |
|
inline |
Returns whether an archetype is eligible for query execution.
| queryInfo | Prepared query metadata controlling prefab matching. |
| archetype | Candidate archetype. |
|
inline |
Checks whether a matched archetype can be processed for the current row constraints.
| queryInfo | Prepared query cache and execution metadata. |
| archetype | Matched archetype to test. |
| constraints | Entity-row subset exposed to the callback. |
| barrierPasses | Cached barrier result, or -1 to compute the enabled hierarchy gate directly. |
|
inline |
Returns whether this query can run concurrently with another query based on declared scheduling metadata.
| other | Query to compare against. |
| QueryImpl & gaia::ecs::detail::QueryImpl::changed | ( | ) |
|
inlinestaticnoexcept |
Calculates the row range of a chunk after applying row constraints and depth-order barrier state.
| pChunk | Chunk to inspect. |
| constraints | Entity-row subset exposed to the callback. |
| needsBarrierCache | True when barrier state participates in row selection. |
| barrierPasses | Cached barrier result for the archetype containing the chunk. |
| from | Receives the first row to process. |
| to | Receives the one-past-the-end row to process. |
Clears binding for a single query variable (Var0..Var7). The variable becomes unbound for the next query evaluation.
| varEntity | Query variable entity (Var0..Var7). |
|
inline |
Clears all runtime variable bindings.
|
inline |
Returns whether this query conflicts with another query's effective access declarations.
Two queries conflict when both access the same id and at least one side writes it. This check uses component access declared by positive query terms plus custom reads()/writes() declarations. It does not account for world structural mutation or arbitrary side effects.
| other | Query to compare against. |
|
inline |
Calculates the number of entities matching the query.
| constraints | Entity-row subset included in the count. |
|
inline |
Returns the user-owned context pointer attached to this query.
|
inline |
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.
| pCtx | Context pointer. May be null. |
|
inline |
Returns explicitly declared read ids that are not query terms.
|
inline |
Returns explicitly declared write ids that are not query terms.
| QueryImpl & gaia::ecs::detail::QueryImpl::depth_order | ( | ) |
Orders cached query entries by fragmenting relation depth so iteration runs breadth-first top-down.
| Rel | Fragmenting hierarchy relation, typically 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.
| relation | Fragmenting hierarchy relation. |
|
inlinestatic |
Checks whether cached depth-order barrier results can prune any matched archetype.
| queryInfo | Prepared query cache and execution metadata. |
|
inline |
Iterates query matches using the default execution mode.
| Func | Iterator callback type invocable with Iter&. |
| func | Callable invoked for each match. |
| void gaia::ecs::detail::QueryImpl::each | ( | Func | func | ) |
Iterates query matches with a typed component callback using the default execution mode.
| Func | Typed callback whose arguments identify the requested query components. |
| func | Callable invoked for each matching entity. |
|
inline |
Iterates query matches with an iterator callback under the selected row constraints.
| Func | Iterator callback type invocable with Iter&. |
| func | Callable invoked for each match. |
| constraints | Entity-row subset exposed to the callback. |
|
inline |
Iterates query matches using the selected execution mode.
| Func | Iterator callback type invocable with Iter&. |
| func | Callable invoked for each match. |
| execType | Execution mode. |
| void gaia::ecs::detail::QueryImpl::each | ( | Func | func, |
| QueryExecType | execType | ||
| ) |
Iterates query matches with a typed component callback using the selected execution mode.
| Func | Typed callback whose arguments identify the requested query components. |
| func | Callable invoked for each matching entity. |
| execType | Execution mode. |
|
inline |
Iterates query matches with an iterator callback using the selected execution mode and row constraints.
| Func | Iterator callback type invocable with Iter&. |
| func | Callable invoked for each match. |
| execType | Execution mode. |
| constraints | Entity-row subset exposed to the callback. |
|
inline |
Iterates matching archetypes instead of individual entities.
| Func | Iterator callback type invocable with Iter&. |
| func | Callable invoked for each matching archetype iterator. |
| constraints | Iteration constraints applied before invoking func. |
| void gaia::ecs::detail::QueryImpl::each_direct_inter | ( | QueryInfo & | queryInfo, |
| Constraints | constraints, | ||
| void * | pFunc, | ||
| const TypedQueryExecState & | state, | ||
| void(*)(QueryImpl &, Iter &, void *, const TypedQueryExecState &) | runDirectChunk, | ||
| bool | needsInheritedArgIds, | ||
| void(*)(World &, Entity, const Entity *, void *) | invokeInherited | ||
| ) |
Runs an erased typed callback over entities selected by a direct sparse or target-term seed.
| queryInfo | Prepared query cache and term metadata. |
| constraints | Constraints applied while selecting direct entities and constructing iterator views. |
| pFunc | Opaque storage for the typed callback object. |
| state | Prepared typed-argument bindings and write metadata. |
| runDirectChunk | Executes pFunc for a prepared direct chunk or entity iterator. |
| needsInheritedArgIds | Whether inherited arguments require per-entity id resolution. |
| invokeInherited | Executes pFunc with inherited argument ids resolved for one entity. |
|
inline |
Iterates matching enabled entities through a non-template erased callback.
| pCtx | User callback context. |
| func | Callback invoked for each matching entity. |
| void gaia::ecs::detail::QueryImpl::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.
| Func | Callback type. |
| it | Iterator positioned on the current chunk range. |
| func | Callback to invoke. |
|
inline |
Runs a type-erased public iterator callback through generic query execution.
| execType | Query execution mode requested by the public API. |
| pFunc | Pointer to the stored callback object. |
| invoke | Type-erased callback invoker. |
| constraints | Entity-row subset exposed to the callback. |
|
inline |
Runs a type-erased public iterator callback using an already prepared query cache and plan.
| queryInfo | Prepared query cache and execution metadata. |
| plan | Prepared query execution metadata. |
| execType | Query execution mode requested by the public API. |
| pFunc | Pointer to the stored callback object. |
| invoke | Type-erased callback invoker. |
| constraints | Entity-row subset exposed to the callback. |
|
inline |
Runs a public iterator callback through the fastest supported runtime path.
| ExecType | Query execution mode requested by the public API. |
| Func | Public iterator callback type. |
| func | Callback invoked for each iterator step. |
| constraints | Entity-row subset exposed to the callback. |
|
inline |
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.
| Func | Callback type. May accept Iter& or an entity value. |
| func | Callable invoked for each ordered entity. |
| relation | Relation used to order matched entities. |
| order | Traversal order to apply. |
| constraints | QueryImpl constraints |
| void gaia::ecs::detail::QueryImpl::each_walk | ( | Func | func, |
| Entity | relation, | ||
| TravOrder | order = TravOrder::Down, |
||
| Constraints | constraints = Constraints::EnabledOnly |
||
| ) |
Iterates matching entities in relation order with a typed component callback.
| Func | Typed callback whose arguments identify the requested query components. |
| func | Callable invoked for each ordered matching entity. |
| relation | Relation used to order matched entities. |
| order | Traversal order to apply. |
| constraints | Entity-row subset exposed to the callback. |
|
inline |
Returns true or false depending on whether there are any entities matching the query.
| constraints | Entity-row subset included in the probe. |
|
inlinestatic |
Classifies the generic batch payload needed for a matched query under row constraints.
| queryInfo | Prepared query cache and execution metadata. |
| constraints | Entity-row subset exposed to the callback. |
|
inline |
|
inline |
Returns the cache handle generation of this query.
|
inline |
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.
| entity | The entity to group by. |
| func | The function to use for grouping. Returns a GroupId to group the entities by. |
| QueryImpl & gaia::ecs::detail::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.
| T | Component to group by. It is registered if it hasn't been registered yet. |
| func | The function to use for grouping. Returns a GroupId to group the entities by. |
| QueryImpl & gaia::ecs::detail::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.
| Rel | The relation to group by. It is registered if it hasn't been registered yet. |
| Tgt | The target to group by. It is registered if it hasn't been registered yet. |
| func | The function to use for grouping. Returns a GroupId to group the entities by. |
| QueryImpl & gaia::ecs::detail::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.
| Rel | Relation the group depends on. |
Declares an explicit relation dependency for grouped cache invalidation. Useful for custom group_by callbacks that depend on hierarchy or relation topology.
| relation | Relation the group depends on. |
| QueryImpl & gaia::ecs::detail::QueryImpl::group_id | ( | ) |
Selects the group to iterate over.
| T | Component to treat as a group to iterate over. It is registered if it hasn't been registered yet. |
Selects the group to iterate over.
| entity | The entity to treat as a group to iterate over. |
|
inline |
Selects the group to iterate over.
| groupId | The group to iterate over. |
|
inline |
Collects active non-zero group ids for a grouped query. The ids can be fed back to group_id(...) to process each group without knowing group ids ahead of time.
| Container | Container with GroupId elements. |
| out | Output array overwritten with unique group ids. |
| sortGroups | True to sort grouped cache ranges by group id before collecting ids. |
|
inlinestatic |
Checks whether depth-order grouping can prune disabled hierarchy subtrees.
| queryInfo | Prepared query cache and execution metadata. |
|
inline |
Returns the cache handle id of this query.
|
inline |
Adds an inherited in(entity) requirement.
| entity | Target entity matched through inherited Is traversal. |
| options | Term options. |
|
inlinestatic |
Invokes a type-erased public iterator callback.
| Func | Stored callback type. |
| TIter | Iterator type passed to the callback. |
| pFunc | Pointer to the stored callback object. |
| it | Iterator passed to the callback. |
|
inline |
Adds a semantic Is(entity) requirement.
| entity | Target entity matched through the Is relation. |
| options | Term options. |
|
inline |
Returns whether the query is stored in the query cache.
|
inlinestatic |
Returns whether a direct term is backed by non-fragmenting storage and must be evaluated per entity.
| world | World |
| term | Query term |
|
inlinestaticconstexpr |
Maps an iteration-mode tag to the runtime row constraints used by iterators.
| TMode | One of the IterMode* tag types. |
|
inline |
Adds a query execution job without submitting it.
The returned SchedJob is backed by the world's ECS scheduler descriptor rather than a gaia::mt::JobHandle, so external schedulers can provide their own token, submission, dependency, wait, and cleanup behavior. The job owns only the callback copy and scheduler token. The query and world must outlive the job.
| Func | Query callback type accepted by each(). |
| func | Callback invoked when the added job runs. |
| execType | Query execution mode used inside the job. |
|
inline |
Returns the currently requested cache kind.
|
inline |
Sets the hard cache-kind requirement for the query.
| cacheKind | Requested cache-kind restriction. |
|
inline |
Returns the validation result for the current query shape and requested kind.
|
inline |
Returns a human-readable description of the current kind validation result.
|
inline |
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.
| required | True when the query requires the main thread/serial path. |
|
inline |
Returns whether this query must run on the main thread/serial path.
|
inline |
Matches the query against all relevant archetypes.
| queryInfo | Query info |
|
inlinestatic |
Returns whether a chunk passes the query's changed filters.
| chunk | Chunk being evaluated. |
| queryInfo | Query metadata containing changed-filter terms. |
| changedWorldVersion | World version captured by the previous query pass. |
|
inlinestatic |
Returns whether a chunk passes the query's changed filters.
| chunk | Chunk being evaluated. |
| queryInfo | Query metadata containing changed-filter terms. |
| changedWorldVersion | World version captured by the previous query pass. |
| compIndices | Per-archetype mapping from query term index to chunk component column. |
|
inline |
Matches the query against a single archetype.
| queryInfo | Query info |
| archetype | Archetype |
| targetEntities | Optional target-entity filter |
|
inline |
Makes the query include prefab entities in matches.
|
inline |
Returns whether any supplied target entity matches the query on archetype.
| queryInfo | Query info |
| archetype | Archetype |
| targetEntities | Candidate target entities |
|
inlinestatic |
Checks whether the current row constraints require the depth-order hierarchy barrier cache.
| queryInfo | Prepared query cache and execution metadata. |
| constraints | Entity-row subset exposed to the callback. |
| QueryImpl & gaia::ecs::detail::QueryImpl::no | ( | ) |
| QueryImpl & gaia::ecs::detail::QueryImpl::no | ( | const QueryTermOptions & | options | ) |
Adds an excluded typed term.
| T | Component or pair type. |
| options | Term options. |
|
inline |
Adds an excluded entity or pair term.
| entity | Entity or pair id that must not match. |
| options | Term options. |
| QueryImpl & gaia::ecs::detail::QueryImpl::or_ | ( | ) |
| QueryImpl & gaia::ecs::detail::QueryImpl::or_ | ( | const QueryTermOptions & | options | ) |
Adds an OR typed term.
| T | Component or pair type. |
| options | Term options. |
|
inline |
OR terms (at least one has to match). A single OR term is canonicalized to ALL during query normalization.
| entity | Entity or pair id. |
| options | Term options. |
|
inline |
Iterates matching entities in an explicit relation traversal order.
Pair(relation, X) on entity E means E points at X. Down visits X before E. Up visits E before X. Reverse variants produce the exact reverse of their base order. Siblings are tie-broken by entity id, so the order is deterministic. The traversal changes only visit order. It does not change which entities match the query. This path resolves order per entity and works for fragmenting relations such as ChildOf and non-fragmenting relations such as Parent. It may be slower than normal chunk iteration.
| relation | Relation used to order the matched entities. |
| order | Traversal order to apply. |
| GAIA_NODISCARD OrderByTravView gaia::ecs::detail::QueryImpl::order_by | ( | TravOrder | order | ) |
Iterates matching entities in an explicit typed relation traversal order.
| Rel | Relation type. It is registered if it hasn't been registered yet. |
| order | Traversal order to apply. |
|
inline |
Builds and caches relation traversal order for the current query result.
| queryInfo | Query info |
| relation | Dependency relation used for traversal. |
| order | Traversal order to apply. |
| constraints | Match constraints applied before ordering. |
|
inline |
Selects the prepared execution plan for public iterator callbacks.
| queryInfo | Prepared query cache and execution metadata. |
| constraints | Entity-row subset exposed to the callback. |
|
inline |
Declares an additional component or pair type read by this query callback.
| T | Component, entity type, or pair type to mark as read. |
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.
| entity | Component/entity id read by user code. |
|
inlinestatic |
Executes an archetype-level iterator callback for one prepared chunk batch. The iterator is initialized with archetype metadata but no chunk rows.
| Func | Callback type invocable with Iter&. |
| pWorld | World owning the archetype batch. |
| func | Callback invoked for the initialized iterator. |
| batch | Prepared batch carrying the archetype and inherited metadata. |
| constraints | Entity-row constraints associated with this execution. |
|
inlinestatic |
Executes an iterator callback for one prepared chunk batch.
| Func | Callback type invocable with Iter&. |
| TMode | Iteration-mode tag controlling enabled/disabled row constraints. |
| pWorld | World owning the chunk batch. |
| func | Callback invoked for the initialized iterator. |
| batch | Prepared chunk batch to expose through the iterator. |
|
inlinestatic |
Executes an iterator callback over a contiguous list of prepared chunk batches.
| Func | Callback type invocable with Iter&. |
| TMode | Iteration-mode tag controlling enabled/disabled row constraints. |
| pWorld | World owning the chunk batches. |
| func | Callback invoked once per initialized chunk iterator. |
| batches | Prepared chunk batches to iterate. |
|
inline |
Runs a public Iter callback over cached chunks without creating chunk batches.
| HasFilters | When true, chunks must pass changed-filter checks before callback invocation. |
| HasGroups | When true, the prepared cache range carries per-archetype group ids. |
| Func | Public iterator callback type. |
| queryInfo | Prepared query cache and execution metadata. |
| plan | Prepared query execution metadata. |
| constraints | Entity-row subset exposed to the callback. |
| func | Callback invoked once for each matching chunk. |
Direct dense plans already encode expensive process gates. When no cached archetype can require prefab filtering and no depth-order barrier cache can prune, only deletion state remains dynamic.
|
inline |
Returns the currently requested cache scope.
|
inline |
Sets the cache scope used by cached queries.
| cacheScope | Whether cache-backed state stays local or can be shared across identical query shapes. |
Binds a named query variable to a concrete entity value.
| name | Null-terminated variable name previously assigned by var_name(...). |
| value | Entity value to bind. |
Binds a query variable (Var0..Var7) to a concrete entity value. Bound values are applied at runtime before query evaluation.
| varEntity | Query variable entity (Var0..Var7) |
| value | Entity value to bind |
|
inline |
Binds a named query variable to a concrete entity value.
| name | Variable name previously assigned by var_name(...) |
| value | Entity value to bind |
Sorts the query by the specified entity and function.
| entity | The entity to sort by. Use ecs::EntityBad to sort by chunk entities, or anything else to sort by components. |
| func | The function to use for sorting. Return -1 to put the first entity before the second, 0 to keep the order, and 1 to put the first entity after the second. |
| QueryImpl & gaia::ecs::detail::QueryImpl::sort_by | ( | TSortByFunc | func | ) |
Sorts the query by the specified component and function.
| T | The component to sort by. It is registered if it hasn't been registered yet. |
| func | The function to use for sorting. Return -1 to put the first entity before the second, 0 to keep the order, and 1 to put the first entity after the second. |
| QueryImpl & gaia::ecs::detail::QueryImpl::sort_by | ( | TSortByFunc | func | ) |
Sorts the query by the specified pair and function.
| Rel | The relation to sort by. It is registered if it hasn't been registered yet. |
| Tgt | The target to sort by. It is registered if it hasn't been registered yet. |
| func | The function to use for sorting. Return -1 to put the first entity before the second, 0 to keep the order, and 1 to put the first entity after the second. |
|
inlinestatic |
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.
| queryInfo | Prepared query cache and execution metadata. |
| archetype | Matched archetype to test. |
|
inlinestatic |
Returns whether a term uses strict semantic Is matching that excludes the base entity itself.
| term | Query term |
Is matching is used. False otherwise.
|
inlinestatic |
Returns whether a term uses semantic inherited-id matching rather than direct storage matching.
| world | World |
| term | Query term |
|
inlinestatic |
Returns whether a term uses any semantic Is matching rather than direct storage matching.
| term | Query term |
Is matching is used. False otherwise.
|
inlinestatic |
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.
| term | Query term |
|
inlinestatic |
Returns whether a term uses semantic Is matching rather than direct storage matching.
| term | Query term |
Is matching is used. False otherwise.
|
inline |
Returns whether the current query shape satisfies the requested kind.
Assigns a human-readable name to a query variable entity (Var0..Var7).
| varEntity | Query variable entity (Var0..Var7). |
| name | Null-terminated variable name without the $ prefix. |
|
inline |
Assigns a human-readable name to a query variable entity (Var0..Var7). The name can be used later by set_var(name, value).
| varEntity | Query variable entity (Var0..Var7) |
| name | Variable name (without '$') |
|
inline |
Declares an additional component or pair type written by this query callback.
| T | Component, entity type, or pair type to mark as written. |
Declares an additional id written by this query callback.
A write conflicts with any read or write of the same id when comparing two queries with conflicts_with(). The declaration is scheduling metadata only. It does not change query matching or cache identity.
| entity | Component/entity id written by user code. |