SimpleObjectPool

Description

sealed class Tinman.Core.System.SimpleObjectPool<T ref>

A simple object pool.

This object pool is not thread-safe and cannot be used for pooling IDisposable objects.

See also

ObjectPool

Public / Constructors

Simple​Object​Pool


public constructor SimpleObjectPool → (2)

factory in : IObjectPoolFactory<T>

[not-null]
The pool object factory to use.

count in : int32

[>0]
Maximum number of pooled objects to hold.

Creates a new instance of ObjectPool.

Public / Methods

Clear


public method Clear → ()

Clears the object pool.

Get


public method Get → ()

returns → T

The pooled object.

Fetches a pooled object.

Put


public method Put → (1)

obj in : T

[not-null]
The pooled object to put back.

Puts the given pooled object back.