Fawkes API
Fawkes Development Version
|
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.
fawkes::LockHashMap::LockHashMap | ( | ) |
Constructor.
Definition at line 82 of file lock_hashmap.h.
fawkes::LockHashMap::LockHashMap | ( | const LockHashMap< KeyType, ValueType, HashFunction, EqualKey > & | lh | ) |
fawkes::LockHashMap::~LockHashMap | ( | ) | [virtual] |
Destructor.
Definition at line 105 of file lock_hashmap.h.
void fawkes::LockHashMap::lock | ( | ) | const |
Lock map.
Definition at line 113 of file lock_hashmap.h.
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::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 159 of file lock_hashmap.h.
bool fawkes::LockHashMap::try_lock | ( | ) | const |
Try to lock map.
Definition at line 124 of file lock_hashmap.h.
void fawkes::LockHashMap::unlock | ( | ) | const |
Unlock map.
Definition at line 133 of file lock_hashmap.h.