Implements a heap based priority queue that hold only keys. The key with the minimum value can then retrieved from the queue. This class is not thread safe.
Constructor | Description |
Full Usage:
ConcurrentPriorityQueue()
|
|
Full Usage:
ConcurrentPriorityQueue(capacity)
Parameters:
int
-
The initial capacity.
|
|
Instance member | Description | ||
Full Usage:
this.Count
Returns: int
|
Gets the number of elements in the queue.
|
||
Full Usage:
this.Enqueue
Parameters:
'TKey
-
The key value.
value : 'TValue
-
The value.
|
Adds the specified key to the queue.
|
||
Full Usage:
this.IsEmpty
Returns: bool
|
Gets a value indicating whether the queue is empty.
|
||
Full Usage:
this.TryDequeue
Parameters:
byref<'TKey>
value : byref<'TValue>
Returns: bool
Minimum key value.
|
Dequeues the minimum key value. An exception is thrown if the queue is empty.
|
||
Full Usage:
this.TryDequeueIf
Parameters:
Func<'TKey, bool>
key : byref<'TKey>
value : byref<'TValue>
Returns: bool
True if the item was dequeued; otherwise, false.
|
Dequeues the minimum key value. Two conditions are neccessary in order to dequeue an item: i) at least one item needs to be in the queue, and ii) the predicate given in the argument, applied to the minimum key value item, must return true.
|
||
Full Usage:
this.TryDequeueIf
Parameters:
Func<'TKey, 'TValue, bool>
key : byref<'TKey>
value : byref<'TValue>
Returns: bool
True if the item was dequeued; otherwise, false.
|
Dequeues the minimum key value. Two conditions are neccessary in order to dequeue an item: i) at least one item needs to be in the queue, and ii) the predicate given in the argument, applied to the minimum key value item, must return true.
|
||
Full Usage:
this.TryPeek
Parameters:
byref<'TKey>
value : byref<'TValue>
Returns: bool
Minimum key value.
|
Peeks the element with the minimum key value. An exception is thrown if the queue is empty.
|