Table of Contents

Interface IParameterizedObjectPool<TKey, TValue>

Namespace
CodeProject.ObjectPool
Assembly
CodeProject.ObjectPool.dll

A parameterized version of the ObjectPool interface.

public interface IParameterizedObjectPool<in TKey, out TValue> where TKey : notnull

Type Parameters

TKey

The type of the pool parameter.

TValue

The type of the objects stored in the pool.

Properties

Diagnostics

Gets or sets the Diagnostics class for the current Object Pool, whose goal is to record data about how the pool operates. By default, however, an object pool records anything, in order to be most efficient; in any case, you can enable it through the Enabled property.

ObjectPoolDiagnostics Diagnostics { get; set; }

Property Value

ObjectPoolDiagnostics

FactoryMethod

Gets the Factory method that will be used for creating new objects.

Func<in TKey, out TValue>? FactoryMethod { get; }

Property Value

Func<TKey, TValue>

KeysInPoolCount

Gets the count of the keys currently handled by the pool.

int KeysInPoolCount { get; }

Property Value

int

MaximumPoolSize

Gets or sets the maximum number of objects that could be available at the same time in the pool.

int MaximumPoolSize { get; set; }

Property Value

int

Methods

GetObject(TKey)

Gets an object linked to given key.

TValue GetObject(TKey key)

Parameters

key TKey

The key linked to the object.

Returns

TValue

The objects linked to given key.