QueryCache class

Enhanced QueryCache that integrates result caching.

Constructors

QueryCache({bool enableResultCaching = true, int maxCacheSize = 1000, bool enableStructuralTouchTracking = true})

Properties

debugResultCache → Map<QueryCacheKey, QueryCacheEntry>
Debug-only view of the underlying result cache (if enabled).
no setter
debugStructurallyTouchedComponents → Set<ComponentId>
Debug-only set of structurally touched component IDs since last flush.
no setter
enableResultCaching → bool
Whether to enable result caching
final
enableStructuralTouchTracking → bool
Whether structural component touches evict matching query-result entries.
final
hashCode → int
The hash code for this object.
no setterinherited
maxCacheSize → int
Maximum cache size for result caching
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stats → ({int archetypeCacheSize, double resultCacheHitRate, int resultCacheHits, int resultCacheInvalidations, int resultCacheMisses, int resultCacheSize})
Get combined statistics
no setter

Methods

clear() → void
Clear all caches and reset statistics
evictForStructuralComponent(ComponentId componentId) → void
Evict cached results for queries shaped by a structurally touched type.
getCachedResult(QueryCacheKey key, ArchetypeRegistry archetypes, List<Entity> computeResult()) → QueryCacheEntry?
Get cached query result or compute and cache it
getOrCompute(ComponentMask mask, ArchetypeRegistry archetypes) → ArchetypeMatchResult
Get or compute archetype matches for a component mask.
invalidate() → void
Evict all caches.
markStructurallyTouched(ComponentId componentId) → void
Mark query-result entries for structural eviction by component mask.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onArchetypeChange() → void
Called when archetype registry changes
onWorldFlush() → void
Called when world is flushed
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited