![]() |
Gaia-ECS v1.0.0
A simple and powerful entity component system
|
Compiled query plan and its incrementally maintained result caches. More...
#include <query_info.h>
Classes | |
| struct | CleanUpTmpArchetypeMatches |
| Scope guard that releases the world-owned temporary VM matching frame. More... | |
Public Types | |
| enum class | MatchArchetypeQueryRet : uint8_t { Fail , Ok , Skip } |
| Result of evaluating one archetype for cache insertion. More... | |
| enum class | InvalidationKind : uint8_t { Result , Seed , All } |
| Cache layer invalidated after query inputs or world state change. More... | |
Public Member Functions | |
| void | add_ref () |
| Adds one external reference to this query slot. | |
| void | dec_ref () |
| Releases one external reference to this query slot. | |
| uint32_t | refs () const |
| Returns the current external reference count. | |
| void | init (World *world) |
| Binds this query info to a world after slot allocation. | |
| void | reset () |
| Resets cached query state for slot reuse while keeping the compiled context object. | |
| void | invalidate (InvalidationKind kind=InvalidationKind::All) |
| Marks cached query results stale. | |
| void | invalidate_seed () |
| Marks structural seed matches stale. | |
| void | invalidate_result () |
| Marks final result matches stale while preserving structural seed matches. | |
| void | invalidate_sort () |
| Marks the cached sorted slices dirty without invalidating query membership. | |
| void | compile (const EntityToArchetypeMap &entityToArchetypeMap, std::span< const Archetype * > allArchetypes) |
| Compile the query terms into a form we can easily process. | |
| void | recompile () |
| Recompile the query. | |
| GAIA_NODISCARD QueryCtx::CachePolicy | cache_policy () const |
| Returns the query cache policy selected during compilation. | |
| GAIA_NODISCARD bool | has_grouped_payload () const |
| Returns true when grouped-query payloads are active for this query. | |
| template<typename Container > | |
| void | group_ids (Container &out, bool sortGroups) |
| Collects the query's active non-zero group ids. | |
| GAIA_NODISCARD bool | has_sorted_payload () const |
| Returns true when sorted-query payloads are active for this query. | |
| GAIA_NODISCARD uint32_t | result_cache_rev () const |
| Returns the result membership revision used by reverse-index cache users. | |
| GAIA_NODISCARD bool | result_cache_may_need_prefab_filter () const |
| Returns true when the result cache contains archetypes that need default prefab filtering. | |
| GAIA_NODISCARD bool | can_update_with_new_archetype () const |
| Returns true when a new archetype can be propagated into the current cache incrementally. | |
| GAIA_NODISCARD bool | can_use_direct_create_archetype_match () const |
| Returns whether create-time matching should bypass the temporary one-archetype VM path. | |
| GAIA_NODISCARD bool | direct_create_archetype_match_uses_is () const |
| Returns whether direct create-time matching needs Is-aware id checks. | |
| GAIA_NODISCARD bool | operator== (const QueryCtx &other) const |
| Compares this compiled plan with an authored query context. | |
| GAIA_NODISCARD bool | operator!= (const QueryCtx &other) const |
| Compares this compiled plan with an authored query context for inequality. | |
| template<typename ArchetypeLookup > | |
| void | match (const ArchetypeLookup &entityToArchetypeMap, std::span< const Archetype * > allArchetypes, const EntityToArchetypeVersionMap *pEntityToArchetypeMapVersions, ArchetypeId archetypeLastId, const cnt::sarray< Entity, MaxVarCnt > &runtimeVarBindings, uint8_t runtimeVarBindingMask) |
| Tries to match the query against archetypes in entityToArchetypeMap. This is necessary so we do not iterate all chunks over and over again when running queries. | |
| bool | match_one (const Archetype &archetype, EntitySpan targetEntities, const cnt::sarray< Entity, MaxVarCnt > &runtimeVarBindings, uint8_t runtimeVarBindingMask) |
| Tries to match the query against the provided archetype. This is necessary so we do not iterate all chunks over and over again when running queries. | |
| void | ensure_matches (const EntityToArchetypeMap &entityToArchetypeMap, std::span< const Archetype * > allArchetypes, const EntityToArchetypeVersionMap &entityToArchetypeMapVersions, ArchetypeId archetypeLastId, const cnt::sarray< Entity, MaxVarCnt > &runtimeVarBindings, uint8_t runtimeVarBindingMask) |
| Refreshes persistent query matches when cache state or world archetypes changed. | |
| void | ensure_matches_transient (const EntityToArchetypeMap &entityToArchetypeMap, std::span< const Archetype * > allArchetypes, const EntityToArchetypeVersionMap &entityToArchetypeMapVersions, const cnt::sarray< Entity, MaxVarCnt > &runtimeVarBindings, uint8_t runtimeVarBindingMask) |
| Rebuilds transient result membership without retaining persistent seed-cache state. | |
| bool | ensure_matches_one (const Archetype &archetype, EntitySpan targetEntities, const cnt::sarray< Entity, MaxVarCnt > &runtimeVarBindings, uint8_t runtimeVarBindingMask) |
| Ensures persistent result membership for one target archetype. | |
| bool | ensure_matches_one_transient (const Archetype &archetype, EntitySpan targetEntities, const cnt::sarray< Entity, MaxVarCnt > &runtimeVarBindings, uint8_t runtimeVarBindingMask) |
| Rebuilds transient result membership by evaluating one target archetype. | |
| bool | register_archetype (const Archetype &archetype, Entity matchedSelector=EntityBad, bool assumeNew=false) |
| Registers a new or updated archetype with query caches when it matches this query. | |
| void | calculate_sort_data () |
| Calculates the sort data for the archetypes in the cache. This allows us to iterate entites in the order they are sorted across all archetypes. | |
| void | sort_entities () |
| Applies query entity sorting and rebuilds sorted chunk slices when needed. | |
| void | sort_cache_groups () |
| Sorts cached archetypes by group id when grouped iteration requested ordering. | |
| void | swap_archetype_cache_entry (uint32_t left, uint32_t right) |
| Swaps two result-cache entries and every parallel payload array that mirrors cache order. | |
| void | ensure_comp_indices () |
| Rebuilds cached component-index payloads for matched archetypes when marked pending. | |
| void | ensure_direct_chunks (uint32_t idxFrom, uint32_t idxTo, const uint32_t *pDataFields, uint32_t dataFieldCount) |
| Rebuilds flattened direct chunk cache when result membership, world structure, selected rows, component-index mapping storage, or cached callback fields changed. | |
| GAIA_NODISCARD bool | has_inherited_data_payload () const |
| Returns true when query iteration needs cached inherited data payloads. | |
| void | ensure_inherited_data () |
| Rebuilds inherited-data payloads for matched archetypes when query terms require them. | |
| void | ensure_group_data (bool orderGroups) |
| Rebuilds grouped archetype ranges when a caller needs ordered group data. | |
| void | ensure_depth_order_hierarchy_barrier_cache_inter () |
| Rebuilds cached depth-order hierarchy barrier results when relation or enabled-state versions changed. | |
| ArchetypeCompIndices | create_comp_indices (const Archetype *pArchetype) |
| Builds field-to-archetype component indices for one matched archetype. | |
| void | create_inherited_data (const Archetype *pArchetype) |
| Builds inherited component data pointers for semantic self-source terms on one archetype. | |
| void | update_result_cache_prefab_filter_state (const Archetype *pArchetype) |
| Records whether pArchetype requires the default prefab filter during result-cache iteration. | |
| void | add_archetype_to_cache_no_grouping (const Archetype *pArchetype, bool trackMembershipChange, bool assumeAbsent=false) |
| Adds an archetype to the final result cache for ungrouped queries. | |
| void | add_archetype_to_seed_cache (const Archetype *pArchetype, bool assumeAbsent=false) |
| Adds an archetype to the structural seed cache. | |
| void | add_new_archetype_to_immediate_caches (const Archetype *pArchetype, bool trackMembershipChange) |
| Adds a newly matched archetype to both immediate caches while reusing one computed index mapping. | |
| void | add_archetype_to_cache_w_grouping (const Archetype *pArchetype, bool trackMembershipChange, bool assumeAbsent=false) |
| Adds an archetype to the final result cache and records its group id. | |
| void | add_archetype_to_cache (const Archetype *pArchetype, bool trackMembershipChange, bool assumeAbsent) |
| Adds an archetype to the final result cache and updates derived-payload dirty flags. | |
| void | add_archetype_to_transient_cache (const Archetype *pArchetype) |
| Adds an archetype to the transient result cache used by non-persistent matching paths. | |
| GAIA_NODISCARD const GroupData * | selected_group_data (GroupId runtimeGroupId) const |
| Returns cached group bounds for the currently selected group filter. The cached range is invalidated whenever group layout changes or the selected group id changes. | |
| GAIA_NODISCARD bool | has_same_result_membership_as_seed_cache () const |
| Compares final result-cache membership with the structural seed cache. | |
| GAIA_NODISCARD bool | has_same_result_membership_as (const CArchetypeDArray &archetypeCache) const |
| Compares final result-cache membership with another archetype array. | |
| void | sync_result_cache_from_seed_cache () |
| Rebuilds the final result cache from structural seed matches. Bumps result membership revision only when the final membership actually changes. | |
| bool | del_archetype_from_cache (const Archetype *pArchetype) |
| Removes an archetype from the final result cache and mirrored payload arrays. | |
| bool | del_archetype_from_seed_cache (const Archetype *pArchetype) |
| Removes an archetype from the structural seed cache. | |
| GAIA_NODISCARD World * | world () |
| Returns the mutable world owning this query. | |
| GAIA_NODISCARD const World * | world () const |
| Returns the world owning this query. | |
| GAIA_NODISCARD QuerySerBuffer & | ser_buffer () |
| Returns the query serialization buffer associated with the owning world. | |
| void | ser_buffer_reset () |
| Resets the query serialization buffer associated with the owning world. | |
| GAIA_NODISCARD QueryCtx & | ctx () |
| Returns the mutable compiled query context. | |
| GAIA_NODISCARD const QueryCtx & | ctx () const |
| Returns the compiled query context. | |
| GAIA_NODISCARD util::str | bytecode () const |
| Returns a textual dump of the compiled VM bytecode. | |
| GAIA_NODISCARD uint32_t | op_count () const |
| Returns the number of VM operations in the compiled query. | |
| GAIA_NODISCARD uint64_t | op_signature () const |
| Returns a stable signature for the compiled VM operation stream. | |
| GAIA_NODISCARD bool | has_filters () const |
| Returns true when the query has per-entity changed/filter terms. | |
| GAIA_NODISCARD bool | has_entity_filter_terms () const |
| Returns true when direct non-fragmenting terms must be rechecked per entity. | |
| GAIA_NODISCARD bool | has_potential_inherited_id_terms () const |
| Returns true when the query shape can resolve through inherited-id matching. | |
| GAIA_NODISCARD QueryCtx::DirectTargetEvalKind | direct_target_eval_kind () const |
| Returns the direct target evaluation mode selected during compilation. | |
| GAIA_NODISCARD Entity | direct_target_eval_id () const |
| Returns the concrete direct target id used by direct target evaluation. | |
| GAIA_NODISCARD bool | can_direct_target_eval () const |
| Returns true when the query can evaluate concrete target entities directly. | |
| GAIA_NODISCARD bool | can_direct_entity_seed_eval_shape () const |
| Returns true when the query shape is eligible for direct entity seed evaluation. | |
| GAIA_NODISCARD bool | has_only_direct_or_terms () const |
| Returns true when the query contains only direct OR/NOT terms and at least one OR term. | |
| GAIA_NODISCARD bool | matches_prefab_entities () const |
| Returns true when prefab-tagged entities should participate in query results. | |
| template<typename... T> | |
| GAIA_NODISCARD bool | has_any () const |
| Returns true when any of the requested types is present as an Any term. | |
| template<typename... T> | |
| GAIA_NODISCARD bool | has_or () const |
| Returns true when any of the requested types is present as an Or term. | |
| template<typename... T> | |
| GAIA_NODISCARD bool | has_all () const |
| Returns true when all requested types are present as All terms. | |
| template<typename... T> | |
| GAIA_NODISCARD bool | has_no () const |
| Returns true when none of the requested types is present as a Not term. | |
| void | remove (Archetype *pArchetype) |
| Removes an archetype from cache. | |
| std::span< const uint8_t > | indices_mapping_view (uint32_t archetypeIdx) const |
| Returns a view of indices mapping for component entities in a given archetype. | |
| std::span< const DirectChunkEntry > | direct_chunk_view (uint32_t idxFrom, uint32_t idxTo, const uint32_t *pDataFields, uint32_t dataFieldCount) const |
| Returns a flattened chunk view for a direct-dense result-cache range. | |
| std::span< const void *const > | direct_chunk_data_view () const |
| Returns cached flattened direct chunk data pointers. | |
| InheritedTermDataView | inherited_data_view (uint32_t archetypeIdx) const |
| Returns cached inherited-term data for a matched archetype index. | |
| InheritedTermDataView | inherited_data_view (const Archetype *pArchetype) const |
| Returns cached inherited-term data for a matched archetype pointer. | |
| void | ensure_depth_order_hierarchy_barrier_cache () |
| Ensures depth-order hierarchy barrier results are current before public reads. | |
| std::span< const uint8_t > | try_indices_mapping_view (const Archetype *pArchetype) const |
| Returns a cached indices mapping view for an exact archetype match, or an empty span when absent. | |
| InheritedTermDataView | try_inherited_data_view (const Archetype *pArchetype) const |
| Returns cached inherited-term data if it is already available for a matched archetype. | |
| GAIA_NODISCARD GroupId | group_id (uint32_t archetypeIdx) const |
| Returns the cached group id for a matched archetype index. | |
| GAIA_NODISCARD bool | barrier_passes (uint32_t archetypeIdx) const |
| Returns true when the matched archetype passes the depth-order hierarchy barrier. | |
| GAIA_NODISCARD bool | barrier_may_prune () const |
| Returns true when any cached archetype can be pruned by the hierarchy barrier. | |
| GAIA_NODISCARD CArchetypeDArray::iterator | begin () |
| Returns a mutable iterator to the first cached result archetype. | |
| GAIA_NODISCARD CArchetypeDArray::const_iterator | begin () const |
| Returns an iterator to the first cached result archetype. | |
| GAIA_NODISCARD CArchetypeDArray::const_iterator | cbegin () const |
| Returns a const iterator to the first cached result archetype. | |
| GAIA_NODISCARD CArchetypeDArray::iterator | end () |
| Returns a mutable iterator past the last cached result archetype. | |
| GAIA_NODISCARD CArchetypeDArray::const_iterator | end () const |
| Returns an iterator past the last cached result archetype. | |
| GAIA_NODISCARD CArchetypeDArray::const_iterator | cend () const |
| Returns a const iterator past the last cached result archetype. | |
| GAIA_NODISCARD std::span< const Archetype * > | cache_archetype_view () const |
| Returns the cached result archetypes as a span. | |
| GAIA_NODISCARD std::span< const SortData > | cache_sort_view () const |
| Returns cached sorted chunk slices. | |
| GAIA_NODISCARD std::span< const GroupData > | group_data_view () const |
| Returns cached group ranges, rebuilding grouped data when needed. | |
Static Public Member Functions | |
| static GAIA_NODISCARD QueryInfo | create (QueryId id, QueryCtx &&ctx, const EntityToArchetypeMap &entityToArchetypeMap, std::span< const Archetype * > allArchetypes) |
| Creates and compiles a query info object from a moved query context. | |
| static GAIA_NODISCARD QueryInfo | create (uint32_t idx, uint32_t gen, void *pCtx) |
| Creates and compiles a query info object from slot creation context. | |
| static GAIA_NODISCARD QueryHandle | handle (const QueryInfo &info) |
| Builds a stable query handle from query slot metadata. | |
Public Attributes | |
| uint32_t | idx = 0 |
| Allocated items: index in the query slot list. Deleted items: index of the next deleted item in the slot list. | |
| uint32_t | gen = 0 |
| Generation ID of the query slot. | |
Compiled query plan and its incrementally maintained result caches.
|
strong |
Cache layer invalidated after query inputs or world state change.
|
strong |
|
inline |
Adds an archetype to the final result cache and updates derived-payload dirty flags.
| pArchetype | Matched archetype to cache. |
| trackMembershipChange | True to bump result membership revision after insertion. |
| assumeAbsent | True when the caller already proved the archetype is not cached. |
|
inline |
Adds an archetype to the final result cache for ungrouped queries.
| pArchetype | Matched archetype to cache. |
| trackMembershipChange | True to bump result membership revision after insertion. |
| assumeAbsent | True when the caller already proved the archetype is not cached. |
|
inline |
Adds an archetype to the final result cache and records its group id.
| pArchetype | Matched archetype to cache. |
| trackMembershipChange | True to bump result membership revision after insertion. |
| assumeAbsent | True when the caller already proved the archetype is not cached. |
|
inline |
Adds an archetype to the structural seed cache.
| pArchetype | Structurally matched archetype to cache. |
| assumeAbsent | True when the caller already proved the archetype is not cached. |
|
inline |
Adds an archetype to the transient result cache used by non-persistent matching paths.
| pArchetype | Matched archetype to cache for this transient result. |
|
inline |
Adds a newly matched archetype to both immediate caches while reusing one computed index mapping.
| pArchetype | Newly matched archetype to cache. |
| trackMembershipChange | True to bump result membership revision after insertion. |
|
inline |
Returns true when any cached archetype can be pruned by the hierarchy barrier.
|
inline |
Returns true when the matched archetype passes the depth-order hierarchy barrier.
| archetypeIdx | Result-cache archetype index. |
|
inline |
Returns a mutable iterator to the first cached result archetype.
|
inline |
Returns an iterator to the first cached result archetype.
|
inline |
Returns a textual dump of the compiled VM bytecode.
|
inline |
Returns the cached result archetypes as a span.
|
inline |
Returns the query cache policy selected during compilation.
|
inline |
Returns cached sorted chunk slices.
|
inline |
Returns true when the query shape is eligible for direct entity seed evaluation.
|
inline |
Returns true when the query can evaluate concrete target entities directly.
|
inline |
Returns true when a new archetype can be propagated into the current cache incrementally.
|
inline |
Returns whether create-time matching should bypass the temporary one-archetype VM path.
|
inline |
Returns a const iterator to the first cached result archetype.
|
inline |
Returns a const iterator past the last cached result archetype.
|
inline |
Compile the query terms into a form we can easily process.
| entityToArchetypeMap | World reverse index used by VM compilation. |
| allArchetypes | Archetypes present while the plan is compiled. |
|
inlinestatic |
Creates and compiles a query info object from a moved query context.
| id | Query slot id. |
| ctx | Query context to take ownership of. |
| entityToArchetypeMap | World archetype lookup used during compilation. |
| allArchetypes | Current world archetype list. |
|
inlinestatic |
Creates and compiles a query info object from slot creation context.
| idx | Query slot index. |
| gen | Query slot generation. |
| pCtx | Pointer to QueryInfoCreationCtx. |
|
inline |
Builds field-to-archetype component indices for one matched archetype.
| pArchetype | Matched archetype whose layout is mapped to query fields. |
Component-index mappings describe columns owned by the currently iterated rows. Terms resolved from another source must use entity-resolved accessors even when the current archetype happens to contain the same component id.
|
inline |
Builds inherited component data pointers for semantic self-source terms on one archetype.
| pArchetype | Matched archetype whose inherited term data is cached. |
|
inline |
Returns the mutable compiled query context.
|
inline |
Returns the compiled query context.
|
inline |
Removes an archetype from the final result cache and mirrored payload arrays.
| pArchetype | Archetype to remove. |
|
inline |
Removes an archetype from the structural seed cache.
| pArchetype | Archetype to remove. |
|
inline |
Returns cached flattened direct chunk data pointers.
|
inline |
Returns a flattened chunk view for a direct-dense result-cache range.
| idxFrom | First result-cache archetype index to include. |
| idxTo | One-past-the-end result-cache archetype index to include. |
| pDataFields | Query term indices to cache component data pointers for, in callback-argument order. |
| dataFieldCount | Number of valid entries in pDataFields. Pass zero to cache only chunks/ranges. |
|
inline |
Returns whether direct create-time matching needs Is-aware id checks.
|
inline |
Returns the concrete direct target id used by direct target evaluation.
|
inline |
Returns the direct target evaluation mode selected during compilation.
|
inline |
Returns a mutable iterator past the last cached result archetype.
|
inline |
Returns an iterator past the last cached result archetype.
|
inline |
Rebuilds flattened direct chunk cache when result membership, world structure, selected rows, component-index mapping storage, or cached callback fields changed.
The flattened cache is used by read-only direct typed execution over highly fragmented result caches. It stores the chunks and enabled row ranges once, then lets iteration skip per-archetype/per-chunk traversal setup on repeated runs.
When callback component fields are supplied, the cache also captures component data pointers in callback-argument order. A single selected field is stored directly in DirectChunkEntry::pData because that is the hot hierarchy-query path. Multiple selected fields are stored as a stable pointer block in ExecPayload::directChunkData and referenced by DirectChunkEntry::dataOffset.
The cache key includes the selected field list because the same query may be iterated later with a different typed callback argument order. In that case, the pointer block must be rebuilt even if the result archetype range itself is unchanged.
| idxFrom | First result-cache archetype index to include. |
| idxTo | One-past-the-end result-cache archetype index to include. |
| pDataFields | Query term indices to cache component data pointers for, in callback-argument order. |
| dataFieldCount | Number of valid entries in pDataFields. Pass zero to cache only chunks/ranges. |
Single-argument callbacks are the hot hierarchy path. Store their pointer directly in DirectChunkEntry so iteration avoids the sidecar pointer block and its extra lookup. Multi-argument callbacks use directChunkData below because they need a stable per-entry block of pointers in callback-argument order.
|
inline |
Rebuilds grouped archetype ranges when a caller needs ordered group data.
| orderGroups | True to order archetypes by group id even when the query was not explicitly ordered. |
|
inline |
Refreshes persistent query matches when cache state or world archetypes changed.
| entityToArchetypeMap | World reverse index used to seed matching. |
| allArchetypes | Current world archetypes. |
| entityToArchetypeMapVersions | Revisions for reverse-index buckets. |
| archetypeLastId | Greatest world-local archetype id currently allocated. |
| runtimeVarBindings | Runtime values for query variable slots. |
| runtimeVarBindingMask | Bitmask selecting bound slots in runtimeVarBindings. |
|
inline |
Ensures persistent result membership for one target archetype.
| archetype | Archetype to evaluate. |
| targetEntities | Entities supplying target bindings for the evaluation. |
| runtimeVarBindings | Runtime values for query variable slots. |
| runtimeVarBindingMask | Bitmask selecting bound slots in runtimeVarBindings. |
|
inline |
Rebuilds transient result membership by evaluating one target archetype.
| archetype | Archetype to evaluate. |
| targetEntities | Entities supplying target bindings for the evaluation. |
| runtimeVarBindings | Runtime values for query variable slots. |
| runtimeVarBindingMask | Bitmask selecting bound slots in runtimeVarBindings. |
|
inline |
Rebuilds transient result membership without retaining persistent seed-cache state.
| entityToArchetypeMap | World reverse index used to seed matching. |
| allArchetypes | Current world archetypes. |
| entityToArchetypeMapVersions | Revisions for reverse-index buckets. |
| runtimeVarBindings | Runtime values for query variable slots. |
| runtimeVarBindingMask | Bitmask selecting bound slots in runtimeVarBindings. |
|
inline |
Returns cached group ranges, rebuilding grouped data when needed.
|
inline |
Returns the cached group id for a matched archetype index.
| archetypeIdx | Result-cache archetype index. |
|
inline |
Collects the query's active non-zero group ids.
| 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 |
Builds a stable query handle from query slot metadata.
| info | Query info providing slot index and generation. |
|
inline |
Returns true when all requested types are present as All terms.
| T | Query term types to test. |
|
inline |
Returns true when any of the requested types is present as an Any term.
| T | Query term types to test. |
|
inline |
Returns true when direct non-fragmenting terms must be rechecked per entity.
|
inline |
Returns true when the query has per-entity changed/filter terms.
|
inline |
Returns true when grouped-query payloads are active for this query.
|
inline |
Returns true when query iteration needs cached inherited data payloads.
|
inline |
Returns true when none of the requested types is present as a Not term.
| T | Query term types to test. |
|
inline |
Returns true when the query contains only direct OR/NOT terms and at least one OR term.
|
inline |
Returns true when any of the requested types is present as an Or term.
| T | Query term types to test. |
|
inline |
Returns true when the query shape can resolve through inherited-id matching.
|
inline |
Compares final result-cache membership with another archetype array.
| archetypeCache | Archetype membership to compare against the final result cache. |
|
inline |
Compares final result-cache membership with the structural seed cache.
|
inline |
Returns true when sorted-query payloads are active for this query.
|
inline |
Returns a view of indices mapping for component entities in a given archetype.
|
inline |
Returns cached inherited-term data for a matched archetype pointer.
| pArchetype | Matched archetype to look up. |
|
inline |
Returns cached inherited-term data for a matched archetype index.
| archetypeIdx | Result-cache archetype index. |
|
inline |
Binds this query info to a world after slot allocation.
| world | World owning the query. |
|
inline |
Marks cached query results stale.
| kind | Cache layer to invalidate. |
|
inline |
Tries to match the query against archetypes in entityToArchetypeMap. This is necessary so we do not iterate all chunks over and over again when running queries.
| entityToArchetypeMap | Lookup of archetypes by entity |
| allArchetypes | List of all archetypes |
| pEntityToArchetypeMapVersions | Optional version map for archetype lookup validation |
| archetypeLastId | Last recorded archetype id |
| runtimeVarBindings | Runtime variable bindings for dynamic queries |
| runtimeVarBindingMask | Mask indicating which runtime variables are bound |
| ArchetypeLookup | Archetype lookup container/view type used by the query cache. |
|
inline |
Tries to match the query against the provided archetype. This is necessary so we do not iterate all chunks over and over again when running queries.
| archetype | Archtype to match |
| targetEntities | Entities related to the matched archetype |
| runtimeVarBindings | Runtime bindings for query variables. |
| runtimeVarBindingMask | Bitmask of variables already bound in runtimeVarBindings. |
|
inline |
Returns true when prefab-tagged entities should participate in query results.
|
inline |
Returns the number of VM operations in the compiled query.
|
inline |
Returns a stable signature for the compiled VM operation stream.
|
inline |
Compares this compiled plan with an authored query context for inequality.
| other | Query context to compare. |
|
inline |
Compares this compiled plan with an authored query context.
| other | Query context to compare. |
|
inline |
Returns the current external reference count.
|
inline |
Registers a new or updated archetype with query caches when it matches this query.
| archetype | Archetype to evaluate. |
| matchedSelector | Optional selector that already matched the archetype. |
| assumeNew | True when the caller knows the archetype is not present in the caches. |
|
inline |
Removes an archetype from cache.
| pArchetype | Archetype to remove |
|
inline |
Returns true when the result cache contains archetypes that need default prefab filtering.
|
inline |
Returns the result membership revision used by reverse-index cache users.
|
inline |
Returns cached group bounds for the currently selected group filter. The cached range is invalidated whenever group layout changes or the selected group id changes.
| runtimeGroupId | Group id to look up. |
|
inline |
Returns the query serialization buffer associated with the owning world.
|
inline |
Swaps two result-cache entries and every parallel payload array that mirrors cache order.
| left | Index of the first cache entry. |
| right | Index of the second cache entry. |
|
inline |
Returns a cached indices mapping view for an exact archetype match, or an empty span when absent.
|
inline |
Returns cached inherited-term data if it is already available for a matched archetype.
| pArchetype | Matched archetype to look up. |
|
inline |
Records whether pArchetype requires the default prefab filter during result-cache iteration.
| pArchetype | Matched archetype added to the result cache. |
|
inline |
Returns the mutable world owning this query.
|
inline |
Returns the world owning this query.