Class PoolableListEnumerator<T>
This allows to iterate through list with return to the pool after end. Uesfull for iterations over not-thread-safe collections in multithread environment. It will create a copy of collection by using lock and pooled list and it will automaticly return the list after Dispose is called.
Inheritance
System.Object
PoolableListEnumerator<T>
Implements
System.Collections.Generic.IEnumerator<T>
System.Collections.IEnumerator
System.IDisposable
Namespace: Eco.Shared.Utils
Assembly: Eco.Shared.dll
Syntax
public sealed class PoolableListEnumerator<T> : ValueType, IEnumerator<T>, IEnumerator, IDisposable
Type Parameters
| Name | Description |
|---|---|
| T |
Properties
Current
Declaration
public T Current { get; }
Property Value
| Type | Description |
|---|---|
| T |
Methods
Create<TContext, TContext2, TContext3>(TContext, TContext2, TContext3, Action<TContext, TContext2, TContext3, PoolableListWrapper<T>>)
Declaration
public static PoolableListEnumerator<T> Create<TContext, TContext2, TContext3>(TContext context, TContext2 context2, TContext3 context3, Action<TContext, TContext2, TContext3, PoolableListWrapper<T>> listBuilder)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | context | |
| TContext2 | context2 | |
| TContext3 | context3 | |
| System.Action<TContext, TContext2, TContext3, PoolableListWrapper<T>> | listBuilder |
Returns
| Type | Description |
|---|---|
| PoolableListEnumerator<T> |
Type Parameters
| Name | Description |
|---|---|
| TContext | |
| TContext2 | |
| TContext3 |
Dispose()
Declaration
public void Dispose()
MoveNext()
Declaration
public bool MoveNext()
Returns
| Type | Description |
|---|---|
| System.Boolean |
Reset()
Declaration
public void Reset()
Implements
System.Collections.Generic.IEnumerator<>
System.Collections.IEnumerator
System.IDisposable