NativeQueue<T>
An unmanaged queue.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Struct
- Namespace: Unity.Collections
- Assembly: UnityEngine.ManagedKernelModule
- Implements: INativeDisposable, IDisposable
public struct NativeQueue<T> : INativeDisposable, IDisposable where T : unmanaged
Constructors
Constructor | Description |
|---|---|
| NativeQueue`1(Unity.Collections.AllocatorManager.AllocatorHandle) | Initializes and returns an instance of NativeQueue. |
Properties
Property | Description |
|---|---|
| Count | Returns the current number of elements in this queue. |
| IsCreated | Whether this queue has been allocated (and not yet deallocated). |
Methods
Method | Description |
|---|---|
| AsParallelWriter | Returns a parallel writer for this queue. |
| AsReadOnly | Returns a readonly version of this NativeQueue instance. |
| Clear | Removes all elements from this queue. |
| Dequeue | Removes and returns the element at the front of this queue. |
| Dispose | Releases all resources (memory and safety handles). |
| Enqueue | Adds an element at the back of this queue. |
| IsEmpty | Returns true if this queue is empty. |
| Peek | Returns the element at the front of this queue without removing it. |
| ToArray | Returns an array containing a copy of this queue's content. |
| TryDequeue | Removes and outputs the element at the front of this queue. |
Structs
Struct | Description |
|---|---|
| NativeQueue<T>.Enumerator | An enumerator over the values of a container. |
| NativeQueue<T>.ParallelWriter | A parallel writer for a NativeQueue. |
| NativeQueue<T>.ReadOnly | A read-only alias for the value of a NativeQueue. Does not have its own allocated storage. |