API reference

Pool Class

A generic pool of objects.

Protected Fields

index : int
The index of the next object to be retrieved from the pool.
Signature
int index
indices : Dictionary< T, int >
The indices of the objects in the pool.
Signature
Dictionary<T, int> indices
pool : Entry[]
The pool of objects.
Signature
Entry [] pool

Fields

callbacks : Callbacks
The callbacks to execute when an object is created, retrieved from the pool or released back to it.
Signature
Callbacks callbacks

Protected Properties

CountActive : abstract int
[Get]
The number of active objects in the pool.
Signature
abstract int CountActive
CountAll : abstract int
[Get]
The number of objects in the pool.
Signature
abstract int CountAll

Properties

CountInactive : int
[Get]
The number of inactive objects in the pool.
Signature
virtual int CountInactive

Protected Methods

Swap ( i0 , i1 )
Swap the two objects in the pool.
Signature
void Swap(int i0, int i1)
Parameters
i0: int  Object 1
i1: int  Object 2
Returns
void

Methods

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

Inner Structs

Callbacks Struct

Generic Callbacks.

Fields

Create : Func< T, T >
Signature
Func<T, T> Create
OnGet : Action< T >
Signature
Action<T> OnGet
OnRelease : Action< T >
Signature
Action<T> OnRelease

Entry Struct

A generic pool entry with a flag indicating whether it is active or not and the object itself.

Fields

active : bool
Signature
bool active
t : T
Signature
T t