Class VectorOfIntPtr
Wrapped class of the C++ standard vector of IntPtr.
public class VectorOfIntPtr : UnmanagedVector, IDisposable, IAsyncDisposable, ISerializable
- Inheritance
-
VectorOfIntPtr
- Implements
- Inherited Members
Constructors
VectorOfIntPtr()
Create an empty standard vector of IntPtr
public VectorOfIntPtr()
VectorOfIntPtr(int)
Create a standard vector of IntPtr of the specific size
public VectorOfIntPtr(int size)
Parameters
size
intThe size of the vector
VectorOfIntPtr(nint[])
Create a standard vector of IntPtr with the initial values
public VectorOfIntPtr(nint[] values)
Parameters
values
nint[]The initial values
VectorOfIntPtr(SerializationInfo, StreamingContext)
Constructor used to deserialize runtime serialized object
public VectorOfIntPtr(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfoThe serialization info
context
StreamingContextThe streaming context
VectorOfIntPtr(Span<nint>)
Create a standard vector of IntPtr with the initial values
public VectorOfIntPtr(Span<nint> values)
Parameters
Properties
this[int]
Get the item in the specific index
public nint this[int index] { get; }
Parameters
index
intThe index
Property Value
- nint
The item in the specific index
Length
The size of memory in bytes, that is needed to hold all the items in this vector
public override long Length { get; }
Property Value
Size
Get the size of the vector
public override int Size { get; }
Property Value
SizeOfItemInBytes
The size of the item in this Vector, counted as size in bytes.
public static int SizeOfItemInBytes { get; }
Property Value
StartAddress
The pointer to the first element on the vector. In case of an empty vector, IntPtr.Zero will be returned.
public override nint StartAddress { get; }
Property Value
Methods
Clear()
Clear the vector
public void Clear()
DisposeObject()
Release the standard vector
protected override void DisposeObject()
GetObjectData(SerializationInfo, StreamingContext)
A function used for runtime serialization of the object
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfoSerialization info
context
StreamingContextStreaming context
GetSpan()
Returns a memory span that wraps the underlying memory buffer.
public Span<nint> GetSpan()
Returns
Push(VectorOfIntPtr)
Push multiple values from the other vector into this vector
public void Push(VectorOfIntPtr other)
Parameters
other
VectorOfIntPtrThe other vector, from which the values will be pushed to the current vector
Push(nint[])
Push an array of values into the standard vector
public void Push(nint[] values)
Parameters
values
nint[]The values to be pushed to the vector
Push(Span<nint>)
Push an array of values into the standard vector
public void Push(Span<nint> values)
Parameters
ToArray()
Convert the standard vector to an array of IntPtr
public nint[] ToArray()
Returns
- nint[]
An array of IntPtr