Struct UnsafeRingQueue<T>
A fixed-size circular buffer.
Implements
Namespace: Unity.Collections.LowLevel.Unsafe
Assembly: solution.dll
Syntax
public struct UnsafeRingQueue<T> : INativeDisposable where T : unmanaged
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements. |
Constructors
| Name | Description |
|---|---|
| UnsafeRingQueue(int, AllocatorHandle, NativeArrayOptions) | Initializes and returns an instance of UnsafeRingQueue. |
| UnsafeRingQueue(T*, int) | Initializes and returns an instance of UnsafeRingQueue which aliasing an existing buffer. |
Fields
| Name | Description |
|---|---|
| Allocator | The allocator used to create the internal buffer. |
| Ptr | The internal buffer where the content is stored. |
Properties
| Name | Description |
|---|---|
| Capacity | The number of elements that fit in the internal buffer. |
| IsCreated | Whether this queue has been allocated (and not yet deallocated). |
| IsEmpty | Whether the queue is empty. |
| Length | The number of elements currently in this queue. |
Methods
| Name | Description |
|---|---|
| Dequeue() | Removes the element from the end of the queue. |
| Dispose() | Releases all resources (memory and safety handles). |
| Dispose(JobHandle) | Creates and schedules a job that will dispose this queue. |
| Enqueue(T) | Adds an element at the front of the queue. |
| TryDequeue(out T) | Removes the element from the end of the queue. |
| TryEnqueue(T) | Adds an element at the front of the queue. |