https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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)
 
std::size_t erase (const Key &k)
 
iterator find (const Key &k)
 
const_iterator find (const Key &k) const
 
bool contains (const Key &key) const
 

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

Member Function Documentation

◆ contains()

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

Definition at line 48 of file HashMap.h.

48{ return this->find(key) != this->end(); }
iterator find(const Key &k)
Definition HashMap.h:36

◆ erase()

template<typename Key , typename T >
std::size_t HashMap< Key, T >::erase ( const Key &  k)
inline

Definition at line 27 of file HashMap.h.

28 {
30 return std::unordered_map<Key, T>::erase(k);
31 }
libMesh::Threads::spin_mutex spin_mutex
Definition HashMap.h:51

◆ find() [1/2]

template<typename Key , typename T >
iterator HashMap< Key, T >::find ( const Key &  k)
inline

Definition at line 36 of file HashMap.h.

37 {
39 return std::unordered_map<Key, T>::find(k);
40 }

Referenced by HashMap< Key, T >::contains(), and MaterialPropertyStorage::props().

◆ find() [2/2]

template<typename Key , typename T >
const_iterator HashMap< Key, T >::find ( const Key &  k) const
inline

Definition at line 42 of file HashMap.h.

43 {
45 return std::unordered_map<Key, T>::find(k);
46 }

◆ operator[]()

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

Definition at line 21 of file HashMap.h.

22 {
24 return std::unordered_map<Key, T>::operator[](k);
25 }

Member Data Documentation

◆ spin_mutex

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

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