Proton DotNet
Loading...
Searching...
No Matches
Classes | Public Member Functions | Properties | List of all members
Apache.Qpid.Proton.Utilities.RingQueue< T > Class Template Referencesealed

Simple Ring Queue implementation that has an enforced max size value. More...

Inheritance diagram for Apache.Qpid.Proton.Utilities.RingQueue< T >:

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.
 
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.
 
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.
 
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]
 

Detailed Description

Simple Ring Queue implementation that has an enforced max size value.

Template Parameters
TThe type contained in the Queue

Constructor & Destructor Documentation

◆ RingQueue() [1/2]

Apache.Qpid.Proton.Utilities.RingQueue< T >.RingQueue ( int  queueSize)
inline

Creates a new RingQueue instance with the given fixed queue size.

Parameters
queueSize

◆ RingQueue() [2/2]

Apache.Qpid.Proton.Utilities.RingQueue< T >.RingQueue ( IReadOnlyCollection< T >  elements)
inline

Create a new RingQueue instance with elements of the given collection as the initial values contained in the queue.

Parameters
elements

Member Function Documentation

◆ Contains()

bool Apache.Qpid.Proton.Utilities.RingQueue< T >.Contains ( value)
inline

Search the queue for the specified value and returns true if found.

Parameters
valueThe value whose presence is being queried
Returns
true if the queue contains the given value.

◆ IsEmpty()

Checks if this queue is empty or not.

Returns
true if the queue has no elements

◆ Offer()

bool Apache.Qpid.Proton.Utilities.RingQueue< T >.Offer ( e)
inline

Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions.

Parameters
eThe value to insert into the queue
Returns
true if the element was inserted successfully

◆ Peek()

Returns
The head of the queue or the default value contained type

◆ Poll() [1/2]

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.

Returns

◆ Poll() [2/2]

T Apache.Qpid.Proton.Utilities.RingQueue< T >.Poll ( Func< T >  createOnEmpty)
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.

Parameters
createOnEmptySupplier function for value when empty
Returns
A value from the queue or a supplied value

The documentation for this class was generated from the following file: