API reference
API reference
Select your platform
No SDKs available
No versions available

CircularPool Class

A circular pool of objects that can be reused.

Constructors

CircularPool ( primitive , size , callbacks )
This constructor initializes a new instance of the CircularPool class.
It takes in three parameters: the type of primitive to be stored in the pool, the size of the pool, and a set of callbacks that will be used to create and destroy instances of the primitive type. The constructor initializes the pool with the specified size and creates instances of the primitive type using the provided callbacks.
Signature
CircularPool(T primitive, int size, Callbacks callbacks)
Parameters
primitive: T  The type of primitive to be stored in the pool.
size: int  The size of the pool.
callbacks: Callbacks  A set of callbacks that will be used to create and destroy instances of the primitive type.

Protected Properties

CountActive : override int
[Get]
Gets the number of objects in use.
Signature
override int CountActive
CountAll : override int
[Get]
Gets the number of objects in the pool.
Signature
override int CountAll

Methods

Get ()
Get an object from the pool.
Signature
override T Get()
Returns
override T
Release ( t )
Release an object back to the pool.
Signature
override void Release(T t)
Parameters
t: T
Returns
override void