www.mooseframework.org
Public Member Functions | Private Attributes | List of all members
HashMap< Key, T > Class Template Reference

HashMap is an abstraction for dictionary data type, we make it thread-safe by locking inserts. More...

#include <HashMap.h>

Inheritance diagram for HashMap< Key, T >:
[legend]

Public Member Functions

T & operator[] (const Key &k)
 
bool contains (const Key &key)
 

Private Attributes

libMesh::Threads::spin_mutex spin_mutex
 

Detailed Description

template<typename Key, typename T>
class HashMap< Key, T >

HashMap is an abstraction for dictionary data type, we make it thread-safe by locking inserts.

Definition at line 19 of file HashMap.h.

Member Function Documentation

◆ contains()

template<typename Key, typename T>
bool HashMap< Key, T >::contains ( const Key &  key)
inline

Definition at line 29 of file HashMap.h.

29 { return this->find(key) != this->end(); }

◆ operator[]()

template<typename Key, typename T>
T& HashMap< Key, T >::operator[] ( const Key &  k)
inline

Definition at line 22 of file HashMap.h.

23  {
24  libMesh::Threads::spin_mutex::scoped_lock lock(spin_mutex);
25 
26  return std::unordered_map<Key, T>::operator[](k);
27  }
libMesh::Threads::spin_mutex spin_mutex
Definition: HashMap.h:32

Member Data Documentation

◆ spin_mutex

template<typename Key, typename T>
libMesh::Threads::spin_mutex HashMap< Key, T >::spin_mutex
private

The documentation for this class was generated from the following file: