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
Returns a spare item if there are any, or creates a new one.
static
Acquire<T>(HashSet<T>) void
Returns a spare System.Collections.Generic.HashSet`1 if there are any, or creates a new one.
static
Acquire<T>(List<T>) void
Returns a spare System.Collections.Generic.List`1 if there are any, or creates a new one.
static
Acquire<T>(T) void
Returns a spare `item` if there are any, or creates a new one.
static
AcquireList<T>() List<T>
Returns a spare System.Collections.Generic.List`1 if there are any, or creates a new one.
static
AcquireSet<T>() HashSet<T>
Returns a spare System.Collections.Generic.HashSet`1 if there are any, or creates a new one.
static
AcquireStringBuilder() StringBuilder
Returns a spare System.Text.StringBuilder if there are any, or creates a new one.
static
Release(StringBuilder) void
Sets the System.Text.StringBuilder.Length = 0 and adds it to the list of spares so it can be reused.
static
Release<T>(HashSet<T>) void
Clears the `set` and adds it to the list of spares so it can be reused.
static
Release<T>(HashSet<T>) void
Clears the `set`, adds it to the list of spares so it can be reused, and sets it to null.
static
Release<T>(List<T>) void
Clears the `list` and adds it to the list of spares so it can be reused.
static
Release<T>(List<T>) void
Clears the `list`, adds it to the list of spares so it can be reused, and sets it to null.
static
Release<T>(T) void
Adds the `item` to the list of spares so it can be reused.
static
Release<T>(T) void
Adds the `item` to the list of spares so it can be reused and sets it to null.
static
ReleaseToString(StringBuilder) string
[Animancer Extension] Calls System.Text.StringBuilder.ToString and Animancer.ObjectPool.Release(System.Text.StringBuilder).
static