wilderfield
|
Priority map class. More...
#include <priority_map.hpp>
Classes | |
class | Proxy |
Public Member Functions | |
size_t | size () const |
Returns the number of unique keys in the priority map. | |
bool | empty () const |
Checks whether the priority map is empty. | |
size_t | count (const KeyType &key) const |
Returns the count of a particular key in the map. | |
std::pair< KeyType, ValType > | top () const |
Returns the top element (key-value pair) in the priority map. | |
size_t | erase (const KeyType &key) |
Erases key from the priority map. Returns the number of elements removed (0 or 1). | |
void | pop () |
Removes the top element from the priority map. | |
Proxy | operator[] (const KeyType &key) |
Priority map class.
Implements a priority map where each key is associated with a priority value. The map maintains the keys in sorted order based on their priority, allowing for efficient retrieval and modification of priorities.
KeyType | The type of the keys. |
ValType | The type of the values (priorities), must be numeric. |
Compare | Comparison class used to maintain the ordering of values. |
Hash | Hashing class used for keys. |