Table of Contents

Struct IPool<T>

Namespace
SampSharp.OpenMp.Core.Api
Assembly
SampSharp.OpenMp.Core.dll

This type represents a pointer to an unmanaged open.mp IPool<T> interface.

[OpenMpApi(new Type[] { })]
public readonly struct IPool<T> : IEnumerable<T>, IEnumerable, IEquatable<IPool<T>>, IPool<T>.IManagedInterface, IUnmanagedInterface where T : unmanaged, IIDProvider.IManagedInterface

Type Parameters

T
Implements
Inherited Members

Constructors

IPool(nint)

Initializes a new instance of the IPool<T> struct.

public IPool(nint handle)

Parameters

handle nint

A pointer to the unmanaged interface.

Properties

Handle

Gets the handle to the unmanaged interface instance.

public nint Handle { get; }

Property Value

nint

HasValue

Gets a value indicating whether the pointer has a value.

public bool HasValue { get; }

Property Value

bool

Methods

Bounds()

Gets the bounds of the pool.

public (Size, Size) Bounds()

Returns

(Size, Size)

A tuple containing the lower and upper bounds of the pool.

Count()

Gets the number of elements in the pool.

public Size Count()

Returns

Size

The number of elements in the pool.

Equals(IPool<T>)

public bool Equals(IPool<T> other)

Parameters

other IPool<T>

Returns

bool

Equals(object?)

public override bool Equals(object? other)

Parameters

other object

Returns

bool

Get(int)

Gets the element at the specified index.

public T Get(int index)

Parameters

index int

The index of the element to retrieve.

Returns

T

The element at the specified index.

GetEnumerator()

Gets an enumerator that iterates through the pool.

public IPool<T>.Enumerator GetEnumerator()

Returns

IPool<T>.Enumerator

An enumerator for the pool.

GetHashCode()

public override int GetHashCode()

Returns

int

GetPoolEventDispatcher()

Gets the event dispatcher for the pool.

public IEventDispatcher<IPoolEventHandler<T>> GetPoolEventDispatcher()

Returns

IEventDispatcher<IPoolEventHandler<T>>

An IEventDispatcher<T> for handling pool events.

Lock(int)

Locks the element at the specified index.

public void Lock(int index)

Parameters

index int

The index of the element to lock.

Release(int)

Releases the element at the specified index.

public void Release(int index)

Parameters

index int

The index of the element to release.

Unlock(int)

Unlocks the element at the specified index.

public bool Unlock(int index)

Parameters

index int

The index of the element to unlock.

Returns

bool

true if the element was successfully unlocked; otherwise, false.

Operators

operator ==(IPool<T>, object?)

Determines whether the specified values are equal.

public static bool operator ==(IPool<T> lhs, object? rhs)

Parameters

lhs IPool<T>

The value on the left side of the operator.

rhs object

The value on the right side of the operator.

Returns

bool

true if the values are equal; otherwise, false.

explicit operator IReadOnlyPool<T>(IPool<T>)

Converts the pool to a read-only pool.

public static explicit operator IReadOnlyPool<T>(IPool<T> value)

Parameters

value IPool<T>

The pool to convert.

Returns

IReadOnlyPool<T>

operator !=(IPool<T>, object?)

Determines whether the specified values are not equal.

public static bool operator !=(IPool<T> lhs, object? rhs)

Parameters

lhs IPool<T>

The value on the left side of the operator.

rhs object

The value on the right side of the operator.

Returns

bool

true if the values are not equal; otherwise, false.