Multi-valued hash map with the QMultiHash subset the CDT kernel uses.
More...
#include <meshkit/detail/storage.hpp>
|
| void | clear () |
| | Remove all keys and values.
|
| |
| void | remove (const K &key) |
| | Remove every value stored under key.
|
| |
| void | insert (const K &key, const V &value) |
| | Add value under key, ahead of the values already there.
|
| |
| bool | contains (const K &key, const V &value) const |
| | Key/value lookup by linear search of the key's values.
|
| |
| Vector< V > | values (const K &key) const |
| | Copy of the values under key, most recently inserted first.
|
| |
template<class K, class V>
class meshkit::detail::MultiMap< K, V >
Multi-valued hash map with the QMultiHash subset the CDT kernel uses.
Each key holds a Vector<V> of values, newest first: insert() puts the value at the front and keeps duplicates. insert() and contains() are linear in the number of values under the key. There is no iteration interface and no internal synchronization.
- Template Parameters
-
| K | Key type, hashed by Hash<K>. |
| V | Value type; contains() compares values with operator==. |
◆ clear()
template<class K, class V>
Remove all keys and values.
◆ contains()
template<class K, class V>
Key/value lookup by linear search of the key's values.
- Parameters
-
| [in] | key | Key. |
| [in] | value | Value to look for. |
- Returns
- True when
key holds a value equal to value.
◆ insert()
template<class K, class V>
Add value under key, ahead of the values already there.
- Parameters
-
| [in] | key | Key. |
| [in] | value | Value to copy; duplicates are kept. |
◆ remove()
template<class K, class V>
Remove every value stored under key.
- Parameters
-
| [in] | key | Key; an absent key is ignored. |
◆ values()
template<class K, class V>
Copy of the values under key, most recently inserted first.
- Parameters
-
- Returns
- The values, or an empty vector when
key is absent.
The documentation for this class was generated from the following file: