3rd Eye Scene C#
3rd Eye Scene C# documentation
|
This is a thread safe queue implementation. More...
Public Member Functions | |
void | Clear () |
Clear the queue contents. | |
void | Enqueue (T item) |
Push item onto the queue tail. | |
void | Enqueue (IList< T > items) |
Push a list of items onto the queue tail. | |
T | Dequeue () |
Pop the head of the queue. | |
T | Peek () |
Peek at the head of the queue. | |
bool | TryDequeue (ref T item) |
Pop the head of the queue if the queue is not empty. | |
bool | TryPeek (ref T item) |
Peek at the head of the queue if the queue is not empty. | |
Properties | |
int | Count [get] |
Calculates the number of items in the queue. |
This is a thread safe queue implementation.
The Queue explicitly does not implement any standard collection interfaces as they do not lend themselves well to maintaining thread safe access.
While the implementation details may change, the queue is currently underpinned by the System.Collections.Generic.Queue"
.
Note: The current .Net framework contains System.Collections.Concurrent.ConcurrentQueue
. However, Unity does not support the required .Net framework version and that class is not available within Unity.
void Tes::Collections::Queue< T >::Clear | ( | ) | [inline] |
Clear the queue contents.
Thread safe.
T Tes::Collections::Queue< T >::Dequeue | ( | ) | [inline] |
Pop the head of the queue.
InvalidOperationException | Thrown when the queue is empty. |
void Tes::Collections::Queue< T >::Enqueue | ( | T | item | ) | [inline] |
Push item onto the queue tail.
item | The item to enqueue. |
void Tes::Collections::Queue< T >::Enqueue | ( | IList< T > | items | ) | [inline] |
Push a list of items onto the queue tail.
items |
The synchronsiation lock is held until all items are added so this may cause inefficiencies in blocking other threads.
T Tes::Collections::Queue< T >::Peek | ( | ) | [inline] |
Peek at the head of the queue.
The head is not removed.
InvalidOperationException | Thrown when the queue is empty. |
bool Tes::Collections::Queue< T >::TryDequeue | ( | ref T | item | ) | [inline] |
Pop the head of the queue if the queue is not empty.
The item value is unchanged if the queue is empty.
item | Set to the value of the head of the queue. |
bool Tes::Collections::Queue< T >::TryPeek | ( | ref T | item | ) | [inline] |
Peek at the head of the queue if the queue is not empty.
The head is not removed.
The item value is unchanged if the queue is empty.
item | Set to the value of the head of the queue. |
int Tes::Collections::Queue< T >::Count [get] |
Calculates the number of items in the queue.
Locks the queue to make the calculation.