Class PoolItem<T>

Namespace: CapyKit
Assembly: CapyKit.dll

A pool item. This class cannot be inherited.

public sealed class PoolItem<T>

Type Parameters

T

The type of the pooled item.

Inheritance

objectPoolItem<T>

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Extension Methods

ObjectExtensions.UpdateProperties<PoolItem<T>>(PoolItem<T>, PoolItem<T>), ObjectExtensions.UpdateProperties(object, object)

Properties

Index

Gets the zero-based index of the pooled item.

public int Index { get; }

Property Value

int

Item

Gets the pooled resource.

public T Item { get; }

Property Value

T

Locked

Gets a value indicating whether this object is locked or not.

public bool Locked { get; }

Property Value

bool

TypeName

Gets the name of the System.Type of the pooled item.

public string TypeName { get; }

Property Value

string

Methods

ReleaseLock()

Releases the lock on the item.

public void ReleaseLock()

Remarks

If the item is not locked, an error event is emitted.

SetLock()

Sets the lock on the item indicating that it is in use.

public bool SetLock()

Returns

bool

true if the item is locked successfully, false if it fails.

Remarks

If the item is already locked, an error event is emitted.

ToString()

Returns a string that represents the current object and its lock state.

public override string ToString()

Returns

string

A string that represents the current object and its lock state.