Class ObjectPool<T>
Inheritance
ObjectPool<T>
Syntax
public class ObjectPool<T>
where T : class, new()
Type Parameters
Fields
m_Queue
Declaration
protected readonly Queue<T> m_Queue
Field Value
Type |
Description |
Queue<T> |
|
Methods
ClearInstance(T)
Implement a clearing function in this in a derived class to
have the Recycle(T) method automatically clear the item.
Declaration
protected virtual void ClearInstance(T instance)
Parameters
Type |
Name |
Description |
T |
instance |
The object to return to the pool
|
Get()
Declaration
Returns
Recycle(T)
Declaration
public void Recycle(T instance)
Parameters
Type |
Name |
Description |
T |
instance |
|