Class ObjectPoolSimple

Public

Lightweight object Pool.

Handy class for pooling objects of type T.

Usage:

  • Claim a new object usingSomeClass foo = ObjectPool<SomeClass>.Claim ();

  • Use it and do stuff with it

  • Release it withObjectPool<SomeClass>.Release (foo);

After you have released a object, you should never use it again.

Since

Version 3.2

Version

Since 3.7.6 this class is thread safe

Public Static Methods

Claim ()

Claim a object.

Clear ()

Clears the pool for objects of this type.

GetSize ()

Number of objects of this type in the pool.

Release (obj)

Releases an object.

Private/Protected Members

inPool
Private Static Readonly
pool

Internal pool.

Private Static