Struct Transaction.ReadOnlyCollectionEnumerator<T>
Zero-copy, read-only foreach enumerator over the elements of a component collection buffer.
public ref struct Transaction.ReadOnlyCollectionEnumerator<T> where T : unmanaged
Type Parameters
TUnmanaged element type of the collection.
- Inherited Members
Constructors
ReadOnlyCollectionEnumerator(VariableSizedBufferSegment<T, PersistentStore>, int)
Creates the enumerator over the buffer identified by bufferId within vsbs.
public ReadOnlyCollectionEnumerator(VariableSizedBufferSegment<T, PersistentStore> vsbs, int bufferId)
Parameters
vsbsVariableSizedBufferSegment<T, PersistentStore>Segment holding the collection's variable-sized buffers.
bufferIdintRoot chunk id of the buffer to enumerate.
Properties
Current
Zero-copy reference to the current element. Valid until the next MoveNext() call.
public ref readonly T Current { get; }
Property Value
- T
Methods
Dispose()
Releases the underlying buffer enumerator (unpins accessed pages).
public void Dispose()
GetEnumerator()
Returns this enumerator (enables the foreach pattern).
public Transaction.ReadOnlyCollectionEnumerator<T> GetEnumerator()
Returns
MoveNext()
Advances to the next element; returns false when the buffer is exhausted.
public bool MoveNext()