Fawkes API
Fawkes Development Version
|
Map with a lock. More...
#include <>>
Public Member Functions | |
LockMap () | |
Constructor. | |
LockMap (const LockMap< KeyType, ValueType, LessKey > &lm) | |
Copy constructor. | |
virtual | ~LockMap () |
Destructor. | |
void | lock () const |
Lock list. | |
bool | try_lock () const |
Try to lock list. | |
void | unlock () const |
Unlock list. | |
RefPtr< Mutex > | mutex () const |
Get access to the internal mutex. | |
void | erase_locked (const KeyType &key) |
Remove item with lock. | |
LockMap< KeyType, ValueType, LessKey > & | operator= (const LockMap< KeyType, ValueType, LessKey > &ll) |
Copy values from another LockMap. | |
LockMap< KeyType, ValueType, LessKey > & | operator= (const std::map< KeyType, ValueType, LessKey > &l) |
Copy values from a standard map. |
Map with a lock.
This class provides a map that has an intrinsic lock. The lock can be applied with the regular locking methods.
fawkes::LockMap::LockMap | ( | ) |
Constructor.
Definition at line 76 of file lock_map.h.
fawkes::LockMap::LockMap | ( | const LockMap< KeyType, ValueType, LessKey > & | lm | ) |
fawkes::LockMap::~LockMap | ( | ) | [virtual] |
Destructor.
Definition at line 93 of file lock_map.h.
void fawkes::LockMap::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 132 of file lock_map.h.
Referenced by fawkes::PluginManager::load(), fawkes::PluginManager::unload(), and fawkes::BlackBoardNetworkHandler::client_disconnected().
void fawkes::LockMap::lock | ( | ) | const |
Lock list.
Definition at line 100 of file lock_map.h.
Referenced by fawkes::PluginManager::get_loaded_plugins(), fawkes::PluginManager::load(), fawkes::PluginManager::unload(), fawkes::BlackBoardNetworkHandler::loop(), fawkes::BlackBoardNetworkHandler::client_disconnected(), fawkes::FawkesNetworkClient::register_handler(), fawkes::FawkesNetworkClient::deregister_handler(), fawkes::FawkesNetworkServerThread::add_handler(), fawkes::FawkesNetworkServerThread::remove_handler(), fawkes::FawkesNetworkServerThread::loop(), fawkes::FawkesNetworkServerThread::force_send(), fawkes::WorldInfoDataContainer::check_timeout(), WorldModelNetworkThread::loop(), WorldModelNetworkThread::pose_rcvd(), WorldModelNetworkThread::ball_pos_rcvd(), WorldModelNetworkThread::global_ball_pos_rcvd(), WorldModelNetworkThread::opponent_pose_rcvd(), WorldModelNetworkThread::opponent_disapp_rcvd(), FvBaseThread::finalize(), FvBaseThread::loop(), FvBaseThread::register_for_camera(), FvBaseThread::register_for_raw_camera(), and FvBaseThread::unregister_thread().
Get access to the internal mutex.
Can be used with MutexLocker.
Definition at line 146 of file lock_map.h.
Referenced by fawkes::PluginManager::load(), and FvBaseThread::acquire_camctrl().
LockMap< KeyType, ValueType, LessKey > & fawkes::LockMap::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 161 of file lock_map.h.
LockMap< KeyType, ValueType, LessKey > & fawkes::LockMap::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 185 of file lock_map.h.
bool fawkes::LockMap::try_lock | ( | ) | const |
Try to lock list.
Definition at line 111 of file lock_map.h.
void fawkes::LockMap::unlock | ( | ) | const |
Unlock list.
Definition at line 120 of file lock_map.h.
Referenced by fawkes::PluginManager::get_loaded_plugins(), fawkes::PluginManager::load(), fawkes::PluginManager::unload(), fawkes::BlackBoardNetworkHandler::loop(), fawkes::BlackBoardNetworkHandler::client_disconnected(), fawkes::FawkesNetworkClient::register_handler(), fawkes::FawkesNetworkClient::deregister_handler(), fawkes::FawkesNetworkServerThread::add_handler(), fawkes::FawkesNetworkServerThread::remove_handler(), fawkes::FawkesNetworkServerThread::loop(), fawkes::FawkesNetworkServerThread::force_send(), fawkes::WorldInfoDataContainer::opponent_disappeared(), WorldModelNetworkThread::loop(), WorldModelNetworkThread::pose_rcvd(), WorldModelNetworkThread::ball_pos_rcvd(), WorldModelNetworkThread::global_ball_pos_rcvd(), WorldModelNetworkThread::opponent_pose_rcvd(), WorldModelNetworkThread::opponent_disapp_rcvd(), FvBaseThread::finalize(), FvBaseThread::loop(), FvBaseThread::register_for_camera(), FvBaseThread::register_for_raw_camera(), and FvBaseThread::unregister_thread().