wilderfield
|
Priority map class. More...
#include <priority_map.hpp>
Classes | |
class | Proxy |
Public Member Functions | |
std::size_t | Size () const |
Returns the number of unique keys in the priority map. | |
bool | Empty () const |
Checks whether the priority map is empty. | |
std::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. | |
std::size_t | Erase (const KeyType &key) |
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. |
std::size_t wilderfield::PriorityMap< KeyType, ValType, Compare, Hash >::Erase | ( | const KeyType & | key | ) |
Erases key from the priority map. Returns the number of elements removed (0 or 1).