|
| void | clear () |
| | Remove all entries.
|
| |
| void | reserve (std::size_t n) |
| | Prepare buckets for at least n entries (std::unordered_map::reserve).
|
| |
| bool | isEmpty () const |
| | True when the map has no entries.
|
| |
| std::ptrdiff_t | size () const |
| | Number of entries, as a signed count.
|
| |
| bool | contains (const K &k) const |
| | Key lookup.
|
| |
| MutableIterator | insert (const K &k, const V &v) |
| | Store v under k, overwriting any existing value (insert_or_assign).
|
| |
| bool | remove (const K &k) |
| | Erase the entry for k.
|
| |
| V & | operator[] (const K &k) |
| | Modifiable value for k, inserting a value-initialized V{} first when absent.
|
| |
| V | value (const K &k, const V &fallback=V{}) const |
| | Copy of the value for k, without inserting.
|
| |
| MutableIterator | find (const K &k) |
| | Mutable iterator to the entry for k.
|
| |
| MutableIterator | begin () |
| | Mutable iterator to the first entry (order unspecified).
|
| |
| MutableIterator | end () |
| | Mutable past-the-end iterator.
|
| |
| ConstIterator | constFind (const K &k) const |
| | Read-only iterator to the entry for k.
|
| |
| ConstIterator | constEnd () const |
| | Read-only past-the-end iterator, to compare with constFind() results.
|
| |
| ConstIterator | cbegin () const |
| | Read-only iterator to the first entry (order unspecified).
|
| |
| ConstIterator | cend () const |
| | Read-only past-the-end iterator.
|
| |
| ConstIterator | begin () const |
| | Read-only iterator to the first entry; same as cbegin().
|
| |
| ConstIterator | end () const |
| | Read-only past-the-end iterator; same as cend().
|
| |
template<class K, class V>
class meshkit::detail::Map< K, V >
Hash map with the QHash-style API the CDT kernel uses, over std::unordered_map<K, V, Hash<K>>.
Unlike std::unordered_map, its iterators dereference to the mapped value, not to a key/value pair (Iterator::key() gives the key), so a range-for visits values. Iteration order is unspecified. Invalidation follows std::unordered_map: an insertion may rehash and invalidate iterators but not references to values, and remove() invalidates only the removed entry. No internal synchronization.
- Template Parameters
-
| K | Key type, hashed by Hash<K> and compared with operator==. |
| V | Mapped type. |