NativeConcurrentHashSet<T> 结构
Native concurrentHashSet (Slower than ConcurrentHashSet)
命名空间: NativeCollections
程序集: Fantasy.Net.dll
语法
[StructLayout(LayoutKind.Sequential)]
public readonly struct NativeConcurrentHashSet<T> : IDisposable, IEquatable<NativeConcurrentHashSet<T>> where T : unmanaged, IEquatable<T>
类型参数
名称 | 描述 |
---|---|
T | Type |
构造函数
| 编辑本文 查看源代码NativeConcurrentHashSet(int, int, int, int, bool)
Structure
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public NativeConcurrentHashSet(int size, int maxFreeSlabs, int concurrencyLevel, int capacity, bool growLockArray)
参数
类型 | 名称 | 描述 |
---|---|---|
int | size | Size |
int | maxFreeSlabs | Max free slabs |
int | concurrencyLevel | Concurrency level |
int | capacity | Capacity |
bool | growLockArray | Grow lock array |
属性
| 编辑本文 查看源代码Count
Count
声明
public int Count { get; }
属性值
类型 | 描述 |
---|---|
int |
Empty
Empty
声明
public static NativeConcurrentHashSet<T> Empty { get; }
属性值
类型 | 描述 |
---|---|
NativeConcurrentHashSet<T> |
IsCreated
Is created
声明
public bool IsCreated { get; }
属性值
类型 | 描述 |
---|---|
bool |
IsEmpty
Is created
声明
public bool IsEmpty { get; }
属性值
类型 | 描述 |
---|---|
bool |
方法
| 编辑本文 查看源代码Add(in T)
Add
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Add(in T key)
参数
类型 | 名称 | 描述 |
---|---|---|
T | key | Key |
返回
类型 | 描述 |
---|---|
bool | Added |
Clear()
Clear
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Clear()
Contains(in T)
Contains key
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Contains(in T key)
参数
类型 | 名称 | 描述 |
---|---|---|
T | key | Key |
返回
类型 | 描述 |
---|---|
bool | Contains key |
Dispose()
Dispose
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Dispose()
Equals(NativeConcurrentHashSet<T>)
Equals
声明
public bool Equals(NativeConcurrentHashSet<T> other)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeConcurrentHashSet<T> | other | Other |
返回
类型 | 描述 |
---|---|
bool | Equals |
Equals(object?)
Equals
声明
public override bool Equals(object? obj)
参数
类型 | 名称 | 描述 |
---|---|---|
object | obj | object |
返回
类型 | 描述 |
---|---|
bool | Equals |
重写
| 编辑本文 查看源代码GetEnumerator()
Get enumerator
声明
public NativeConcurrentHashSet<T>.Enumerator GetEnumerator()
返回
类型 | 描述 |
---|---|
NativeConcurrentHashSet<T>.Enumerator | Enumerator |
GetHashCode()
Get hashCode
声明
public override int GetHashCode()
返回
类型 | 描述 |
---|---|
int | HashCode |
重写
| 编辑本文 查看源代码Remove(in T)
Remove
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Remove(in T key)
参数
类型 | 名称 | 描述 |
---|---|---|
T | key | Key |
返回
类型 | 描述 |
---|---|
bool | Removed |
ToString()
To string
声明
public override string ToString()
返回
类型 | 描述 |
---|---|
string | String |
重写
| 编辑本文 查看源代码TryGetValue(in T, out T)
Try to get the actual value
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TryGetValue(in T equalValue, out T actualValue)
参数
类型 | 名称 | 描述 |
---|---|---|
T | equalValue | Equal value |
T | actualValue | Actual value |
返回
类型 | 描述 |
---|---|
bool | Got |
运算符
| 编辑本文 查看源代码operator ==(NativeConcurrentHashSet<T>, NativeConcurrentHashSet<T>)
Equals
声明
public static bool operator ==(NativeConcurrentHashSet<T> left, NativeConcurrentHashSet<T> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeConcurrentHashSet<T> | left | Left |
NativeConcurrentHashSet<T> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Equals |
operator !=(NativeConcurrentHashSet<T>, NativeConcurrentHashSet<T>)
Not equals
声明
public static bool operator !=(NativeConcurrentHashSet<T> left, NativeConcurrentHashSet<T> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeConcurrentHashSet<T> | left | Left |
NativeConcurrentHashSet<T> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Not equals |