Struct ScyllaObjectPool<T>.Enumerator
Value-type enumerator for ScyllaObjectPool<T> that enables allocation-free iteration.
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public struct ScyllaObjectPool<T>.Enumerator
Remarks
The count of inactive instances is captured at construction time. If instances are added to or removed from the pool during enumeration, the enumerator will not reflect those changes and may produce stale or unexpected results. Mutation during enumeration is not supported.
Constructors
Enumerator(ScyllaObjectPool<T>)
Initializes a new instance of the enumerator for the specified pool.
Declaration
public Enumerator(ScyllaObjectPool<T> pool)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaObjectPool<T> | pool | The pool to enumerate |
Properties
Current
Gets the instance at the current position of the enumerator.
Declaration
public readonly T Current { get; }
Property Value
| Type | Description |
|---|---|
| T |
Methods
MoveNext()
Advances the enumerator to the next inactive instance.
Declaration
public bool MoveNext()
Returns
| Type | Description |
|---|---|
| bool | True if advanced; false if past the end |