Table of Contents

Class ListPoolPolicy<T>

Namespace
RichHudFramework
Assembly
RichHudClient.dll

IPooledObjectPolicy<T> implementation specialized for List<T>. Reuses lists by calling Clear() instead of allocating new ones.

public class ListPoolPolicy<T> : IPooledObjectPolicy<List<T>>

Type Parameters

T
Inheritance
ListPoolPolicy<T>
Implements

Methods

GetNewObject()

Creates a fresh instance of System.Collections.Generic.List{`0}.

public List<T> GetNewObject()

Returns

List<T>

GetNewPool()

Convenience factory returning a pool pre-configured with this policy.

public static ObjectPool<List<T>> GetNewPool()

Returns

ObjectPool<List<T>>

ResetObject(List<T>)

Prepares a used object for reuse (e.g. clears state, unsubscribes events). Called immediately before the object is returned to the pool.

public void ResetObject(List<T> list)

Parameters

list List<T>

ResetRange(IReadOnlyList<List<T>>, int, int)

Resets a contiguous range of pooled objects in a list.

public void ResetRange(IReadOnlyList<List<T>> lists, int index, int count)

Parameters

lists IReadOnlyList<List<T>>
index int
count int

ResetRange<T2>(IReadOnlyList<MyTuple<List<T>, T2>>, int, int)

Resets the contiguous range of pooled objects in a list of tuples.

public void ResetRange<T2>(IReadOnlyList<MyTuple<List<T>, T2>> lists, int index, int count)

Parameters

lists IReadOnlyList<MyTuple<List<T>, T2>>
index int
count int

Type Parameters

T2