Struct NativeMultiQueue<T>
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.
Syntax
public struct NativeMultiQueue<T> : IDisposable where T : struct
Type Parameters
Constructors
NativeMultiQueue(Int32)
New NativeMultiQueue has a single bucket and the specified 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
Type |
Name |
Description |
Int32 |
initialMessageCapacity |
|
Methods
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
Type |
Name |
Description |
Int32 |
bucket |
|
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
Type |
Name |
Description |
Int32 |
bucket |
|
T |
value |
|
Returns
Dispose()
Declaration
Enqueue(Int32, T)
Enqueue a new item to a specific bucket. If the bucket does not yet exist
the number of buckets will be increased and if the queue is full the number
of items for each bucket will be increased.
Declaration
public void Enqueue(int bucket, T value)
Parameters
Type |
Name |
Description |
Int32 |
bucket |
|
T |
value |
|
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
Type |
Name |
Description |
Int32 |
bucket |
|
T |
value |
|
Returns
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.