Fawkes API
Fawkes Development Version
|
#include <>>
Public Types | |
typedef std::set< KeyType, LessKey >::iterator | iterator |
Iterator. More... | |
Public Member Functions | |
LockSet () | |
Constructor. More... | |
LockSet (const LockSet< KeyType, LessKey > &lm) | |
Copy constructor. More... | |
virtual | ~LockSet () |
Destructor. More... | |
void | lock () const |
Lock list. More... | |
bool | try_lock () const |
Try to lock list. More... | |
void | unlock () const |
Unlock list. More... | |
RefPtr< Mutex > | mutex () const |
Get access to the internal mutex. More... | |
std::pair< iterator, bool > | insert_locked (const KeyType &key) |
Insert item with lock. More... | |
void | erase_locked (const KeyType &key) |
Remove item with lock. More... | |
LockSet< KeyType, LessKey > & | operator= (const LockSet< KeyType, LessKey > &ll) |
Copy values from another LockSet. More... | |
LockSet< KeyType, LessKey > & | operator= (const std::set< KeyType, LessKey > &l) |
Copy values from a standard set. More... | |
Set with a lock. This class provides a set that has an intrinsic lock. The lock can be applied with the regular locking methods.
Definition at line 41 of file lock_set.h.
typedef std::set<KeyType, LessKey>::iterator fawkes::LockSet< KeyType, LessKey >::iterator |
Iterator.
Definition at line 60 of file lock_set.h.
fawkes::LockSet< KeyType, LessKey >::LockSet | ( | ) |
Constructor.
Definition at line 78 of file lock_set.h.
fawkes::LockSet< KeyType, LessKey >::LockSet | ( | const LockSet< KeyType, LessKey > & | lm | ) |
|
virtual |
Destructor.
Definition at line 93 of file lock_set.h.
void fawkes::LockSet< KeyType, LessKey >::erase_locked | ( | const KeyType & | key | ) |
Remove item with lock.
The set is automatically locked and unlocked during the removal.
key | key of the value to erase |
Definition at line 144 of file lock_set.h.
std::pair< typename LockSet< KeyType, LessKey >::iterator, bool > fawkes::LockSet< KeyType, LessKey >::insert_locked | ( | const KeyType & | key | ) |
Insert item with lock.
The set is automatically locked and unlocked during the removal.
key | key of the value to insert |
Definition at line 130 of file lock_set.h.
void fawkes::LockSet< KeyType, LessKey >::lock | ( | ) | const |
Lock list.
Definition at line 100 of file lock_set.h.
Referenced by fawkes::LockSet< std::string >::mutex(), fawkes::LockSet< std::string >::unlock(), and fawkes::LockSet< std::string >::~LockSet().
RefPtr< Mutex > fawkes::LockSet< KeyType, LessKey >::mutex | ( | ) | const |
Get access to the internal mutex.
Can be used with MutexLocker.
Definition at line 157 of file lock_set.h.
LockSet< KeyType, LessKey > & fawkes::LockSet< KeyType, LessKey >::operator= | ( | const LockSet< KeyType, LessKey > & | ll | ) |
Copy values from another LockSet.
Copies the values one by one. Both instances are locked during the copying and this instance is cleared before copying.
ll | lock set to copy |
Definition at line 170 of file lock_set.h.
LockSet< KeyType, LessKey > & fawkes::LockSet< KeyType, LessKey >::operator= | ( | const std::set< KeyType, LessKey > & | l | ) |
Copy values from a standard set.
Copies the values one by one. This instance is locked during the copying and cleared.
l | set to copy |
Definition at line 193 of file lock_set.h.
bool fawkes::LockSet< KeyType, LessKey >::try_lock | ( | ) | const |
Try to lock list.
Definition at line 110 of file lock_set.h.
Referenced by fawkes::LockSet< std::string >::lock().
void fawkes::LockSet< KeyType, LessKey >::unlock | ( | ) | const |
Unlock list.
Definition at line 118 of file lock_set.h.
Referenced by fawkes::LockSet< std::string >::try_lock().