Fawkes API
Fawkes Development Version
|
#include <>>
Public Member Functions | |
LockMap () | |
Constructor. More... | |
LockMap (const LockMap< KeyType, ValueType, LessKey > &lm) | |
Copy constructor. More... | |
virtual | ~LockMap () |
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... | |
void | erase_locked (const KeyType &key) |
Remove item with lock. More... | |
LockMap< KeyType, ValueType, LessKey > & | operator= (const LockMap< KeyType, ValueType, LessKey > &ll) |
Copy values from another LockMap. More... | |
LockMap< KeyType, ValueType, LessKey > & | operator= (const std::map< KeyType, ValueType, LessKey > &l) |
Copy values from a standard map. More... | |
Map with a lock. This class provides a map that has an intrinsic lock. The lock can be applied with the regular locking methods.
Definition at line 41 of file lock_map.h.
fawkes::LockMap< KeyType, ValueType, LessKey >::LockMap |
Constructor.
Definition at line 75 of file lock_map.h.
fawkes::LockMap< KeyType, ValueType, LessKey >::LockMap | ( | const LockMap< KeyType, ValueType, LessKey > & | lm | ) |
|
virtual |
Destructor.
Definition at line 90 of file lock_map.h.
void fawkes::LockMap< 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 126 of file lock_map.h.
Referenced by fawkes::PluginManager::load().
void fawkes::LockMap< KeyType, ValueType, LessKey >::lock |
Lock list.
Definition at line 97 of file lock_map.h.
Referenced by FvBaseThread::finalize(), fawkes::PluginManager::load(), FvBaseThread::loop(), fawkes::LockMap< unsigned int, FawkesNetworkClientHandler * >::mutex(), fawkes::BlackBoardInterfaceManager::num_readers(), FvBaseThread::register_for_camera(), FvBaseThread::register_for_raw_camera(), fawkes::LockMap< unsigned int, FawkesNetworkClientHandler * >::unlock(), FvBaseThread::unregister_thread(), and fawkes::LockMap< unsigned int, FawkesNetworkClientHandler * >::~LockMap().
RefPtr< Mutex > fawkes::LockMap< KeyType, ValueType, LessKey >::mutex |
Get access to the internal mutex.
Can be used with MutexLocker.
Definition at line 139 of file lock_map.h.
Referenced by FvBaseThread::acquire_camctrl(), and MetricsThread::init().
LockMap< KeyType, ValueType, LessKey > & fawkes::LockMap< KeyType, ValueType, LessKey >::operator= | ( | const LockMap< KeyType, ValueType, LessKey > & | ll | ) |
Copy values from another LockMap.
Copies the values one by one. Both instances are locked during the copying and this instance is cleared before copying.
ll | map to copy |
Definition at line 152 of file lock_map.h.
LockMap< KeyType, ValueType, LessKey > & fawkes::LockMap< KeyType, ValueType, LessKey >::operator= | ( | const std::map< KeyType, ValueType, LessKey > & | l | ) |
Copy values from a standard map.
Copies the values one by one. This instance is locked during the copying and cleared.
l | map to copy |
Definition at line 175 of file lock_map.h.
bool fawkes::LockMap< KeyType, ValueType, LessKey >::try_lock |
Try to lock list.
Definition at line 107 of file lock_map.h.
Referenced by fawkes::LockMap< unsigned int, FawkesNetworkClientHandler * >::lock().
void fawkes::LockMap< KeyType, ValueType, LessKey >::unlock |
Unlock list.
Definition at line 115 of file lock_map.h.
Referenced by FvBaseThread::finalize(), fawkes::PluginManager::load(), FvBaseThread::loop(), FvBaseThread::register_for_camera(), FvBaseThread::register_for_raw_camera(), fawkes::LockMap< unsigned int, FawkesNetworkClientHandler * >::try_lock(), and FvBaseThread::unregister_thread().