Class ObjectPool<T>
Pool of objects.
Inheritance
System.Object
ObjectPool<T>
Namespace: GraphShape.Controls
Assembly: GraphShape.Controls.dll
Syntax
public class ObjectPool<T> : object where T : IPoolObject, new()
Type Parameters
| Name | Description |
|---|---|
| T | Pool object type. |
Constructors
| Improve this Doc View SourceObjectPool()
Pool constructor, pool will allow growth.
Declaration
public ObjectPool()
ObjectPool(Int32, Boolean)
Pool constructor.
Declaration
public ObjectPool(int initialPoolSize, bool allowPoolGrowth)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | initialPoolSize | Initial pool size. |
| System.Boolean | allowPoolGrowth | Allow pool growth or not. |
Methods
| Improve this Doc View SourceGetObject()
Gets an object from the pool.
Declaration
public T GetObject()
Returns
| Type | Description |
|---|---|
| T | Returns with the object or null if there isn't any free objects and the pool does not allow growth. |