ObjectPool Class

Summary

Convenience methods for accessing Animancer.ObjectPool`1.
Assembly
Animancer.dll
Namespace
Animancer
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["ObjectPool"] class Type type-node

Syntax

public static class ObjectPool

Fields

Name Constant Value Summary
NotClearError They must be cleared before being released to the pool and not modified after that.
An error message for when something has been modified after being released to the pool.
static

Methods

Name Value Summary
Acquire<T>() T
Calls Animancer.ObjectPool`1.Acquire to get a spare item if there are any, or create a new one.
static
Acquire<T>(T) void
Calls Animancer.ObjectPool`1.Acquire to get a spare item if there are any, or create a new one.
static
AcquireList<T>() List<T>
Calls Animancer.ObjectPool`1.Acquire to get a spare System.Collections.Generic.List`1 if there are any or create a new one.
static
AcquireSet<T>() HashSet<T>
Calls Animancer.ObjectPool`1.Acquire to get a spare System.Collections.Generic.HashSet`1 if there are any or create a new one.
static
AcquireStringBuilder() StringBuilder
Calls Animancer.ObjectPool`1.Acquire to get a spare System.Text.StringBuilder if there are any or create a new one.
static
GetCachedResult<T>(Func<T>) T
Creates an object using the provided delegate and caches it so the same style can be returned when this method is called again for the same delegate.
static
Release(StringBuilder) void
Sets System.Text.StringBuilder.Length = 0 and Animancer.ObjectPool`1.Release(`0) to mark it as a spare so it can be later returned by Animancer.ObjectPool.AcquireStringBuilder.
static
Release<T>(HashSet<T>) void
Calls Animancer.ObjectPool`1.Release(`0) to clear the `set` and mark it as a spare so it can be later returned by Animancer.ObjectPool.AcquireSet``1.
static
Release<T>(List<T>) void
Calls Animancer.ObjectPool`1.Release(`0) to clear the `list` and mark it as a spare so it can be later returned by Animancer.ObjectPool.AcquireList``1.
static
Release<T>(T) void
Calls Animancer.ObjectPool`1.Release(`0) to add the `item` to the list of spares so it can be reused.
static
Release<T>(T) void
Calls Animancer.ObjectPool`1.Release(`0) to add the `item` to the list of spares so it can be reused.
static
ReleaseToString(StringBuilder) string
Calls System.Text.StringBuilder.ToString and Animancer.ObjectPool.Release(System.Text.StringBuilder).
static