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 |
---|---|
Unsafe |
Initializes and returns an instance of UnsafePtrList. |
Unsafe |
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. |
Is |
Whether this list has been allocated (and not yet deallocated). |
Is |
Whether the list is empty. |
this[int] | The element at an index. |
Length | The number of elements. |
Methods
Name | Description |
---|---|
Add(in Int |
Adds a pointer to the end of the list. |
Add(void*) | Adds a pointer to the end of the list. |
Add |
Adds a pointer to the end of this list. |
Add |
Adds elements from a buffer to this list. |
Add |
Copies the elements of another list to the end of this list. |
Add |
Copies pointers from a buffer to the end of this list. |
Add |
Copies the pointers of another list to the end of this list. |
As |
Obsolete. Use As |
As |
Returns a parallel writer of this list. |
As |
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, Allocator |
Returns a new list of pointers. |
Create(T**, int) | Returns a new list of pointers. |
Destroy(Unsafe |
Destroys the list. |
Dispose() | Releases all resources (memory). |
Dispose(Job |
Creates and schedules a job that frees the memory of this list. |
Element |
Returns a reference to the element at a given index. |
Index |
Returns the index of the first occurrence of a specific pointer in the list. |
Insert |
Shifts pointers toward the end of this list, increasing its length. |
Remove |
Removes the pointer at an index, shifting everything above it down by one. Decrements the length by 1. |
Remove |
Copies the last pointer of this list to the specified index. Decrements the length by 1. |
Remove |
Removes N pointers in a range, shifting everything above the range down by N. Decrements the length by N. |
Remove |
Copies the last N pointer of this list to a range in this list. Decrements the length by N. |
Resize(int, Native |
Sets the length, expanding the capacity if necessary. |
Set |
Sets the capacity. |
Trim |
Sets the capacity to match the length. |