Proton DotNet
|
Simple Ring Queue implementation that has an enforced max size value. More...
Public Member Functions | |
RingQueue (int queueSize) | |
Creates a new RingQueue instance with the given fixed queue size. | |
RingQueue (IReadOnlyCollection< T > elements) | |
Create a new RingQueue instance with elements of the given collection as the initial values contained in the queue. | |
IEnumerator< T > | GetEnumerator () |
void | CopyTo (Array array, int index) |
void | CopyTo (T[] array, int index) |
bool | IsEmpty () |
Checks if this queue is empty or not. | |
void | Clear () |
Clears all elements from this queue and resets to an empty state. | |
bool | Offer (T e) |
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions. | |
T | Poll () |
Returns the value at the head of the queue if one is present or returns the default value for the type contained in the queue if empty. | |
T | Poll (Func< T > createOnEmpty) |
Retrieves and removes the head of this ring queue, and if the queue is currently empty a new instance of the queue type is provided by invoking the given function to supply a default value. | |
T | Peek () |
bool | Contains (T value) |
Search the queue for the specified value and returns true if found. | |
Properties | |
int | Count [get] |
bool | IsSynchronized [get] |
object | SyncRoot [get] |
Simple Ring Queue implementation that has an enforced max size value.
T | The type contained in the Queue |
|
inline |
Creates a new RingQueue instance with the given fixed queue size.
queueSize |
|
inline |
Create a new RingQueue instance with elements of the given collection as the initial values contained in the queue.
elements |
|
inline |
Search the queue for the specified value and returns true if found.
value | The value whose presence is being queried |
bool Apache.Qpid.Proton.Utilities.RingQueue< T >.IsEmpty | ( | ) |
Checks if this queue is empty or not.
|
inline |
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions.
e | The value to insert into the queue |
|
inline |
|
inline |
Returns the value at the head of the queue if one is present or returns the default value for the type contained in the queue if empty.
|
inline |
Retrieves and removes the head of this ring queue, and if the queue is currently empty a new instance of the queue type is provided by invoking the given function to supply a default value.
createOnEmpty | Supplier function for value when empty |