Struct NativeQueue<T>
An unmanaged queue.
Implements
Namespace: Unity.Collections
Assembly: solution.dll
Syntax
[NativeContainer]
public struct NativeQueue<T> : INativeDisposable where T : unmanaged
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements. |
Constructors
| Name | Description |
|---|---|
| NativeQueue(AllocatorHandle) | Initializes and returns an instance of NativeQueue. |
Properties
| Name | Description |
|---|---|
| Count | Returns the current number of elements in this queue. |
| IsCreated | Whether this queue has been allocated (and not yet deallocated). |
Methods
| Name | Description |
|---|---|
| AsParallelWriter() | Returns a parallel writer for this queue. |
| AsReadOnly() | Returns a readonly version of this NativeQueue instance. |
| Clear() | Removes all elements of this queue. |
| Dequeue() | Removes and returns the element at the end of this queue. |
| Dispose() | Releases all resources (memory and safety handles). |
| Dispose(JobHandle) | Creates and schedules a job that releases all resources (memory and safety handles) of this queue. |
| Enqueue(T) | Adds an element at the front of this queue. |
| IsEmpty() | Returns true if this queue is empty. |
| Peek() | Returns the element at the end of this queue without removing it. |
| ToArray(AllocatorHandle) | Returns an array containing a copy of this queue's content. |
| TryDequeue(out T) | Removes and outputs the element at the end of this queue. |