Hash map with a lock. More...
#include <core/utils/lock_hashmap.h>

Public Member Functions | |
| LockHashMap () | |
| Constructor. | |
| LockHashMap (const LockHashMap< KeyType, ValueType, HashFunction, EqualKey > &lh) | |
| Copy constructor. | |
| virtual | ~LockHashMap () |
| Destructor. | |
| void | lock () const |
| Lock map. | |
| bool | try_lock () const |
| Try to lock map. | |
| void | unlock () const |
| Unlock map. | |
| RefPtr< Mutex > | mutex () const |
| Get access to the internal mutex. | |
| LockHashMap< KeyType, ValueType, HashFunction, EqualKey > & | operator= (const LockHashMap< KeyType, ValueType, HashFunction, EqualKey > &ll) |
| Copy values from another LockHashMap. | |
Hash map with a lock.
This class provides a hash map that has an intrinsic lock. The lock can be applied with the regular locking methods.
Definition at line 47 of file lock_hashmap.h.
| fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::LockHashMap | ( | ) | [inline] |
Constructor.
Definition at line 82 of file lock_hashmap.h.
| fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::LockHashMap | ( | const LockHashMap< KeyType, ValueType, HashFunction, EqualKey > & | lh | ) | [inline] |
| fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::~LockHashMap | ( | ) | [inline, virtual] |
Destructor.
Definition at line 105 of file lock_hashmap.h.
| void fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::lock | ( | ) | const [inline] |
Lock map.
Definition at line 113 of file lock_hashmap.h.
Referenced by fawkes::NetworkNameResolver::flush_cache(), fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::operator=(), fawkes::NetworkNameResolver::resolve_address(), and fawkes::NetworkNameResolver::resolve_name().
| RefPtr< Mutex > fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::mutex | ( | ) | const [inline] |
Get access to the internal mutex.
Can be used with MutexLocker.
Definition at line 145 of file lock_hashmap.h.
| LockHashMap< KeyType, ValueType, HashFunction, EqualKey > & fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::operator= | ( | const LockHashMap< KeyType, ValueType, HashFunction, EqualKey > & | ll | ) | [inline] |
Copy values from another LockHashMap.
Copies the values one by one. Both instances are locked during the copying and this instance is cleared before copying.
| ll | hash map to copy |
Definition at line 159 of file lock_hashmap.h.
References fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::lock(), and fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::unlock().
| bool fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::try_lock | ( | ) | const [inline] |
Try to lock map.
Definition at line 124 of file lock_hashmap.h.
| void fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::unlock | ( | ) | const [inline] |
Unlock map.
Definition at line 133 of file lock_hashmap.h.
Referenced by fawkes::NetworkNameResolver::flush_cache(), fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::operator=(), fawkes::NetworkNameResolver::resolve_address(), and fawkes::NetworkNameResolver::resolve_name().
1.6.1