NativeList<T> 结构
Native list
命名空间: NativeCollections
程序集: Fantasy.Net.dll
语法
[StructLayout(LayoutKind.Sequential)]
public readonly struct NativeList<T> : IDisposable, IEquatable<NativeList<T>> where T : unmanaged, IEquatable<T>
类型参数
名称 | 描述 |
---|---|
T | Type |
构造函数
| 编辑本文 查看源代码NativeList(int)
Structure
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public NativeList(int capacity)
参数
类型 | 名称 | 描述 |
---|---|---|
int | capacity | Capacity |
属性
| 编辑本文 查看源代码Capacity
Capacity
声明
public int Capacity { get; set; }
属性值
类型 | 描述 |
---|---|
int |
Count
Count
声明
public int Count { get; }
属性值
类型 | 描述 |
---|---|
int |
Empty
Empty
声明
public static NativeList<T> Empty { get; }
属性值
类型 | 描述 |
---|---|
NativeList<T> |
IsCreated
Is created
声明
public bool IsCreated { get; }
属性值
类型 | 描述 |
---|---|
bool |
IsEmpty
Is empty
声明
public bool IsEmpty { get; }
属性值
类型 | 描述 |
---|---|
bool |
this[int]
Get or set value
声明
public ref T this[int index] { get; }
参数
类型 | 名称 | 描述 |
---|---|---|
int | index | Index |
属性值
类型 | 描述 |
---|---|
T |
this[uint]
Get or set value
声明
public ref T this[uint index] { get; }
参数
类型 | 名称 | 描述 |
---|---|---|
uint | index | Index |
属性值
类型 | 描述 |
---|---|
T |
方法
| 编辑本文 查看源代码Add(in T)
Add
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Add(in T item)
参数
类型 | 名称 | 描述 |
---|---|---|
T | item | Item |
AddRange(in NativeList<T>)
Add range
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void AddRange(in NativeList<T> collection)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeList<T> | collection | Collection |
AsReadOnlySpan()
As readOnly span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ReadOnlySpan<T> AsReadOnlySpan()
返回
类型 | 描述 |
---|---|
ReadOnlySpan<T> | ReadOnlySpan |
AsReadOnlySpan(int)
As readOnly span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ReadOnlySpan<T> AsReadOnlySpan(int length)
参数
类型 | 名称 | 描述 |
---|---|---|
int | length | Length |
返回
类型 | 描述 |
---|---|
ReadOnlySpan<T> | ReadOnlySpan |
AsReadOnlySpan(int, int)
As readOnly span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ReadOnlySpan<T> AsReadOnlySpan(int start, int length)
参数
类型 | 名称 | 描述 |
---|---|---|
int | start | Start |
int | length | Length |
返回
类型 | 描述 |
---|---|
ReadOnlySpan<T> | ReadOnlySpan |
AsSpan()
As span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan()
返回
类型 | 描述 |
---|---|
Span<T> | Span |
AsSpan(int)
As span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan(int length)
参数
类型 | 名称 | 描述 |
---|---|---|
int | length | Length |
返回
类型 | 描述 |
---|---|
Span<T> | Span |
AsSpan(int, int)
As span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<T> AsSpan(int start, int length)
参数
类型 | 名称 | 描述 |
---|---|---|
int | start | Start |
int | length | Length |
返回
类型 | 描述 |
---|---|
Span<T> | Span |
Clear()
Clear
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Clear()
Contains(in T)
Contains
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Contains(in T item)
参数
类型 | 名称 | 描述 |
---|---|---|
T | item | Item |
返回
类型 | 描述 |
---|---|
bool | Contains |
Dispose()
Dispose
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Dispose()
EnsureCapacity(int)
Ensure capacity
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int EnsureCapacity(int capacity)
参数
类型 | 名称 | 描述 |
---|---|---|
int | capacity | Capacity |
返回
类型 | 描述 |
---|---|
int | New capacity |
Equals(NativeList<T>)
Equals
声明
public bool Equals(NativeList<T> other)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeList<T> | other | Other |
返回
类型 | 描述 |
---|---|
bool | Equals |
Equals(object?)
Equals
声明
public override bool Equals(object? obj)
参数
类型 | 名称 | 描述 |
---|---|---|
object | obj | object |
返回
类型 | 描述 |
---|---|
bool | Equals |
重写
| 编辑本文 查看源代码GetEnumerator()
Get enumerator
声明
public NativeList<T>.Enumerator GetEnumerator()
返回
类型 | 描述 |
---|---|
NativeList<T>.Enumerator | Enumerator |
GetHashCode()
Get hashCode
声明
public override int GetHashCode()
返回
类型 | 描述 |
---|---|
int | HashCode |
重写
| 编辑本文 查看源代码IndexOf(in T)
Index of
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int IndexOf(in T item)
参数
类型 | 名称 | 描述 |
---|---|---|
T | item | Item |
返回
类型 | 描述 |
---|---|
int | Index |
IndexOf(in T, int)
Index of
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int IndexOf(in T item, int index)
参数
类型 | 名称 | 描述 |
---|---|---|
T | item | Item |
int | index | Index |
返回
类型 | 描述 |
---|---|
int | Index |
IndexOf(in T, int, int)
Index of
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int IndexOf(in T item, int index, int count)
参数
类型 | 名称 | 描述 |
---|---|---|
T | item | Item |
int | index | Index |
int | count | Count |
返回
类型 | 描述 |
---|---|
int | Index |
Insert(int, in T)
Insert
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Insert(int index, in T item)
参数
类型 | 名称 | 描述 |
---|---|---|
int | index | Index |
T | item | Item |
InsertRange(int, in NativeList<T>)
Insert
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void InsertRange(int index, in NativeList<T> collection)
参数
类型 | 名称 | 描述 |
---|---|---|
int | index | Index |
NativeList<T> | collection | Collection |
LastIndexOf(in T)
Last index of
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int LastIndexOf(in T item)
参数
类型 | 名称 | 描述 |
---|---|---|
T | item | Item |
返回
类型 | 描述 |
---|---|
int | Index |
LastIndexOf(in T, int)
Last index of
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int LastIndexOf(in T item, int index)
参数
类型 | 名称 | 描述 |
---|---|---|
T | item | Item |
int | index | Index |
返回
类型 | 描述 |
---|---|
int | Index |
LastIndexOf(in T, int, int)
Last index of
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int LastIndexOf(in T item, int index, int count)
参数
类型 | 名称 | 描述 |
---|---|---|
T | item | Item |
int | index | Index |
int | count | Count |
返回
类型 | 描述 |
---|---|
int | Index |
Remove(in T)
Remove
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Remove(in T item)
参数
类型 | 名称 | 描述 |
---|---|---|
T | item | Item |
返回
类型 | 描述 |
---|---|
bool | Removed |
RemoveAt(int)
Remove at
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void RemoveAt(int index)
参数
类型 | 名称 | 描述 |
---|---|---|
int | index | Index |
RemoveRange(int, int)
Remove range
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void RemoveRange(int index, int count)
参数
类型 | 名称 | 描述 |
---|---|---|
int | index | Index |
int | count | Count |
Reverse()
Reverse
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Reverse()
Reverse(int, int)
Reverse
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Reverse(int index, int count)
参数
类型 | 名称 | 描述 |
---|---|---|
int | index | Index |
int | count | Count |
ToString()
To string
声明
public override string ToString()
返回
类型 | 描述 |
---|---|
string | String |
重写
| 编辑本文 查看源代码TrimExcess()
Trim excess
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int TrimExcess()
返回
类型 | 描述 |
---|---|
int | New capacity |
运算符
| 编辑本文 查看源代码operator ==(NativeList<T>, NativeList<T>)
Equals
声明
public static bool operator ==(NativeList<T> left, NativeList<T> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeList<T> | left | Left |
NativeList<T> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Equals |
implicit operator ReadOnlySpan<T>(NativeList<T>)
As readOnly span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(NativeList<T> nativeList)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeList<T> | nativeList |
返回
类型 | 描述 |
---|---|
ReadOnlySpan<T> | ReadOnlySpan |
implicit operator Span<T>(NativeList<T>)
As span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator Span<T>(NativeList<T> nativeList)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeList<T> | nativeList |
返回
类型 | 描述 |
---|---|
Span<T> | Span |
operator !=(NativeList<T>, NativeList<T>)
Not equals
声明
public static bool operator !=(NativeList<T> left, NativeList<T> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeList<T> | left | Left |
NativeList<T> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Not equals |