UnsafeQueue<T>
An unmanaged queue.
Read time 1 minuteLast updated 7 days ago
Definition
- Type: Struct
- Namespace: Unity.Collections
- Assembly: UnityEngine.ManagedKernelModule
- Implements: INativeDisposable, IDisposable
public struct UnsafeQueue<T> : INativeDisposable, IDisposable where T : unmanaged
Constructors
Constructor | Description |
|---|---|
| UnsafeQueue`1(Unity.Collections.AllocatorManager.AllocatorHandle) | Initializes and returns an instance of UnsafeQueue. |
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 UnsafeQueue instance. |
| Clear | Removes all elements of 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 |
|---|---|
| UnsafeQueue<T>.Enumerator | An enumerator over the values of a container. |
| UnsafeQueue<T>.ParallelWriter | A parallel writer for a UnsafeQueue. |
| UnsafeQueue<T>.ReadOnly | A read-only alias for the value of a UnsafeQueue. Does not have its own allocated storage. |