Class PoolItem<T>
A pool item. This class cannot be inherited.
Namespace: CapyKit
Assembly: CapyKit.dll
Syntax
public sealed class PoolItem<T>
Type Parameters
| Name | Description |
|---|---|
| T | The type of the pooled item. |
Properties
Index
Gets the zero-based index of the pooled item.
Declaration
public int Index { get; }
Property Value
| Type | Description |
|---|---|
| int | The index. |
Item
Gets the pooled resource.
Declaration
public T Item { get; }
Property Value
| Type | Description |
|---|---|
| T | The pooled resource. |
Locked
Gets a value indicating whether this object is locked or not.
Declaration
public bool Locked { get; }
Property Value
| Type | Description |
|---|---|
| bool | A value indicating whether this object is locked or not. |
TypeName
Gets the name of the Type of the pooled item.
Declaration
public string TypeName { get; }
Property Value
| Type | Description |
|---|---|
| string | The name of the Type of the pooled item. |
Methods
ReleaseLock()
Releases the lock on the item.
Declaration
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.
Declaration
public bool SetLock()
Returns
| Type | Description |
|---|---|
| bool |
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.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object and its lock state. |