SpanMarshaller<T,TUnmanagedElement> Klasa
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Ważne
Ten interfejs API nie jest zgodny ze specyfikacją CLS.
Obsługuje marshalling a from managed value to a contiguous native array of the unmanaged values of the elements ( Obsługuje marshalling a Span<T> from managed value to a contiguous native array of the unmanaged values of the elements.
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)
Parametry typu
- T
Typ elementu zarządzanego zakresu.
- TUnmanagedElement
Niezarządzany typ dla elementów zakresu.
- Dziedziczenie
-
SpanMarshaller<T,TUnmanagedElement>
- Atrybuty
Uwagi
Marshalled Span<T> z tym marshaller będzie pasował do semantyki .GetReference<T>(Span<T>)
W szczególności ten marshaller przekaże wartość innąnull
niż zakres o zerowej długości, jeśli zakres został skonstruowany z wartością innąnull
niż.
Metody
AllocateContainerForManagedElements(TUnmanagedElement*, Int32) |
Przydziela miejsce do przechowywania elementów zarządzanych. |
AllocateContainerForUnmanagedElements(Span<T>, Int32) |
Przydziela miejsce do przechowywania niezarządzanych elementów. |
Free(TUnmanagedElement*) |
Zwalnia przydzieloną pamięć niezarządzaną. |
GetManagedValuesDestination(Span<T>) |
Pobiera zakres przestrzeni, w której powinny być przechowywane elementy kolekcji zarządzanej. |
GetManagedValuesSource(Span<T>) |
Pobiera zakres elementów kolekcji zarządzanej. |
GetUnmanagedValuesDestination(TUnmanagedElement*, Int32) |
Pobiera zakres miejsca, w którym powinny być przechowywane niezarządzane elementy kolekcji. |
GetUnmanagedValuesSource(TUnmanagedElement*, Int32) |
Pobiera zakres elementów kolekcji natywnej. |