|
Fawkes API
Fawkes Development Version
|
Hash map with a lock. More...
#include <core/utils/rwlock_map.h>

Public Member Functions | |
| RWLockMap () | |
| Constructor. | |
| RWLockMap (const RWLockMap< KeyType, ValueType, LessKey > &lm) | |
| Copy constructor. | |
| virtual | ~RWLockMap () |
| Destructor. | |
| void | lock_for_read () |
| Lock list for reading. | |
| void | lock_for_write () |
| Lock list for writing. | |
| bool | try_lock_for_read () |
| Try to lock list for reading. | |
| bool | try_lock_for_write () |
| Try to lock list for writing. | |
| void | unlock () |
| Unlock list. | |
| RefPtr< ReadWriteLock > | rwlock () const |
| Get access to the internal rwlock. | |
| void | erase_locked (const KeyType &key) |
| Remove item with lock. | |
Additional Inherited Members | |
Public Attributes inherited from std::map< K, T > | |
| K | keys |
| STL member. | |
| T | elements |
| STL member. | |
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.