Poolable<TSelf> Class
- Namespace
- SatorImaging.UnityFundamentals
public abstract class Poolable<TSelf> : IDisposable where TSelf : Poolable<TSelf>, new()
Type Parameters
TSelf
- Inheritance
-
Poolable<TSelf>
- Implements
- Derived
- Extension Methods
Methods
- ClearUnusedInstancesFromPool()
Purge unused instances from pool. NOTE: active instances remain alive and return to pool on dispose.
- Dispose()
[Thread-Safe] Return instance to pool.
- GetInstance()
[Thread-Safe] Get pooled instance or create new if pool is empty. Call
Dispose()
to return instance to pool for reuse.
- OnWillReturnToPool()
This method is only called if instance is not returned to pool.
- ThrowIfAlreadyReturnedToPool(string)
Throw exception if instance has already returned to pool.