Table of Contents

Class ReferencePool

Namespace
EzrSquared.Runtime
Assembly
ezrSquared-lib.dll

A static pool for Reference.

public static class ReferencePool
Inheritance
object
ReferencePool

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 IEzrObject

The IEzrObject being referenced.

accessibilityModifiers AccessMod

The accessibility modifiers of the reference.

name string

The name of the reference.

Returns

Reference

The reference.

TryRelease(Reference)

Releases a reference to the pool.

public static void TryRelease(Reference reference)

Parameters

reference Reference

The reference to release.