Fawkes API
Fawkes Development Version
|
Hash map with a lock. More...
#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 55 of file lock_hashmap.h.
fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::LockHashMap | ( | ) |
Constructor.
Definition at line 90 of file lock_hashmap.h.
fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::LockHashMap | ( | const LockHashMap< KeyType, ValueType, HashFunction, EqualKey > & | lh | ) |
|
virtual |
Destructor.
Definition at line 115 of file lock_hashmap.h.
void fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::lock | ( | ) | const |
Lock map.
Definition at line 123 of file lock_hashmap.h.
Referenced by fawkes::NetworkNameResolver::flush_cache(), fawkes::LockHashMap< std::string, std::pair< struct sockaddr *, time_t > >::lock(), fawkes::LockHashMap< std::string, std::pair< struct sockaddr *, time_t > >::operator=(), fawkes::NetworkNameResolver::resolve_address(), and fawkes::NetworkNameResolver::resolve_name().
RefPtr< Mutex > fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::mutex | ( | ) | const |
Get access to the internal mutex.
Can be used with MutexLocker.
Definition at line 155 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 169 of file lock_hashmap.h.
bool fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::try_lock | ( | ) | const |
Try to lock map.
Definition at line 134 of file lock_hashmap.h.
Referenced by fawkes::LockHashMap< std::string, std::pair< struct sockaddr *, time_t > >::try_lock().
void fawkes::LockHashMap< KeyType, ValueType, HashFunction, EqualKey >::unlock | ( | ) | const |
Unlock map.
Definition at line 143 of file lock_hashmap.h.
Referenced by fawkes::NetworkNameResolver::flush_cache(), fawkes::LockHashMap< std::string, std::pair< struct sockaddr *, time_t > >::operator=(), fawkes::NetworkNameResolver::resolve_address(), fawkes::NetworkNameResolver::resolve_name(), and fawkes::LockHashMap< std::string, std::pair< struct sockaddr *, time_t > >::unlock().