NativePriorityQueue<TElement, TPriority> 结构
Native priorityQueue
命名空间: NativeCollections
程序集: Fantasy.Net.dll
语法
[StructLayout(LayoutKind.Sequential)]
public readonly struct NativePriorityQueue<TElement, TPriority> : IDisposable, IEquatable<NativePriorityQueue<TElement, TPriority>> where TElement : unmanaged where TPriority : unmanaged, IComparable<TPriority>
类型参数
名称 | 描述 |
---|---|
TElement | Type |
TPriority | Type |
构造函数
| 编辑本文 查看源代码NativePriorityQueue(int)
Structure
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public NativePriorityQueue(int capacity)
参数
类型 | 名称 | 描述 |
---|---|---|
int | capacity | Capacity |
属性
| 编辑本文 查看源代码Count
Count
声明
public int Count { get; }
属性值
类型 | 描述 |
---|---|
int |
Empty
Empty
声明
public static NativePriorityQueue<TElement, TPriority> Empty { get; }
属性值
类型 | 描述 |
---|---|
NativePriorityQueue<TElement, TPriority> |
IsCreated
Is created
声明
public bool IsCreated { get; }
属性值
类型 | 描述 |
---|---|
bool |
IsEmpty
Is empty
声明
public bool IsEmpty { get; }
属性值
类型 | 描述 |
---|---|
bool |
this[int]
Get reference
声明
public (TElement Element, TPriority Priority) this[int index] { get; }
参数
类型 | 名称 | 描述 |
---|---|---|
int | index | Index |
属性值
类型 | 描述 |
---|---|
(TElement Element, TPriority Priority) |
UnorderedItems
Unordered items
声明
public NativePriorityQueue<TElement, TPriority>.UnorderedItemsCollection UnorderedItems { get; }
属性值
类型 | 描述 |
---|---|
NativePriorityQueue<TElement, TPriority>.UnorderedItemsCollection |
方法
| 编辑本文 查看源代码Clear()
Clear
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Clear()
Dequeue()
Dequeue
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public TElement Dequeue()
返回
类型 | 描述 |
---|---|
TElement | Item |
DequeueEnqueue(in TElement, in TPriority)
Dequeue enqueue
声明
public TElement DequeueEnqueue(in TElement element, in TPriority priority)
参数
类型 | 名称 | 描述 |
---|---|---|
TElement | element | Element |
TPriority | priority | Priority |
返回
类型 | 描述 |
---|---|
TElement | Element |
Dispose()
Dispose
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Dispose()
Enqueue(in TElement, in TPriority)
Enqueue
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Enqueue(in TElement element, in TPriority priority)
参数
类型 | 名称 | 描述 |
---|---|---|
TElement | element | Element |
TPriority | priority | Priority |
EnqueueDequeue(in TElement, in TPriority)
Enqueue dequeue
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public TElement EnqueueDequeue(in TElement element, in TPriority priority)
参数
类型 | 名称 | 描述 |
---|---|---|
TElement | element | Element |
TPriority | priority | Priority |
返回
类型 | 描述 |
---|---|
TElement | Element |
EnsureCapacity(int)
Ensure capacity
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int EnsureCapacity(int capacity)
参数
类型 | 名称 | 描述 |
---|---|---|
int | capacity | Capacity |
返回
类型 | 描述 |
---|---|
int | New capacity |
Equals(NativePriorityQueue<TElement, TPriority>)
Equals
声明
public bool Equals(NativePriorityQueue<TElement, TPriority> other)
参数
类型 | 名称 | 描述 |
---|---|---|
NativePriorityQueue<TElement, TPriority> | other | Other |
返回
类型 | 描述 |
---|---|
bool | Equals |
Equals(object?)
Equals
声明
public override bool Equals(object? obj)
参数
类型 | 名称 | 描述 |
---|---|---|
object | obj | object |
返回
类型 | 描述 |
---|---|
bool | Equals |
重写
| 编辑本文 查看源代码GetHashCode()
Get hashCode
声明
public override int GetHashCode()
返回
类型 | 描述 |
---|---|
int | HashCode |
重写
| 编辑本文 查看源代码Peek()
Peek
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public TElement Peek()
返回
类型 | 描述 |
---|---|
TElement | Item |
ToString()
To string
声明
public override string ToString()
返回
类型 | 描述 |
---|---|
string | String |
重写
| 编辑本文 查看源代码TrimExcess()
Trim excess
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void TrimExcess()
TryDequeue(out TElement)
Try dequeue
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TryDequeue(out TElement element)
参数
类型 | 名称 | 描述 |
---|---|---|
TElement | element | Element |
返回
类型 | 描述 |
---|---|
bool | Dequeued |
TryDequeue(out TElement, out TPriority)
Try dequeue
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TryDequeue(out TElement element, out TPriority priority)
参数
类型 | 名称 | 描述 |
---|---|---|
TElement | element | Element |
TPriority | priority | Priority |
返回
类型 | 描述 |
---|---|
bool | Dequeued |
TryDequeueEnqueue(in TElement, in TPriority, out TElement)
Try dequeue enqueue
声明
public bool TryDequeueEnqueue(in TElement element, in TPriority priority, out TElement result)
参数
类型 | 名称 | 描述 |
---|---|---|
TElement | element | Element |
TPriority | priority | Priority |
TElement | result | Element |
返回
类型 | 描述 |
---|---|
bool | Dequeued |
TryEnqueue(in TElement, in TPriority)
Try enqueue
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TryEnqueue(in TElement element, in TPriority priority)
参数
类型 | 名称 | 描述 |
---|---|---|
TElement | element | Element |
TPriority | priority | Priority |
返回
类型 | 描述 |
---|---|
bool | Enqueued |
TryEnqueueDequeue(in TElement, in TPriority, out TElement)
Try enqueue dequeue
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TryEnqueueDequeue(in TElement element, in TPriority priority, out TElement result)
参数
类型 | 名称 | 描述 |
---|---|---|
TElement | element | Element |
TPriority | priority | Priority |
TElement | result | Element |
返回
类型 | 描述 |
---|---|
bool | Enqueued |
TryPeek(out TElement, out TPriority)
Try peek
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TryPeek(out TElement element, out TPriority priority)
参数
类型 | 名称 | 描述 |
---|---|---|
TElement | element | Element |
TPriority | priority | Priority |
返回
类型 | 描述 |
---|---|
bool | Peeked |
运算符
| 编辑本文 查看源代码operator ==(NativePriorityQueue<TElement, TPriority>, NativePriorityQueue<TElement, TPriority>)
Equals
声明
public static bool operator ==(NativePriorityQueue<TElement, TPriority> left, NativePriorityQueue<TElement, TPriority> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativePriorityQueue<TElement, TPriority> | left | Left |
NativePriorityQueue<TElement, TPriority> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Equals |
operator !=(NativePriorityQueue<TElement, TPriority>, NativePriorityQueue<TElement, TPriority>)
Not equals
声明
public static bool operator !=(NativePriorityQueue<TElement, TPriority> left, NativePriorityQueue<TElement, TPriority> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativePriorityQueue<TElement, TPriority> | left | Left |
NativePriorityQueue<TElement, TPriority> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Not equals |