Class ReferencePool
- Namespace
- EzrSquared.Runtime
- Assembly
- ezrSquared-lib.dll
A static pool for Reference.
public static class ReferencePool
- Inheritance
-
objectReferencePool
Fields
s_ezrObjectReferencePool
The pool of references.
private static readonly ConcurrentQueue<Reference> s_ezrObjectReferencePool
Field Value
- ConcurrentQueue<Reference>
Methods
Get(IEzrObject?, AccessMod, string)
Gets a freshly-reset reference from the pool or creates a new one.
public static Reference Get(IEzrObject? @object = null, AccessMod accessibilityModifiers = AccessMod.None, string name = "")
Parameters
object
IEzrObjectThe IEzrObject being referenced.
accessibilityModifiers
AccessModThe accessibility modifiers of the reference.
name
stringThe name of the reference.
Returns
- Reference
The reference.
TryRelease(Reference)
Releases a reference to the pool.
public static void TryRelease(Reference reference)
Parameters
reference
ReferenceThe reference to release.