Priority queue container wrapping std::priority_queue. More...
#include <priorityqueue.h>
Public Member Functions | |
| PriorityQueue ()=default | |
| Default constructor. Creates an empty priority queue. | |
| PriorityQueue (const PriorityQueue &other) | |
| Copy constructor. | |
| PriorityQueue (PriorityQueue &&other) noexcept | |
| Move constructor. | |
| ~PriorityQueue ()=default | |
| Destructor. | |
| PriorityQueue & | operator= (const PriorityQueue &other) |
| Copy assignment operator. | |
| PriorityQueue & | operator= (PriorityQueue &&other) noexcept |
| Move assignment operator. | |
| bool | isEmpty () const |
| Returns true if the priority queue has no elements. | |
| size_t | size () const |
| Returns the number of elements. | |
| const T & | top () const |
| Returns a const reference to the highest-priority element. | |
| void | push (const T &value) |
| Pushes a value into the priority queue. | |
| void | push (T &&value) |
| Pushes a value into the priority queue (move overload). | |
| T | pop () |
| Removes and returns the highest-priority element. | |
| void | swap (PriorityQueue &other) noexcept |
| Swaps contents with another priority queue. | |
Priority queue container wrapping std::priority_queue.
Provides a Qt-inspired API over std::priority_queue with consistent naming conventions matching the rest of libpromeki. Not thread-safe; for use inside synchronized contexts. Simple value type — no PROMEKI_SHARED_FINAL.
| T | Element type. |
| Compare | Comparison function type (default: std::less<T>, which gives a max-heap where pop() returns the largest element). |
|
inline |
Removes and returns the highest-priority element.
Pushes a value into the priority queue.
| value | The value to insert. |
|
inline |
Pushes a value into the priority queue (move overload).
| value | The value to move-insert. |
|
inlinenoexcept |
Swaps contents with another priority queue.
| other | The priority queue to swap with. |