NativeConcurrentStack<T> 结构
Native concurrentStack (Slower than ConcurrentStack, disable Enumerator, try peek, push/pop range either)
命名空间: NativeCollections
程序集: Fantasy.Net.dll
语法
[StructLayout(LayoutKind.Sequential)]
public readonly struct NativeConcurrentStack<T> : IDisposable, IEquatable<NativeConcurrentStack<T>> where T : unmanaged
类型参数
名称 | 描述 |
---|---|
T | Type |
构造函数
| 编辑本文 查看源代码NativeConcurrentStack(int, int)
Structure
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public NativeConcurrentStack(int size, int maxFreeSlabs)
参数
类型 | 名称 | 描述 |
---|---|---|
int | size | Size |
int | maxFreeSlabs | Max free slabs |
属性
| 编辑本文 查看源代码Count
Count
声明
public int Count { get; }
属性值
类型 | 描述 |
---|---|
int |
Empty
Empty
声明
public static NativeConcurrentStack<T> Empty { get; }
属性值
类型 | 描述 |
---|---|
NativeConcurrentStack<T> |
IsCreated
Is created
声明
public bool IsCreated { get; }
属性值
类型 | 描述 |
---|---|
bool |
IsEmpty
IsEmpty
声明
public bool IsEmpty { get; }
属性值
类型 | 描述 |
---|---|
bool |
方法
| 编辑本文 查看源代码Clear()
Clear
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Clear()
Dispose()
Dispose
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Dispose()
Equals(NativeConcurrentStack<T>)
Equals
声明
public bool Equals(NativeConcurrentStack<T> other)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeConcurrentStack<T> | 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 |
重写
| 编辑本文 查看源代码Push(in T)
Push
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Push(in T item)
参数
类型 | 名称 | 描述 |
---|---|---|
T | item | Item |
ToString()
To string
声明
public override string ToString()
返回
类型 | 描述 |
---|---|
string | String |
重写
| 编辑本文 查看源代码TryPop(out T)
Try pop
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool TryPop(out T result)
参数
类型 | 名称 | 描述 |
---|---|---|
T | result | Item |
返回
类型 | 描述 |
---|---|
bool | Popped |
运算符
| 编辑本文 查看源代码operator ==(NativeConcurrentStack<T>, NativeConcurrentStack<T>)
Equals
声明
public static bool operator ==(NativeConcurrentStack<T> left, NativeConcurrentStack<T> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeConcurrentStack<T> | left | Left |
NativeConcurrentStack<T> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Equals |
operator !=(NativeConcurrentStack<T>, NativeConcurrentStack<T>)
Not equals
声明
public static bool operator !=(NativeConcurrentStack<T> left, NativeConcurrentStack<T> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeConcurrentStack<T> | left | Left |
NativeConcurrentStack<T> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Not equals |