Struct IPool<T>
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
-
IEnumerable<T>IEquatable<IPool<T>>
- Inherited Members
Constructors
IPool(nint)
Initializes a new instance of the IPool<T> struct.
public IPool(nint handle)
Parameters
handlenintA pointer to the unmanaged interface.
Properties
Handle
Gets the handle to the unmanaged interface instance.
public nint Handle { get; }
Property Value
HasValue
Gets a value indicating whether the pointer has a value.
public bool HasValue { get; }
Property Value
Methods
Bounds()
Gets the bounds of the pool.
public (Size, Size) Bounds()
Returns
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
otherIPool<T>
Returns
Equals(object?)
public override bool Equals(object? other)
Parameters
otherobject
Returns
Get(int)
Gets the element at the specified index.
public T Get(int index)
Parameters
indexintThe 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
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
indexintThe index of the element to lock.
Release(int)
Releases the element at the specified index.
public void Release(int index)
Parameters
indexintThe index of the element to release.
Unlock(int)
Unlocks the element at the specified index.
public bool Unlock(int index)
Parameters
indexintThe index of the element to unlock.
Returns
Operators
operator ==(IPool<T>, object?)
Determines whether the specified values are equal.
public static bool operator ==(IPool<T> lhs, object? rhs)
Parameters
lhsIPool<T>The value on the left side of the operator.
rhsobjectThe value on the right side of the operator.
Returns
- bool
trueif 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
valueIPool<T>The pool to convert.
Returns
operator !=(IPool<T>, object?)
Determines whether the specified values are not equal.
public static bool operator !=(IPool<T> lhs, object? rhs)
Parameters
lhsIPool<T>The value on the left side of the operator.
rhsobjectThe value on the right side of the operator.
Returns
- bool
trueif the values are not equal; otherwise,false.