Fawkes API
Fawkes Development Version
|
#include <core/utils/lock_hashmap.h>
Public Member Functions | |
LockHashMap () | |
Constructor. More... | |
LockHashMap (const LockHashMap< KeyType, ValueType, HashFunction, EqualKey > &lh) | |
Copy constructor. More... | |
virtual | ~LockHashMap () |
Destructor. More... | |
void | lock () const |
Lock map. More... | |
bool | try_lock () const |
Try to lock map. More... | |
void | unlock () const |
Unlock map. More... | |
RefPtr< Mutex > | mutex () const |
Get access to the internal mutex. More... | |
LockHashMap< KeyType, ValueType, HashFunction, EqualKey > & | operator= (const LockHashMap< KeyType, ValueType, HashFunction, EqualKey > &ll) |
Copy values from another LockHashMap. More... | |
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 61 of file lock_hashmap.h.
fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::LockHashMap |
Constructor.
Definition at line 93 of file lock_hashmap.h.
fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::LockHashMap | ( | const LockHashMap< KeyType, ValueType, HashFunction, EqualKey > & | lh | ) |
|
virtual |
Destructor.
Definition at line 117 of file lock_hashmap.h.
void fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::lock |
Lock map.
Definition at line 124 of file lock_hashmap.h.
Referenced by fawkes::NetworkNameResolver::cache_timeout().
RefPtr< Mutex > fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::mutex |
Get access to the internal mutex.
Can be used with MutexLocker.
Definition at line 153 of file lock_hashmap.h.
LockHashMap< KeyType, ValueType, HashFunction, EqualKey > & fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::operator= | ( | const LockHashMap< KeyType, ValueType, HashFunction, EqualKey > & | ll | ) |
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 167 of file lock_hashmap.h.
bool fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::try_lock |
Try to lock map.
Definition at line 134 of file lock_hashmap.h.
void fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::unlock |
Unlock map.
Definition at line 142 of file lock_hashmap.h.
Referenced by fawkes::NetworkNameResolver::cache_timeout(), and fawkes::NetworkNameResolver::resolve_address().