Struct UnsafePtrList<T>
An unmanaged, resizable list of pointers.
Implements
Namespace: Unity.Collections.LowLevel.Unsafe
Assembly: solution.dll
Syntax
public struct UnsafePtrList<T> : INativeDisposable where T : unmanaged
Type Parameters
Name | Description |
---|---|
T | The type of pointer element. |
Constructors
Name | Description |
---|---|
UnsafePtrList(int, AllocatorHandle, NativeArrayOptions) | Initializes and returns an instance of UnsafePtrList. |
UnsafePtrList(T**, int) | Initializes and returns an instance of UnsafePtrList. |
Fields
Name | Description |
---|---|
Allocator | The allocator used to create the internal buffer. |
Ptr | The internal buffer of this list. |
m_capacity | The number of elements that can fit in the internal buffer. |
m_length | The number of elements. |
Properties
Name | Description |
---|---|
Capacity | The number of elements that can fit in the internal buffer. |
IsCreated | Whether this list has been allocated (and not yet deallocated). |
IsEmpty | Whether the list is empty. |
this[int] | The element at an index. |
Length | The number of elements. |
Methods
Name | Description |
---|---|
Add(in IntPtr) | Adds a pointer to the end of the list. |
Add(void*) | Adds a pointer to the end of the list. |
AddNoResize(void*) | Adds a pointer to the end of this list. |
AddRange(void*, int) | Adds elements from a buffer to this list. |
AddRange(UnsafePtrList<T>) | Copies the elements of another list to the end of this list. |
AddRangeNoResize(void**, int) | Copies pointers from a buffer to the end of this list. |
AddRangeNoResize(UnsafePtrList<T>) | Copies the pointers of another list to the end of this list. |
AsParallelReader() | Obsolete. Use AsReadOnly() instead. |
AsParallelWriter() | Returns a parallel writer of this list. |
AsReadOnly() | Returns a read only of this list. |
Clear() | Sets the length to 0. |
Contains(void*) | Returns true if the list contains at least one occurrence of a specific pointer. |
Create(int, AllocatorHandle, NativeArrayOptions) | Returns a new list of pointers. |
Create(T**, int) | Returns a new list of pointers. |
Destroy(UnsafePtrList<T>*) | Destroys the list. |
Dispose() | Releases all resources (memory). |
Dispose(JobHandle) | Creates and schedules a job that frees the memory of this list. |
ElementAt(int) | Returns a reference to the element at a given index. |
IndexOf(void*) | Returns the index of the first occurrence of a specific pointer in the list. |
InsertRangeWithBeginEnd(int, int) | Shifts pointers toward the end of this list, increasing its length. |
RemoveAt(int) | Removes the pointer at an index, shifting everything above it down by one. Decrements the length by 1. |
RemoveAtSwapBack(int) | Copies the last pointer of this list to the specified index. Decrements the length by 1. |
RemoveRange(int, int) | Removes N pointers in a range, shifting everything above the range down by N. Decrements the length by N. |
RemoveRangeSwapBack(int, int) | Copies the last N pointer of this list to a range in this list. Decrements the length by N. |
Resize(int, NativeArrayOptions) | Sets the length, expanding the capacity if necessary. |
SetCapacity(int) | Sets the capacity. |
TrimExcess() | Sets the capacity to match the length. |