SpanMarshaller<T,TUnmanagedElement> クラス

定義

重要

この API は CLS 準拠ではありません。

マネージド値から要素のアンマネージ値の連続したネイティブ配列への Span<T> のマーシャリングをサポートします。

generic <typename T, typename TUnmanagedElement>
 where TUnmanagedElement : value classpublic ref class SpanMarshaller abstract sealed
[System.CLSCompliant(false)]
[System.Runtime.InteropServices.Marshalling.ContiguousCollectionMarshaller]
[System.Runtime.InteropServices.Marshalling.CustomMarshaller(typeof(System.Span<>), System.Runtime.InteropServices.Marshalling.MarshalMode.Default, typeof(System.Runtime.InteropServices.Marshalling.SpanMarshaller<,>))]
[System.Runtime.InteropServices.Marshalling.CustomMarshaller(typeof(System.Span<>), System.Runtime.InteropServices.Marshalling.MarshalMode.ManagedToUnmanagedIn, typeof(System.Runtime.InteropServices.Marshalling.SpanMarshaller<,>+ManagedToUnmanagedIn))]
public static class SpanMarshaller<T,TUnmanagedElement> where TUnmanagedElement : struct
[<System.CLSCompliant(false)>]
[<System.Runtime.InteropServices.Marshalling.ContiguousCollectionMarshaller>]
[<System.Runtime.InteropServices.Marshalling.CustomMarshaller(typeof(System.Span<>), System.Runtime.InteropServices.Marshalling.MarshalMode.Default, typeof(System.Runtime.InteropServices.Marshalling.SpanMarshaller<,>))>]
[<System.Runtime.InteropServices.Marshalling.CustomMarshaller(typeof(System.Span<>), System.Runtime.InteropServices.Marshalling.MarshalMode.ManagedToUnmanagedIn, typeof(System.Runtime.InteropServices.Marshalling.SpanMarshaller<,>+ManagedToUnmanagedIn))>]
type SpanMarshaller<'T, 'UnmanagedElement (requires 'UnmanagedElement : struct)> = class
Public Class SpanMarshaller(Of T, TUnmanagedElement)

型パラメーター

T

スパンのマネージド要素の型。

TUnmanagedElement

スパンの要素のアンマネージ型。

継承
SpanMarshaller<T,TUnmanagedElement>
属性

注釈

このマーシャラーでマーシャリングされた Span<T> は、 GetReference<T>(Span<T>)のセマンティクスと一致します。 特に、スパンがnull以外の値で構築された場合、このマーシャラーは長さ 0 のスパンに対してnull以外の値を渡します。

メソッド

名前 説明
AllocateContainerForManagedElements(TUnmanagedElement*, Int32)

マネージド要素を格納する領域を割り当てます。

AllocateContainerForUnmanagedElements(Span<T>, Int32)

アンマネージ要素を格納する領域を割り当てます。

Free(TUnmanagedElement*)

割り当てられたアンマネージ メモリを解放します。

GetManagedValuesDestination(Span<T>)

マネージド コレクション要素を格納する必要がある領域のスパンを取得します。

GetManagedValuesSource(Span<T>)

マネージド コレクション要素のスパンを取得します。

GetUnmanagedValuesDestination(TUnmanagedElement*, Int32)

アンマネージ コレクション要素を格納する必要がある領域のスパンを取得します。

GetUnmanagedValuesSource(TUnmanagedElement*, Int32)

ネイティブ コレクション要素のスパンを取得します。

適用対象