![]() |
Public API Reference |
An implementation of a priority queue. More...
#include <csutil/priorityqueue.h>
Public Member Functions | |
| template<typename T2 > | |
| bool | Delete (const T2 &what) |
| Remove largest item that is equal to what. | |
| void | Insert (const T &what) |
| Insert an item. | |
| bool | IsEmpty () const |
| Return whether items are still in the queue. | |
| T | Pop () |
| Return and remove the largest item. | |
| const T & | Top () const |
| Return, but don't remove, the largest item. | |
An implementation of a priority queue.
T must be comparable with csComparator<>. Larger items are returned first.
Definition at line 40 of file priorityqueue.h.
| bool CS::Utility::PriorityQueue< T, Container, Comparator >::Delete | ( | const T2 & | what | ) | [inline] |
Remove largest item that is equal to what.
The contained type T and the type T2 of what must be comparable with csComparator<>.
Definition at line 136 of file priorityqueue.h.
| void CS::Utility::PriorityQueue< T, Container, Comparator >::Insert | ( | const T & | what | ) | [inline] |
Insert an item.
Definition at line 104 of file priorityqueue.h.
| bool CS::Utility::PriorityQueue< T, Container, Comparator >::IsEmpty | ( | ) | const [inline] |
Return whether items are still in the queue.
Definition at line 151 of file priorityqueue.h.
| T CS::Utility::PriorityQueue< T, Container, Comparator >::Pop | ( | ) | [inline] |
Return and remove the largest item.
Definition at line 112 of file priorityqueue.h.
| const T& CS::Utility::PriorityQueue< T, Container, Comparator >::Top | ( | ) | const [inline] |
Return, but don't remove, the largest item.
Definition at line 123 of file priorityqueue.h.