A simple generic instance pool for objects that take a while to construct.
More...
|
| Pool (int initialSize) |
| Initializes a new instance of the Pool class with the specified initial size. More...
|
|
T | get () |
| Returns an object from the pool, growing itself if necessary (by initialSize). If T cannot be instantiated, returns null. More...
|
|
void | returnToPool (T theInstance) |
| Return an object to the pool. Note, you're responsible for clear/reset of objects being returned. More...
|
|
A simple generic instance pool for objects that take a while to construct.
- Template Parameters
-
◆ Pool()
Initializes a new instance of the Pool class with the specified initial size.
- Parameters
-
initialSize | The initial size of the pool. |
◆ get()
Returns an object from the pool, growing itself if necessary (by initialSize). If T cannot be instantiated, returns null.
- Returns
- A pooled instance.
◆ returnToPool()
Return an object to the pool. Note, you're responsible for clear/reset of objects being returned.
- Parameters
-
theInstance | The T to return to the pool. |
The documentation for this class was generated from the following file: