fawkes::RWLockMap< KeyType, ValueType, LessKey > Class Template Reference
[Fawkes Core Library]
Hash map with a lock.
More...
#include <core/utils/rwlock_map.h>
Inheritance diagram for fawkes::RWLockMap< KeyType, ValueType, LessKey >:

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. | |
Detailed Description
template<typename KeyType, typename ValueType, typename LessKey = std::less<KeyType>>
class fawkes::RWLockMap< KeyType, ValueType, LessKey >
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.
- See also:
- ReadWriteLock
Definition at line 37 of file rwlock_map.h.
Constructor & Destructor Documentation
template<typename KeyType , typename ValueType , typename LessKey >
| fawkes::RWLockMap< KeyType, ValueType, LessKey >::RWLockMap | ( | ) | [inline] |
template<typename KeyType , typename ValueType , typename LessKey >
| fawkes::RWLockMap< KeyType, ValueType, LessKey >::RWLockMap | ( | const RWLockMap< KeyType, ValueType, LessKey > & | lm | ) | [inline] |
template<typename KeyType , typename ValueType , typename LessKey >
| fawkes::RWLockMap< KeyType, ValueType, LessKey >::~RWLockMap | ( | ) | [inline, virtual] |
Member Function Documentation
template<typename KeyType , typename ValueType , typename LessKey >
| void fawkes::RWLockMap< KeyType, ValueType, LessKey >::erase_locked | ( | const KeyType & | key | ) | [inline] |
Remove item with lock.
The map is automatically locked and unlocked during the removal.
- Parameters:
-
key key of the value to erase
Definition at line 147 of file rwlock_map.h.
template<typename KeyType , typename ValueType , typename LessKey >
| void fawkes::RWLockMap< KeyType, ValueType, LessKey >::lock_for_read | ( | ) | [inline] |
template<typename KeyType , typename ValueType , typename LessKey >
| void fawkes::RWLockMap< KeyType, ValueType, LessKey >::lock_for_write | ( | ) | [inline] |
template<typename KeyType , typename ValueType , typename LessKey >
| RefPtr< ReadWriteLock > fawkes::RWLockMap< KeyType, ValueType, LessKey >::rwlock | ( | ) | const [inline] |
Get access to the internal rwlock.
Can be used with RwlockLocker.
- Returns:
- internal rwlock
Definition at line 161 of file rwlock_map.h.
template<typename KeyType , typename ValueType , typename LessKey >
| bool fawkes::RWLockMap< KeyType, ValueType, LessKey >::try_lock_for_read | ( | ) | [inline] |
Try to lock list for reading.
- Returns:
- true, if the lock has been aquired, false otherwise.
Definition at line 115 of file rwlock_map.h.
template<typename KeyType , typename ValueType , typename LessKey >
| bool fawkes::RWLockMap< KeyType, ValueType, LessKey >::try_lock_for_write | ( | ) | [inline] |
Try to lock list for writing.
- Returns:
- true, if the lock has been aquired, false otherwise.
Definition at line 126 of file rwlock_map.h.
template<typename KeyType , typename ValueType , typename LessKey >
| void fawkes::RWLockMap< KeyType, ValueType, LessKey >::unlock | ( | ) | [inline] |
The documentation for this class was generated from the following file:
- src/libs/core/utils/rwlock_map.h

