NativeSortedDictionary<TKey, TValue> 结构
Native dictionary
命名空间: NativeCollections
程序集: Fantasy.Net.dll
语法
[StructLayout(LayoutKind.Sequential)]
public readonly struct NativeSortedDictionary<TKey, TValue> : IDisposable, IEquatable<NativeSortedDictionary<TKey, TValue>> where TKey : unmanaged, IComparable<TKey> where TValue : unmanaged
类型参数
名称 | 描述 |
---|---|
TKey | Type |
TValue | Type |
构造函数
| 编辑本文 查看源代码NativeSortedDictionary(int, int)
Structure
声明
public NativeSortedDictionary(int size, int maxFreeSlabs)
参数
类型 | 名称 | 描述 |
---|---|---|
int | size | MemoryPool size |
int | maxFreeSlabs | MemoryPool maxFreeSlabs |
属性
| 编辑本文 查看源代码Count
Count
声明
public int Count { get; }
属性值
类型 | 描述 |
---|---|
int |
Empty
Empty
声明
public static NativeSortedDictionary<TKey, TValue> Empty { get; }
属性值
类型 | 描述 |
---|---|
NativeSortedDictionary<TKey, TValue> |
IsCreated
Is created
声明
public bool IsCreated { get; }
属性值
类型 | 描述 |
---|---|
bool |
IsEmpty
Is empty
声明
public bool IsEmpty { get; }
属性值
类型 | 描述 |
---|---|
bool |
this[TKey]
Get or set value
声明
public TValue this[in TKey key] { get; set; }
参数
类型 | 名称 | 描述 |
---|---|---|
TKey | key | Key |
属性值
类型 | 描述 |
---|---|
TValue |
Keys
Keys
声明
public NativeSortedDictionary<TKey, TValue>.KeyCollection Keys { get; }
属性值
类型 | 描述 |
---|---|
NativeSortedDictionary<TKey, TValue>.KeyCollection |
Max
Max
声明
public KeyValuePair<TKey, TValue>? Max { get; }
属性值
类型 | 描述 |
---|---|
KeyValuePair<TKey, TValue>? |
Min
Min
声明
public KeyValuePair<TKey, TValue>? Min { get; }
属性值
类型 | 描述 |
---|---|
KeyValuePair<TKey, TValue>? |
Values
Values
声明
public NativeSortedDictionary<TKey, TValue>.ValueCollection Values { get; }
属性值
类型 | 描述 |
---|---|
NativeSortedDictionary<TKey, TValue>.ValueCollection |
方法
| 编辑本文 查看源代码Add(in TKey, in TValue)
Add
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Add(in TKey key, in TValue value)
参数
类型 | 名称 | 描述 |
---|---|---|
TKey | key | Key |
TValue | value | Value |
返回
类型 | 描述 |
---|---|
bool | Added |
Clear()
Clear
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Clear()
ContainsKey(in TKey)
Contains key
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool ContainsKey(in TKey key)
参数
类型 | 名称 | 描述 |
---|---|---|
TKey | key | Key |
返回
类型 | 描述 |
---|---|
bool | Contains key |
Dispose()
Dispose
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Dispose()
Equals(NativeSortedDictionary<TKey, TValue>)
Equals
声明
public bool Equals(NativeSortedDictionary<TKey, TValue> other)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeSortedDictionary<TKey, TValue> | other | Other |
返回
类型 | 描述 |
---|---|
bool | Equals |
Equals(object?)
Equals
声明
public override bool Equals(object? obj)
参数
类型 | 名称 | 描述 |
---|---|---|
object | obj | object |
返回
类型 | 描述 |
---|---|
bool | Equals |
重写
| 编辑本文 查看源代码GetEnumerator()
Get enumerator
声明
public NativeSortedDictionary<TKey, TValue>.Enumerator GetEnumerator()
返回
类型 | 描述 |
---|---|
NativeSortedDictionary<TKey, TValue>.Enumerator | Enumerator |
GetHashCode()
Get hashCode
声明
public override int GetHashCode()
返回
类型 | 描述 |
---|---|
int | HashCode |
重写
| 编辑本文 查看源代码Remove(in TKey)
Remove
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Remove(in TKey key)
参数
类型 | 名称 | 描述 |
---|---|---|
TKey | key | Key |
返回
类型 | 描述 |
---|---|
bool | Removed |
Remove(in TKey, out TValue)
Remove
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Remove(in TKey key, out TValue value)
参数
类型 | 名称 | 描述 |
---|---|---|
TKey | key | Key |
TValue | value | Value |
返回
类型 | 描述 |
---|---|
bool | Removed |
ToString()
To string
声明
public override string ToString()
返回
类型 | 描述 |
---|---|
string | String |
重写
| 编辑本文 查看源代码TryGetValue(in TKey, out TValue)
Try to get the actual value
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TryGetValue(in TKey key, out TValue value)
参数
类型 | 名称 | 描述 |
---|---|---|
TKey | key | Key |
TValue | value | Value |
返回
类型 | 描述 |
---|---|
bool | Got |
运算符
| 编辑本文 查看源代码operator ==(NativeSortedDictionary<TKey, TValue>, NativeSortedDictionary<TKey, TValue>)
Equals
声明
public static bool operator ==(NativeSortedDictionary<TKey, TValue> left, NativeSortedDictionary<TKey, TValue> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeSortedDictionary<TKey, TValue> | left | Left |
NativeSortedDictionary<TKey, TValue> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Equals |
operator !=(NativeSortedDictionary<TKey, TValue>, NativeSortedDictionary<TKey, TValue>)
Not equals
声明
public static bool operator !=(NativeSortedDictionary<TKey, TValue> left, NativeSortedDictionary<TKey, TValue> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeSortedDictionary<TKey, TValue> | left | Left |
NativeSortedDictionary<TKey, TValue> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Not equals |