|
| | World (ResidencyConfig config) |
| std::size_t | capacity () const noexcept |
| std::size_t | byte_budget () const noexcept |
| std::size_t | resident_count () const noexcept |
| std::size_t | resident_byte_size () const noexcept |
| bool | is_resident (ChunkKey key) const noexcept |
| std::size_t | resident_slot (ChunkKey key) const noexcept |
| auto | resident_ref (ChunkKey key) const noexcept -> ResidentChunkRef |
| ResidencyGeneration | residency_generation (ChunkKey key) const noexcept |
| bool | valid (ResidencyHandle handle) const noexcept |
| std::span< const ChunkKey > | resident_chunk_keys () const noexcept |
| std::uint64_t | residency_fingerprint () const noexcept |
| ResidencyHandle | ensure_resident (ChunkKey key) |
| bool | touch (ChunkKey key) noexcept |
| bool | evict (ChunkKey key) |
| auto | chunk (ChunkKey key) noexcept -> page_type & |
| auto | chunk (ChunkKey key) const noexcept -> const page_type & |
| auto | try_chunk (ChunkKey key) noexcept -> page_type * |
| auto | try_chunk (ChunkKey key) const noexcept -> const page_type * |
| auto | meta (ChunkKey key) noexcept -> ChunkMeta & |
|
auto | meta (ChunkKey key) const noexcept -> const ChunkMeta & |
| auto | try_meta (ChunkKey key) noexcept -> ChunkMeta * |
|
auto | try_meta (ChunkKey key) const noexcept -> const ChunkMeta * |
|
auto | chunk_activity (ChunkKey key) const noexcept -> ChunkActivity |
|
auto | active_category_count (ChunkKey key) const noexcept -> std::uint32_t |
|
auto | dirty_mask (ChunkKey key) const noexcept -> DirtyMask |
|
auto | active_mask (ChunkKey key) const noexcept -> ActiveMask |
|
auto | dirty_bounds (ChunkKey key) const noexcept -> Box3 |
|
void | mark_dirty (ChunkKey key, DirtyMask mask, Box3 bounds) noexcept |
| void | mark_content_changed (ChunkKey key) noexcept |
|
void | mark_topology_dirty (ChunkKey key, DirtyMask mask, Box3 bounds) noexcept |
|
void | mark_topology_rebuilt (ChunkKey key) noexcept |
|
void | clear_dirty (ChunkKey key, DirtyMask mask) noexcept |
|
auto | observe_dirty (ChunkKey key, DirtyMask mask) const noexcept -> DirtyObservation |
| bool | clear_dirty_observed (ChunkKey key, DirtyObservation observed) noexcept |
|
void | mark_active (ChunkKey key, ActiveMask mask) noexcept |
|
void | clear_active (ChunkKey key, ActiveMask mask) noexcept |
| void | collect_dirty_chunks (DirtyMask mask, std::vector< ChunkKey > &out) const |
| void | collect_active_chunks (ActiveMask mask, std::vector< ChunkKey > &out) const |
| auto | dirty_chunks (DirtyMask mask) const -> std::vector< ChunkKey > |
| auto | active_chunks (ActiveMask mask) const -> std::vector< ChunkKey > |
| auto | resolve (Coord3 coord) const noexcept -> ResolvedTile< Shape > |
| auto | try_resolve (Coord3 coord) const noexcept -> std::optional< ResolvedTile< Shape > > |
| template<typename Tag> |
| auto | field (Coord3 coord) noexcept -> Schema::template value_type< Tag > & |
| template<typename Tag> |
| auto | field (Coord3 coord) const noexcept -> const Schema::template value_type< Tag > & |
| template<typename Tag> |
| auto | try_field (Coord3 coord) noexcept -> Schema::template value_type< Tag > * |
| template<typename Tag> |
| auto | try_field (Coord3 coord) const noexcept -> const Schema::template value_type< Tag > * |
| template<typename Tag> |
| auto | field_span (ChunkKey key) noexcept |
| template<typename Tag> |
| auto | field_span (ChunkKey key) const noexcept |
template<typename
Shape, typename Schema>
class tess::World< Shape, Schema, SparseResident >
Byte-budgeted owner of a sparse, least-recently-used chunk set.
Only resident pages are materialized, so storage and iteration are bounded by the configured capacity rather than chunk_count. Residency is explicit: call ensure_resident() before unchecked access. Eviction resets the page before reuse and logically invalidates all pointers, references, spans, slot indices, and handles associated with that chunk. Use a ResidencyHandle when validity must be checked across residency mutations.
Construction allocates the fixed-capacity page and bookkeeping storage. Residency changes and hot accessors allocate no Tess-owned storage afterward; a field value's non-throwing default initializer may allocate. Instances are not internally synchronized: external synchronization is required when residency or content can mutate; concurrent reads require an unchanged world.
template<typename
Shape, typename Schema>
Makes an in-bounds key resident and marks it most-recently used.
When full, the least-recently-used chunk is evicted, invalidating its handles and borrowed storage. A newly materialized page is value-initialized and receives a new generation. Calling this for an already resident key is idempotent for data and generation. Tess performs no dynamic allocation after construction; a field value's nothrow default initialization may manage its own allocation while resetting a reused page.
Returns an invalid handle for a key outside the bounded shape, matching try_chunk(), try_meta() and residency_generation(). This is the only residency entry point with no checked counterpart, so it is total rather than asserted: the directory's direct-slot mode indexes its slot table by the key, and an out-of-range key previously wrote past the end wherever assertions were compiled out.
template<typename
Shape, typename Schema>
Advances the resident chunk's content version without marking dirty work.
Use this after a content write that must invalidate version-keyed derived state but does not concern any dirty-mask consumer. This changes only the content version. Use mark_dirty for dirty-metadata consumers, mark_topology_dirty when topology freshness must change, and the schedule's notification protocol when an OnDirty task must run. An intervening call also makes an earlier DirtyObservation stale.
The key must be resident, matching the precondition of mark_dirty.
template<typename
Shape, typename Schema>
Returns an order-independent fingerprint of resident content and slots.
It incorporates eviction/rematerialization generations, content versions, keys, and slot bindings, so consumers can probabilistically invalidate artifacts indexed by resident slot. Computing it is O(resident_count), allocation-free, and never visits non-resident chunks. It is not a persistent identifier or a collision-proof digest.