Fawkes API
Fawkes Development Version
|
Hash set with a lock. More...
#include <core/utils/lock_hashset.h>
Public Member Functions | |
LockHashSet () | |
Constructor. | |
LockHashSet (const LockHashSet< KeyType, HashFunction, EqualKey > &lh) | |
Copy constructor. | |
virtual | ~LockHashSet () |
Destructor. | |
void | lock () const |
Lock set. | |
bool | try_lock () const |
Try to lock set. | |
void | unlock () const |
Unlock set. | |
RefPtr< Mutex > | mutex () const |
Get access to the internal mutex. | |
void | insert_locked (const KeyType &x) |
Insert element to hash set with lock protection. | |
LockHashSet< KeyType, HashFunction, EqualKey > & | operator= (const LockHashSet< KeyType, HashFunction, EqualKey > &ll) |
Copy values from another LockHashSet. |
Hash set with a lock.
This class provides a hash set that has an intrinsic lock. The lock can be applied with the regular locking methods.
fawkes::LockHashSet::LockHashSet | ( | ) |
Constructor.
Definition at line 84 of file lock_hashset.h.
fawkes::LockHashSet::LockHashSet | ( | const LockHashSet< KeyType, HashFunction, EqualKey > & | lh | ) |
fawkes::LockHashSet::~LockHashSet | ( | ) | [virtual] |
Destructor.
Definition at line 105 of file lock_hashset.h.
void fawkes::LockHashSet::insert_locked | ( | const KeyType & | x | ) |
Insert element to hash set with lock protection.
x | element to add |
Definition at line 143 of file lock_hashset.h.
void fawkes::LockHashSet::lock | ( | ) | const |
Lock set.
Definition at line 112 of file lock_hashset.h.
Get access to the internal mutex.
Can be used with MutexLocker.
Definition at line 157 of file lock_hashset.h.
LockHashSet< KeyType, HashFunction, EqualKey > & fawkes::LockHashSet::operator= | ( | const LockHashSet< KeyType, HashFunction, EqualKey > & | ll | ) |
Copy values from another LockHashSet.
Copies the values one by one. Both instances are locked during the copying and this instance is cleared before copying.
ll | lock hash set to copy |
Definition at line 170 of file lock_hashset.h.
bool fawkes::LockHashSet::try_lock | ( | ) | const |
Try to lock set.
Definition at line 123 of file lock_hashset.h.
void fawkes::LockHashSet::unlock | ( | ) | const |
Unlock set.
Definition at line 132 of file lock_hashset.h.