Fawkes API
Fawkes Development Version
|
Hash map with a lock. More...
#include <core/utils/rwlock_map.h>
Public Member Functions | |
RWLockMap () | |
Constructor. More... | |
RWLockMap (const RWLockMap< KeyType, ValueType, LessKey > &lm) | |
Copy constructor. More... | |
virtual | ~RWLockMap () |
Destructor. More... | |
void | lock_for_read () |
Lock list for reading. More... | |
void | lock_for_write () |
Lock list for writing. More... | |
bool | try_lock_for_read () |
Try to lock list for reading. More... | |
bool | try_lock_for_write () |
Try to lock list for writing. More... | |
void | unlock () |
Unlock list. More... | |
RefPtr< ReadWriteLock > | rwlock () const |
Get access to the internal rwlock. More... | |
void | erase_locked (const KeyType &key) |
Remove item with lock. More... | |
Hash map with a lock.
This class provides a map that has an intrinsic read/write lock. The lock can be applied with the regular locking methods.
Definition at line 37 of file rwlock_map.h.
fawkes::RWLockMap< KeyType, ValueType, LessKey >::RWLockMap | ( | ) |
Constructor.
Definition at line 72 of file rwlock_map.h.
fawkes::RWLockMap< KeyType, ValueType, LessKey >::RWLockMap | ( | const RWLockMap< KeyType, ValueType, LessKey > & | lm | ) |
|
virtual |
Destructor.
Definition at line 88 of file rwlock_map.h.
void fawkes::RWLockMap< KeyType, ValueType, LessKey >::erase_locked | ( | const KeyType & | key | ) |
Remove item with lock.
The map is automatically locked and unlocked during the removal.
key | key of the value to erase |
Definition at line 147 of file rwlock_map.h.
void fawkes::RWLockMap< KeyType, ValueType, LessKey >::lock_for_read | ( | ) |
Lock list for reading.
Definition at line 95 of file rwlock_map.h.
void fawkes::RWLockMap< KeyType, ValueType, LessKey >::lock_for_write | ( | ) |
Lock list for writing.
Definition at line 104 of file rwlock_map.h.
RefPtr< ReadWriteLock > fawkes::RWLockMap< KeyType, ValueType, LessKey >::rwlock | ( | ) | const |
Get access to the internal rwlock.
Can be used with RwlockLocker.
Definition at line 161 of file rwlock_map.h.
bool fawkes::RWLockMap< KeyType, ValueType, LessKey >::try_lock_for_read | ( | ) |
Try to lock list for reading.
Definition at line 115 of file rwlock_map.h.
bool fawkes::RWLockMap< KeyType, ValueType, LessKey >::try_lock_for_write | ( | ) |
Try to lock list for writing.
Definition at line 126 of file rwlock_map.h.
void fawkes::RWLockMap< KeyType, ValueType, LessKey >::unlock | ( | ) |
Unlock list.
Definition at line 135 of file rwlock_map.h.