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 24 of file HashMap.h.

Member Function Documentation

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

Definition at line 34 of file HashMap.h.

34 { return this->find(key) != this->end(); }
template<typename Key, typename T>
T& HashMap< Key, T >::operator[] ( const Key &  k)
inline

Definition at line 27 of file HashMap.h.

28  {
29  libMesh::Threads::spin_mutex::scoped_lock lock(spin_mutex);
30 
31  return std::unordered_map<Key, T>::operator[](k);
32  }
libMesh::Threads::spin_mutex spin_mutex
Definition: HashMap.h:37

Member Data Documentation

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: