Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


NativeRingQueue<T>

A fixed-size circular buffer. For single-threaded uses only.
Read time 1 minuteLast updated 7 days ago

Definition

public struct NativeRingQueue<T> : INativeDisposable, IDisposable where T : unmanaged

Remarks

This container can't be used in parallel jobs, just on single-thread (for example: main thread, or single IJob).

Static Fields

Value

Description

MaxCapacityThe maximum number of elements this type of container can hold.

Constructors

Properties

Property

Description

CapacityThe number of elements that fit in the internal buffer.
IsCreatedWhether this queue has been allocated (and not yet deallocated).
IsEmptyWhether the queue is empty.
LengthThe number of elements currently in this queue.

Methods

Method

Description

DequeueRemoves the element from the end of the queue.
DisposeReleases all resources (memory and safety handles).
EnqueueAdds an element at the front of the queue.
TryDequeueRemoves the element from the end of the queue.
TryEnqueueAdds an element at the front of the queue.