Show / Hide Table of Contents

Interface IUnmanagedArray<T>

Provides access to the array allocated in the unmanaged memory.

Inherited Members
IUnmanagedMemory.Size
IUnmanagedMemory.Clear()
IUnmanagedMemory.Bytes
IUnmanagedMemory.AsStream()
IUnmanagedMemory.WriteTo(Stream)
IUnmanagedMemory.WriteToAsync(Stream, CancellationToken)
IUnmanagedMemory.ReadFrom(Stream)
IUnmanagedMemory.ReadFromAsync(Stream, CancellationToken)
IUnmanagedMemory.WriteTo(Pointer<Byte>)
IUnmanagedMemory.ReadFrom(Pointer<Byte>)
IUnmanagedMemory.BitwiseEquals(IUnmanagedMemory)
IUnmanagedMemory.BitwiseCompare(IUnmanagedMemory)
IDisposable.Dispose()
IEnumerable<T>.GetEnumerator()
ICloneable.Clone()
Namespace: DotNext.Runtime.InteropServices
Assembly: DotNext.Unsafe.dll
Syntax
public interface IUnmanagedArray<T> : IUnmanagedMemory, IDisposable, IConvertible<Stream>, IEnumerable<T>, IEnumerable, ICloneable, IConvertible<T[]> where T : struct
Type Parameters
Name Description
T

The type of the array elements.

Properties

| Improve this Doc View Source

Item[Int32]

Gets element of the unmanaged array.

Declaration
virtual T this[int index] { get; }
Parameters
Type Name Description
Int32 index

The index of the element to get.

Property Value
Type Description
T

The pointer to the array element.

Exceptions
Type Condition
IndexOutOfRangeException

index is out of range.

| Improve this Doc View Source

Length

Gets the number of elements in the unmanaged memory.

