public sealed class SelfCreatingPool<T> : ISelfCreatingNewObjectHandler<T> where T : class
A pool which is capable of generating new pooled objects when needed.
public SelfCreatingPool(Func<T> CreateNewObjectFunction)
Creates a new instance of the Self Creating Pool.
Name | Type | Description |
---|---|---|
CreateNewObjectFunction | Func<T> |
The fuction to use to create new objects for the pool when needed. |
public void DespositObject(T obj)
Deposits an object back into the pool.
Name | Type | Description |
---|---|---|
obj | T |
The object to deposit. |
public T WithdrawObject()
Withdraws an object from the pool.
T
The object.