Table of Contents

Struct ArchetypeWalk<TArch>

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

A walk of every entity of TArch visible at its transaction's snapshot, one batch at a time: foreach (var batch in tx.Walk<TArch>()). Created by Walk<TArch>().

public ref struct ArchetypeWalk<TArch> where TArch : class

Type Parameters

TArch
Inherited Members

Remarks

What it yields. Each entity visible at the snapshot exactly once, across any number of tick fences (WALK-01), minus the transaction's own pending destroys. Its own uncommitted updates and spawns are not shown, as a field query does not show them (VIS-12). Versioned components read their value at the snapshot; SingleVersion and Transient ones read the current value, which is all those storage modes promise.

What it holds. A bounded window of pages, at any data size (EP-02), and between batches no epoch pin: a consumer that pauses between batches does not keep the pages other threads touch meanwhile (EP-03). Its snapshot stays held for as long as the transaction lives.

Order. Storage order (one cluster per batch) on an archetype without a spatial index, the fastest walk the engine has. On a spatial archetype, whose fence moves entities between clusters, entity-map order with up to 64 entities per batch, gathered into the walk's buffers.

Properties

Current

The current batch, valid until the next MoveNext() or Dispose().

public readonly WalkBatch<TArch> Current { get; }

Property Value

WalkBatch<TArch>

Methods

Dispose()

Releases the walk's pages and buffers. Idempotent.

public readonly void Dispose()

GetEnumerator()

Returns this walk: foreach drives it directly.

public readonly ArchetypeWalk<TArch> GetEnumerator()

Returns

ArchetypeWalk<TArch>

MoveNext()

Advances to the next batch holding at least one entity; false once the walk has visited every one.

public readonly bool MoveNext()

Returns

bool