A simple object pool.
sealed class
|
SimpleObjectPool
|
with
|
<T>
|
as
|
class
|
This object pool is not thread-safe and cannot be used for pooling IDisposable objects.
See also:
ObjectPoolCreates a new instance of ObjectPool.
public
constructor
|
SimpleObjectPool
(IObjectPoolFactory<T> factory,
int32 count)
|
||
params
|
factory
|
[not-null]
|
The pool object factory to use. |
count
|
[>0]
|
Maximum number of pooled objects to hold. |
Clears the object pool.
public
method
|
Clear
()
|
Fetches a pooled object.
public
method
|
Get
()
|
||
type
|
T
|
||
returns
|
|
The pooled object. |
Puts the given pooled object back.
public
method
|
Put
(T obj)
|
||
params
|
obj
|
[not-null]
|
The pooled object to put back. |