13 #include "libmesh/threads.h" 15 #include <unordered_map> 17 template <
typename Key,
typename T>
18 class HashMap :
public std::unordered_map<Key, T>
24 return std::unordered_map<Key, T>::operator[](k);
27 inline std::size_t
erase(
const Key & k)
30 return std::unordered_map<Key, T>::erase(k);
33 using typename std::unordered_map<Key, T>::const_iterator;
34 using typename std::unordered_map<Key, T>::iterator;
36 inline iterator
find(
const Key & k)
39 return std::unordered_map<Key, T>::find(k);
42 inline const_iterator
find(
const Key & k)
const 45 return std::unordered_map<Key, T>::find(k);
48 inline bool contains(
const Key & key)
const {
return this->
find(key) != this->end(); }
HashMap is an abstraction for dictionary data type, we make it thread-safe by locking inserts...
const_iterator find(const Key &k) const
T & operator[](const Key &k)
std::size_t erase(const Key &k)
iterator find(const Key &k)
bool contains(const Key &key) const
tbb::spin_mutex spin_mutex
libMesh::Threads::spin_mutex spin_mutex