Declaration
int Length { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Pointer

Gets a pointer to the allocated unmanaged memory.

Declaration
Pointer<T> Pointer { get; }
Property Value
Type Description
Pointer<T>
| Improve this Doc View Source

Span

Gets a span from the current instance.

Declaration
Span<T> Span { get; }
Property Value
Type Description
Span<T>

Methods

| Improve this Doc View Source

BitwiseCompare(T[])

Bitwise comparison of the memory blocks.

Declaration
virtual int BitwiseCompare(T[] other)
Parameters
Type Name Description
T[] other

The array to be compared.

Returns
Type Description
Int32

Comparison result which has the semantics as return type of CompareTo(Object).

Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

| Improve this Doc View Source

BitwiseCompare(Pointer<T>)

Bitwise comparison of the memory blocks.

Declaration
virtual int BitwiseCompare(Pointer<T> other)
Parameters
Type Name Description
Pointer<T> other

The block of memory to be compared.

Returns
Type Description
Int32

Comparison result which has the semantics as return type of CompareTo(Object).

Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

| Improve this Doc View Source

BitwiseEquals(T[])

Computes bitwise equality between this array and the specified managed array.

Declaration
virtual bool BitwiseEquals(T[] other)
Parameters
Type Name Description
T[] other

The array to be compared.

Returns
Type Description
Boolean

true, if both memory blocks have the same bytes; otherwise, false.

Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

| Improve this Doc View Source

BitwiseEquals(Pointer<T>)

Computes bitwise equality between two blocks of memory.

Declaration
virtual bool BitwiseEquals(Pointer<T> other)
Parameters
Type Name Description
Pointer<T> other

The block of memory to be compared.

Returns
Type Description
Boolean

true, if both memory blocks have the same bytes; otherwise, false.

Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

| Improve this Doc View Source

ReadFrom(T[])

Copies elements from the memory location to the managed array.

Declaration
virtual long ReadFrom(T[] source)
Parameters
Type Name Description
T[] source

The source array.

Returns
Type Description
Int64

The actual number of copied elements.

Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

| Improve this Doc View Source

ReadFrom(T[], Int64, Int64)

Copies elements from the specified array into the memory block identified by this object.

Declaration
virtual long ReadFrom(T[] source, long offset, long count)
Parameters
Type Name Description
T[] source

The source array.

Int64 offset

The position in the source array from which copying begins.

Int64 count

The number of elements of type T to be copied.

Returns
Type Description
Int64

Actual number of copied elements.

Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

| Improve this Doc View Source

ReadFrom(Pointer<T>)

Copies bytes from the source memory to the memory identified by this object.

Declaration
virtual void ReadFrom(Pointer<T> source)
Parameters
Type Name Description
Pointer<T> source

The pointer to the source unmanaged memory.

Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

| Improve this Doc View Source

ToArray()

Copies elements from the unmanaged array into managed heap.

Declaration
virtual T[] ToArray()
Returns
Type Description
T[]

The array allocated in managed heap containing copied elements from unmanaged memory.

Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

| Improve this Doc View Source

WriteTo(T[])

Copies elements from the memory location to the managed array.

Declaration
virtual long WriteTo(T[] destination)
Parameters
Type Name Description
T[] destination

The destination array.

Returns
Type Description
Int64

The actual number of copied elements.

Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

| Improve this Doc View Source

WriteTo(T[], Int64, Int64)

Copies elements from the memory location to the managed array.

Declaration
virtual long WriteTo(T[] destination, long offset, long count)
Parameters
Type Name Description
T[] destination

The destination array.

Int64 offset

The position in the destination array from which copying begins.

Int64 count

The number of array elements to be copied.

Returns
Type Description
Int64

The actual number of copied elements.

Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

| Improve this Doc View Source

WriteTo(IUnmanagedArray<T>)

Copies elements from the current memory location to the specified memory location.

Declaration
virtual long WriteTo(IUnmanagedArray<T> destination)
Parameters
Type Name Description
IUnmanagedArray<T> destination

The target memory location.

Returns
Type Description
Int64

The actual number of copied elements.

Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

| Improve this Doc View Source

WriteTo(Pointer<T>)

Copies elements from the current memory location to the specified memory location.

Declaration
virtual void WriteTo(Pointer<T> destination)
Parameters
Type Name Description
Pointer<T> destination

The target memory location.

Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

Extension Methods

AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, CancellationToken)
ObjectExtensions.GetUserData<T>(T)
ObjectExtensions.IsOneOf<T>(T, IEnumerable<T>)
ObjectExtensions.IsOneOf<T>(T, T[])
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>)
ObjectExtensions.As<T>(T)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
Sequence.ToAsyncEnumerable<T>(IEnumerable<T>)
Sequence.GetAsyncEnumerator<T>(IEnumerable<T>, CancellationToken)
Sequence.ForEach<T>(IEnumerable<T>, Action<T>)
Sequence.ForEach<T>(IEnumerable<T>, ValueAction<T>)
Sequence.ForEachAsync<T>(IEnumerable<T>, Func<T, CancellationToken, ValueTask>, CancellationToken)
Sequence.ForEachAsync<T>(IEnumerable<T>, ValueFunc<T, CancellationToken, ValueTask>, CancellationToken)
Sequence.FirstOrNull<T>(IEnumerable<T>)
Sequence.FirstOrEmpty<T>(IEnumerable<T>)
Sequence.FirstOrEmpty<T>(IEnumerable<T>, ValueFunc<T, Boolean>)
Sequence.FirstOrEmpty<T>(IEnumerable<T>, Predicate<T>)
Sequence.ElementAt<T>(IEnumerable<T>, Int32, out T)
Sequence.ToString<T>(IEnumerable<T>, String, String)
Sequence.Prepend<T>(IEnumerable<T>, T[])
Sequence.Append<T>(IEnumerable<T>, T[])
ExpressionBuilder.Const<T>(T)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX