Show / Hide Table of Contents

Class ListPool<T>

Inheritance
System.Object
ListPool<T>
Namespace: Eco.Shared.Pools
Assembly: Eco.Shared.dll
Syntax
public abstract class ListPool<T> : Object
Type Parameters
Name Description
T

Constructors

ListPool()

Declaration
protected ListPool()

Properties

Shared

Declaration
public static ListPool<T> Shared { get; }
Property Value
Type Description
ListPool<T>

Methods

Create()

Declaration
public static ListPool<T> Create()
Returns
Type Description
ListPool<T>

Create(Int32, Int32)

Declaration
public static ListPool<T> Create(int maxCapacity, int maxListsPerBucket)
Parameters
Type Name Description
System.Int32 maxCapacity
System.Int32 maxListsPerBucket
Returns
Type Description
ListPool<T>

Rent(Int32)

Declaration
public abstract List<T> Rent(int minimumCapacity)
Parameters
Type Name Description
System.Int32 minimumCapacity
Returns
Type Description
System.Collections.Generic.List<T>

RentAndPromiseToReturn(Int32, out List<T>)

Rents list and promises to return it back to pool when ListPool<T>.ReturnPromise disposed.

Declaration
public ListPool<T>.ReturnPromise RentAndPromiseToReturn(int minimumCapacity, out List<T> list)
Parameters
Type Name Description
System.Int32 minimumCapacity
System.Collections.Generic.List<T> list
Returns
Type Description
ListPool.ReturnPromise<>

Return(List<T>)

Use this with caution! If you will return list which was exceeded requested capacity then you can give an exception.

Declaration
public abstract void Return(List<T> list)
Parameters
Type Name Description
System.Collections.Generic.List<T> list

list which was rented from pool.

Extension Methods

CommandLine.FeedFromCommandLine(Object)
CommandLine.ToCommandLineArgs(Object, Func<Object, Boolean>)
ListUtil.DepthFirstTraversal<T>(T, Func<T, IEnumerable<T>>)
EnumerableExtensions.SingleItemAsEnumerable<T>(T)
EventUtils.RaiseEvent<TEventArgs>(Object, String, TEventArgs)
PredicateUtils.MatchesAll<TEnumerable, T>(T, TEnumerable)
PredicateUtils.MatchesAll<T>(T, Func<T, Boolean>[])
PredicateUtils.MatchesAny<TEnumerable, T>(T, TEnumerable)
ReflectionUtils.PropertyValue<T>(Object, PropertyInfo)
ReflectionUtils.TryGetPropertyValueByName<T>(Object, String, out T)
ReflectionUtils.GetPropertyValueByName<T>(Object, String)
ReflectionUtils.SetPropertyByName(Object, String, Object)
ReflectionUtils.GetStructPropertyByName<T>(Object, String)
ReflectionUtils.GetStringPropertyByName(Object, String)
ReflectionUtils.ZipByProperty<T>(Object, Object, Object, Func<T, T, T>)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