Class CollectionPool<TCollection, TItem>
Generic collections pool implementation.
Inheritance
System.Object
CollectionPool<TCollection, TItem>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: StansAssets.Foundation.Patterns
Assembly: cs.temp.dll.dll
Syntax
public class CollectionPool<TCollection, TItem>
where TCollection : class, ICollection<TItem>, new()
Type Parameters
Name | Description |
---|---|
TCollection | Type of the collection. |
TItem | Type of the collection item. |
Methods
Get()
Get new.
Declaration
public static TCollection Get()
Returns
Type | Description |
---|---|
TCollection | A new HashSet |
Get(out TCollection)
Get a new list PooledObject.
Declaration
public static ObjectPool<TCollection>.PooledObject Get(out TCollection value)
Parameters
Type | Name | Description |
---|---|---|
TCollection | value | Output typed HashSet. |
Returns
Type | Description |
---|---|
ObjectPool.PooledObject<> | A new HashSet PooledObject. |
Release(TCollection)
Release an object to the pool.
Declaration
public static void Release(TCollection toRelease)
Parameters
Type | Name | Description |
---|---|---|
TCollection | toRelease | hashSet to release. |