# Pool<T> Class A managed pool of resources. This class provides a thread-safe way to manage a collection of objects of type *T*. ## Definition **Namespace:** CapyKit **Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0 **C#** ``` C# public class Pool ``` **F#** ``` F# type Pool<'T> = class end ```
InheritanceObject → Pool(T)
#### Type Parameters
The type of objects to be managed by the pool.
## Constructors
Pool(T)(IEnumerable(T)) Initializes a new instance of the Pool(T) class with the specified collection of items.
Pool(T)(Int32) Initializes a new instance of the Pool(T) class with the specified pool size.
Pool(T)(Int32, Func(T)) Initializes a new instance of the Pool(T) class with the specified pool size and constructor selector.
## Methods
Equals Determines whether the specified object is equal to the current object.
(Inherited from Object)
FillPoolItemCollection(IEnumerable(T)) Fill the pool item collection from an existing T collection.
FillPoolItemCollection(Int32) Initializes the pool with the specified number of items using the default constructor.
FillPoolItemCollection(Int32, Func(T)) Initializes the pool with the specified number of items using the specified constructor selector.
Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetAvailableItem Gets the first available item from the pool and sets its lock.
GetHashCode Serves as the default hash function.
(Inherited from Object)
GetType Gets the Type of the current instance.
(Inherited from Object)
MemberwiseClone Creates a shallow copy of the current Object.
(Inherited from Object)
ReleaseItem Releases the lock on the specified item and returns it to the pool.
ToString Returns a string that represents the current object.
(Inherited from Object)
## Fields
poolItemCollection The collection of pooled items.
poolSize (Immutable) The number of items in the pool.
## See Also #### Reference CapyKit Namespace