NativeArray<T> 结构
Native array
命名空间: NativeCollections
程序集: Fantasy.Net.dll
语法
[StructLayout(LayoutKind.Sequential)]
public readonly struct NativeArray<T> : IDisposable, IEquatable<NativeArray<T>> where T : unmanaged
类型参数
名称 | 描述 |
---|---|
T | Type |
构造函数
| 编辑本文 查看源代码NativeArray(int)
Structure
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public NativeArray(int length)
参数
类型 | 名称 | 描述 |
---|---|---|
int | length | Length |
NativeArray(int, bool)
Structure
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public NativeArray(int length, bool zeroed)
参数
类型 | 名称 | 描述 |
---|---|---|
int | length | Length |
bool | zeroed | Zeroed |
NativeArray(T*, int)
Structure
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public NativeArray(T* array, int length)
参数
类型 | 名称 | 描述 |
---|---|---|
T* | array | Array |
int | length | Length |
属性
| 编辑本文 查看源代码Array
Array
声明
public T* Array { get; }
属性值
类型 | 描述 |
---|---|
T* |
Empty
Empty
声明
public static NativeArray<T> Empty { get; }
属性值
类型 | 描述 |
---|---|
NativeArray<T> |
IsCreated
Is created
声明
public bool IsCreated { get; }
属性值
类型 | 描述 |
---|---|
bool |
IsEmpty
Is empty
声明
public bool IsEmpty { get; }
属性值
类型 | 描述 |
---|---|
bool |
this[int]
Get reference
声明
public ref T this[int index] { get; }
参数
类型 | 名称 | 描述 |
---|---|---|
int | index | Index |
属性值
类型 | 描述 |
---|---|
T |
this[uint]
Get reference
声明
public ref T this[uint index] { get; }
参数
类型 | 名称 | 描述 |
---|---|---|
uint | index | Index |
属性值
类型 | 描述 |
---|---|
T |
Length
Length
声明
public int Length { get; }
属性值
类型 | 描述 |
---|---|
int |
方法
| 编辑本文 查看源代码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()
Dispose()
Dispose
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Dispose()
Equals(NativeArray<T>)
Equals
声明
public bool Equals(NativeArray<T> other)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeArray<T> | other | Other |
返回
类型 | 描述 |
---|---|
bool | Equals |
Equals(object?)
Equals
声明
public override bool Equals(object? obj)
参数
类型 | 名称 | 描述 |
---|---|---|
object | obj | object |
返回
类型 | 描述 |
---|---|
bool | Equals |
重写
| 编辑本文 查看源代码GetEnumerator()
Get enumerator
声明
public NativeArray<T>.Enumerator GetEnumerator()
返回
类型 | 描述 |
---|---|
NativeArray<T>.Enumerator | Enumerator |
GetHashCode()
Get hashCode
声明
public override int GetHashCode()
返回
类型 | 描述 |
---|---|
int | HashCode |
重写
| 编辑本文 查看源代码ToString()
To string
声明
public override string ToString()
返回
类型 | 描述 |
---|---|
string | String |
重写
运算符
| 编辑本文 查看源代码operator ==(NativeArray<T>, NativeArray<T>)
Equals
声明
public static bool operator ==(NativeArray<T> left, NativeArray<T> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeArray<T> | left | Left |
NativeArray<T> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Equals |
implicit operator ReadOnlySpan<T>(NativeArray<T>)
As readOnly span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(NativeArray<T> nativeArray)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeArray<T> | nativeArray |
返回
类型 | 描述 |
---|---|
ReadOnlySpan<T> | ReadOnlySpan |
implicit operator Span<T>(NativeArray<T>)
As span
声明
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator Span<T>(NativeArray<T> nativeArray)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeArray<T> | nativeArray |
返回
类型 | 描述 |
---|---|
Span<T> | Span |
operator !=(NativeArray<T>, NativeArray<T>)
Not equals
声明
public static bool operator !=(NativeArray<T> left, NativeArray<T> right)
参数
类型 | 名称 | 描述 |
---|---|---|
NativeArray<T> | left | Left |
NativeArray<T> | right | Right |
返回
类型 | 描述 |
---|---|
bool | Not equals |