AMPS C# Client
5.3.3.4
AMPS C# Client for .NET
|
Public Member Functions | |
Pool (int initialSize) | |
T | get () |
void | returnToPool (T theInstance) |
A simple generic instance pool for objects that take a while to construct.
<T> | The pooled type. |
T | : | new() |
|
inline |
Constructs a pool with the given size
theClass | The Class pooled. Should always be T.class. Sorry we can't do this ourselves. |
initialSize | The initial size of the pool. If you pass a value less than 1, we'll just use 1. |
|
inline |
Returns an object from the pool, growing self if necessary (by initialSize). If T cannot be instantiated, returns null.
|
inline |
Return an object to the pool. Note, you're responsible for clear/reset of objects being returned.
theInstance | The T to return to the pool. |