Interface IRecyclingPool<T>
Maintains a cache of unused instances that can be use as cloning or deserialization targets.
Namespace: Microsoft.Psi
Assembly: Microsoft.Psi.dll
Syntax
public interface IRecyclingPool<T>
Type Parameters
Name | Description |
---|---|
T | The type of instances that can be cached by this cloner. |
Properties
View SourceAvailableAllocationCount
Gets the number of available allocations that have been already returned to the pool.
Declaration
int AvailableAllocationCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
OutstandingAllocationCount
Gets the number of allocations that have not yet been returned to the pool.
Declaration
int OutstandingAllocationCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
View SourceGet()
Returns the next available cached object.
Declaration
T Get()
Returns
Type | Description |
---|---|
T | An unused cached object that can be reused as a target for cloning or deserialization. |
Recycle(T)
Returns an unused object back to the pool. The caller must guarantee that the entire object tree (the object and any of the objects it references) are not in use anymore.
Declaration
void Recycle(T freeInstance)
Parameters
Type | Name | Description |
---|---|---|
T | freeInstance | The object to return to the pool. |