ClassObjectPool
Represents a pool of reusable objects to optimize memory usage and improve performance by minimizing the cost of object creation and destruction.
Definition
Namespace:Telerik.Windows.Documents.UI
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public class ObjectPool
Inheritance: objectObjectPool
Constructors
ObjectPool()
Declaration
public ObjectPool()
Methods
ClearPool(PoolId)
Clears the object pool associated with the specified PoolId.
Declaration
public void ClearPool(ObjectPool.PoolId poolId)
Parameters
poolId
The identifier of the pool to be cleared.
CreateObject<T>()
Creates an instance of the specified type T from the object pool.
Declaration
public T CreateObject<T>() where T : new()
Returns
T
An instance of the specified type T from the object pool.
CreateObject<T>(PoolId)
Creates an object of the specified type from the object pool identified by the given PoolId.
Declaration
public T CreateObject<T>(ObjectPool.PoolId poolID) where T : new()
Parameters
poolID
The identifier of the object pool from which to create the object.
Returns
T
A new instance of the specified type T retrieved from the object pool.
ReleaseObject(object)
Releases the specified object back to the object pool for reuse.
Declaration
public void ReleaseObject(object obj)
Parameters
obj
The object to release to the pool.
ReleaseObject(object, PoolId)
Releases an object back to the specified object pool for reuse.
Declaration
public void ReleaseObject(object obj, ObjectPool.PoolId poolID)
Parameters
obj
The object to be released.
poolID
The identifier of the object pool to which the object is being released.