|
ObjectPoolT Constructor |
Constructor
Namespace: Ab4d.SharpEngine.UtilitiesAssembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax public ObjectPool(
int initialCapacity,
Action<T>? resetObjectAction = null,
bool resetOnReturn = false,
bool resetOnlyReusedObjects = true
)
Parameters
- initialCapacity Int32
- initial capacity of the pool
- resetObjectAction ActionT (Optional)
- optional Action that is called to reset the object (null by default)
- resetOnReturn Boolean (Optional)
- when false (by default) then resetObjectAction is called (if specified) before the object is get; when true then resetObjectAction is called (if specified) when the object is returned;
- resetOnlyReusedObjects Boolean (Optional)
- when true (by default) and when resetOnReturn is false then resetObjectAction is called (if specified) only for reused objects and not for objects that were newly created
See Also