Skip to main content

Unity.Networking.Transport.Utilities.NativeMultiQueue-1

A NativeMultiQueue is a set of several FIFO queues split into buckets. Each bucket has its own first and last item, and each bucket can have items pushed and popped individually.

Implements#

System.IDisposable

Inherited Members#

ValueType.Equals(Object)

ValueType.GetHashCode()

ValueType.ToString()

Object.Equals(Object, Object)

Object.GetType()

Object.ReferenceEquals(Object, Object)

Namespace: System.Dynamic.ExpandoObject#
Assembly: transport.dll#
Syntax#
public struct NativeMultiQueue<T> : IDisposable where T : struct
Type Parameters#
NameDescription
T

NativeMultiQueue(Int32)#

Instantiates a new NativeMultiQueue which has a single bucket and the specified capacity for the number of items for that bucket. Accessing buckets out of range will grow the number of buckets, and pushing more items than the initial capacity will increase the number of items for each bucket.

Declaration#

public NativeMultiQueue(int initialMessageCapacity)

Parameters#

TypeNameDescription
System.Int32initialMessageCapacity

#

IsCreated#

Whether this queue has been allocated (and not yet deallocated).

Declaration#

public readonly bool IsCreated { get; }

Property Value#

TypeDescription
System.BooleanTrue if this queue has been allocated (and not yet deallocated).

#

Clear(Int32)#

Remove all items from a specific bucket. If the bucket does not exist, the call will not do anything.

Declaration#

public void Clear(int bucket)

Parameters#

TypeNameDescription
System.Int32bucket

Dequeue(Int32, out T)#

Dequeue an item from a specific bucket. If the bucket does not exist, or if the bucket is empty, the call will fail and return false.

Declaration#

public bool Dequeue(int bucket, out T value)

Parameters#

TypeNameDescription
System.Int32bucket
Tvalue

Returns#

TypeDescription
System.Boolean

Dispose()#

Releases all resources (memory and safety handles).

Declaration#

public void Dispose()

Enqueue(Int32, T)#

Enqueue a new item to a specific bucket. If the specified bucket is larger than the current amount of buckets, the queue's number of buckets will be increased to match. If enqueueing the item would exceed the queue's capacity, the queue's capacity will be increased.

Declaration#

public void Enqueue(int bucket, T value)

Parameters#

TypeNameDescription
System.Int32bucket
Tvalue

Peek(Int32, out T)#

Peek the next item in a specific bucket. If the bucket does not exist, or if the bucket is empty, the call will fail and return false.

Declaration#

public bool Peek(int bucket, out T value)

Parameters#

TypeNameDescription
System.Int32bucket
Tvalue

Returns#

TypeDescription
System.Boolean

Implements#

System.IDisposable