SpanMarshaller<T,TUnmanagedElement> Classe

Definição

Importante

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

Suporta o marshalling de Span<T> um valor gerido para um array nativo contíguo dos valores não geridos 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 Genérico

T

O tipo de elemento gerido do vão.

TUnmanagedElement

O tipo não controlado para os elementos do vão.

Herança
SpanMarshaller<T,TUnmanagedElement>
Atributos

Observações

Um Span<T> marshalled com este marshaller irá corresponder à semântica de GetReference<T>(Span<T>). Em particular, este marshaller passará um não-valornull para um vão de comprimento zero se o vão foi construído com um não-valornull .

Métodos

Name Description
AllocateContainerForManagedElements(TUnmanagedElement*, Int32)

Aloca espaço para armazenar os elementos geridos.

AllocateContainerForUnmanagedElements(Span<T>, Int32)

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

Free(TUnmanagedElement*)

Liberta a memória não gerida alocada.

GetManagedValuesDestination(Span<T>)

Obtém um espaço do espaço onde os elementos da coleção gerida devem ser armazenados.

GetManagedValuesSource(Span<T>)

Obtém uma visão geral dos elementos de recolha gerida.

GetUnmanagedValuesDestination(TUnmanagedElement*, Int32)

Obtém um espaço do espaço onde os elementos da coleção não gerida devem ser armazenados.

GetUnmanagedValuesSource(TUnmanagedElement*, Int32)

Obtém uma abrangência dos elementos nativos da coleção.

Aplica-se a