|
Value | at (Key const &key, Value const &default_value) |
|
void | insert (Key const &key, Value const &value) |
|
void | erase (Key const &key) |
|
◆ bucket_data
template<typename Key , typename Value , typename Hash = std::hash<Key>>
◆ bucket_iterator
template<typename Key , typename Value , typename Hash = std::hash<Key>>
typedef bucket_data::iterator LockedLookupTable< Key, Value, Hash >::bucket_type::bucket_iterator |
◆ bucket_value
template<typename Key , typename Value , typename Hash = std::hash<Key>>
typedef std::pair<Key, Value> LockedLookupTable< Key, Value, Hash >::bucket_type::bucket_value |
|
private |
◆ at()
template<typename Key , typename Value , typename Hash = std::hash<Key>>
Value LockedLookupTable< Key, Value, Hash >::bucket_type::at |
( |
Key const & |
key, |
|
|
Value const & |
default_value |
|
) |
| |
|
inline |
139 {
140 boost::shared_lock<boost::shared_mutex> lock(
_mutex);
142 return (found_entry ==
data.end()) ? default_value : found_entry->second;
143 }
bucket_data data
Definition: LockedLookupTable.hpp:164
bucket_data::iterator bucket_iterator
Definition: LockedLookupTable.hpp:136
bucket_iterator find_entry_for(Key const &key)
Definition: LockedLookupTable.hpp:168
boost::shared_mutex _mutex
Definition: LockedLookupTable.hpp:165
References LockedLookupTable< Key, Value, Hash >::bucket_type::_mutex, LockedLookupTable< Key, Value, Hash >::bucket_type::data, and LockedLookupTable< Key, Value, Hash >::bucket_type::find_entry_for().
Referenced by LockedLookupTable< Key, Value, Hash >::at().
◆ erase()
template<typename Key , typename Value , typename Hash = std::hash<Key>>
157 {
158 boost::unique_lock<boost::shared_mutex> lock(
_mutex);
160 if (found_entry !=
data.end())
161 data.erase(found_entry);
162 }
References LockedLookupTable< Key, Value, Hash >::bucket_type::_mutex, LockedLookupTable< Key, Value, Hash >::bucket_type::data, and LockedLookupTable< Key, Value, Hash >::bucket_type::find_entry_for().
Referenced by LockedLookupTable< Key, Value, Hash >::erase().
◆ find_entry_for()
template<typename Key , typename Value , typename Hash = std::hash<Key>>
169 {
170 return std::find_if(
data.begin(),
data.end(),
172 {
173 return item.first == key;
174 });
175 }
std::pair< Key, Value > bucket_value
Definition: LockedLookupTable.hpp:132
References LockedLookupTable< Key, Value, Hash >::bucket_type::data.
Referenced by LockedLookupTable< Key, Value, Hash >::bucket_type::at(), LockedLookupTable< Key, Value, Hash >::bucket_type::erase(), and LockedLookupTable< Key, Value, Hash >::bucket_type::insert().
◆ insert()
template<typename Key , typename Value , typename Hash = std::hash<Key>>
void LockedLookupTable< Key, Value, Hash >::bucket_type::insert |
( |
Key const & |
key, |
|
|
Value const & |
value |
|
) |
| |
|
inline |
146 {
147 boost::unique_lock<boost::shared_mutex> lock(
_mutex);
149
150 if (found_entry !=
data.end())
151 data.erase(found_entry);
152
154 }
References LockedLookupTable< Key, Value, Hash >::bucket_type::_mutex, LockedLookupTable< Key, Value, Hash >::bucket_type::data, and LockedLookupTable< Key, Value, Hash >::bucket_type::find_entry_for().
Referenced by LockedLookupTable< Key, Value, Hash >::insert().
◆ _mutex
template<typename Key , typename Value , typename Hash = std::hash<Key>>
◆ data
template<typename Key , typename Value , typename Hash = std::hash<Key>>
Referenced by LockedLookupTable< Key, Value, Hash >::bucket_type::at(), LockedLookupTable< Key, Value, Hash >::bucket_type::erase(), LockedLookupTable< Key, Value, Hash >::bucket_type::find_entry_for(), and LockedLookupTable< Key, Value, Hash >::bucket_type::insert().
The documentation for this class was generated from the following file: