Base Framework
|
Priority queue collection. More...
#include <base/collection/PriorityQueue.h>
Inherits Collection, and Synchronizeable< Unsafe >.
Public Types | |
typedef VALUE | Value |
typedef PRIORITY | Priority |
typedef Association< Priority, Queue< Value > > | Node |
Public Member Functions | |
PriorityQueue () noexcept | |
PriorityQueue (std::initializer_list< Pair< Priority, Value > > values) | |
PriorityQueue (const PriorityQueue ©) noexcept | |
PriorityQueue (PriorityQueue &&move) noexcept | |
PriorityQueue & | operator= (const PriorityQueue &assign) |
PriorityQueue & | operator= (PriorityQueue &&assign) |
MemorySize | getSize () const noexcept |
bool | isEmpty () const noexcept |
void | push (const Priority &priority, const Value &value) |
void | push (const Priority &priority, Value &&value) |
Value | pop () |
void | removeAll () noexcept |
Protected Attributes | |
OrderedBinaryTree< Node > | elements |
MemorySize | size = 0 |
Additional Inherited Members | |
![]() | |
void | exclusiveLock () const noexcept |
void | sharedLock () const noexcept |
void | releaseLock () const noexcept |
Priority queue collection.
Priority queue. As for the Queue collection the first value pushed onto the queue is also the first to be pop'ed. However, values associated with higher priority get to the top before values of less priority.
typedef Association<Priority, Queue<Value> > PriorityQueue< VALUE, PRIORITY, LOCK >::Node |
The type of an association used internally by the priority queue.
typedef PRIORITY PriorityQueue< VALUE, PRIORITY, LOCK >::Priority |
The type of the priority.
typedef VALUE PriorityQueue< VALUE, PRIORITY, LOCK >::Value |
The type of a value of the queue.
|
inlinenoexcept |
Initializes an empty priority queue.
|
inline |
Initializes list from initializer list.
|
inlinenoexcept |
Initializes a priority queue from other priority queue.
|
inlinenoexcept |
Initializes a priority queue from other priority queue.
|
inlinenoexcept |
Returns the number of elements in the priority queue.
|
inlinenoexcept |
Returns true if the priority queue is empty.
|
inline |
Assign container.
|
inline |
Assign container.
|
inline |
Removes the element at the front of the priority queue. Raises InvalidNode if the priority queue is empty.
|
inline |
Pushes the specified value onto the priority queue.
priority | The priority of the value. |
value | The value to be added to the queue. |
|
inline |
Pushes the specified value onto the priority queue.
priority | The priority of the value. |
value | The value to be added to the queue. |
|
inlinenoexcept |
Removes all the keys from this set.
|
protected |
The elements of the priority queue.
|
protected |
The number of elements in the priority queue.