SpanMarshaller<T,TUnmanagedElement> Classe

Definição

Importante

Esta API não está em conformidade com CLS.

Dá suporte ao marshalling de um Span<T> valor gerenciado para uma matriz nativa contígua dos valores não gerenciados dos elementos.

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)

Parâmetros de tipo

T

O tipo de elemento gerenciado do intervalo.

TUnmanagedElement

O tipo não gerenciado para os elementos do intervalo.

Herança
SpanMarshaller<T,TUnmanagedElement>
Atributos

Comentários

Um Span<T> marshalled com este marshaller vai corresponder a semântica de GetReference<T>(Span<T>). Em particular, esse marshaller passará um valor diferentenull para um intervalo de comprimento zero se o intervalo tiver sido construído com um valor diferentenull .

Métodos

Nome Description
AllocateContainerForManagedElements(TUnmanagedElement*, Int32)

Aloca espaço para armazenar os elementos gerenciados.

AllocateContainerForUnmanagedElements(Span<T>, Int32)

Aloca o espaço para armazenar os elementos não gerenciados.

Free(TUnmanagedElement*)

Libera a memória não gerenciada alocada.

GetManagedValuesDestination(Span<T>)

Obtém um intervalo do espaço em que os elementos da coleção gerenciada devem ser armazenados.

GetManagedValuesSource(Span<T>)

Obtém um intervalo dos elementos da coleção gerenciada.

GetUnmanagedValuesDestination(TUnmanagedElement*, Int32)

Obtém um intervalo do espaço em que os elementos de coleção não gerenciados devem ser armazenados.

GetUnmanagedValuesSource(TUnmanagedElement*, Int32)

Obtém um intervalo dos elementos nativos da coleção.

Aplica-se a