3rd Eye Scene C#
3rd Eye Scene C# documentation
Tes::Collections::Queue< T > Class Template Reference

This is a thread safe queue implementation. More...

List of all members.

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.
Dequeue ()
 Pop the head of the queue.
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.

Detailed Description

template<T>
class Tes::Collections::Queue< T >

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.


Member Function Documentation

template<T >
void Tes::Collections::Queue< T >::Clear ( ) [inline]

Clear the queue contents.

Thread safe.

template<T >
T Tes::Collections::Queue< T >::Dequeue ( ) [inline]

Pop the head of the queue.

See also:
TryDequeue(ref T)
Returns:
The head of the queue.
Exceptions:
InvalidOperationExceptionThrown when the queue is empty.
template<T >
void Tes::Collections::Queue< T >::Enqueue ( item) [inline]

Push item onto the queue tail.

Parameters:
itemThe item to enqueue.
template<T >
void Tes::Collections::Queue< T >::Enqueue ( IList< T >  items) [inline]

Push a list of items onto the queue tail.

Parameters:
items

The synchronsiation lock is held until all items are added so this may cause inefficiencies in blocking other threads.

template<T >
T Tes::Collections::Queue< T >::Peek ( ) [inline]

Peek at the head of the queue.

The head is not removed.

See also:
TryPeek(ref T)
Returns:
The head of the queue.
Exceptions:
InvalidOperationExceptionThrown when the queue is empty.
template<T >
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.

Parameters:
itemSet to the value of the head of the queue.
Returns:
True if the queue was not empty and the head has been retrieved. False if the queue was empty (item is unchanged).
template<T >
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.

Parameters:
itemSet to the value of the head of the queue.
Returns:
True if the queue is not empty and the head has been retrieved. False if the queue is empty (item is unchanged).

Property Documentation

template<T >
int Tes::Collections::Queue< T >::Count [get]

Calculates the number of items in the queue.

Locks the queue to make the calculation.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties Events