|
| Value & | at (const Key &key, const std::string &what_arg="Key not found") |
| | Access specified element with bounds checking.
|
| |
| auto | find (const Key &key, const std::string &what_arg={}) |
| | Finds an element with a specific key.
|
| |
| Value & | operator[] (const Key &key) |
| | Access or insert specified element.
|
| |
| std::size_t | erase (const Key &key) |
| | Removes the element with the specified key.
|
| |
| std::map< Key, Value >::iterator | erase (typename std::map< Key, Value >::iterator position) |
| | Removes the element at the specified position.
|
| |
| std::size_t | count (const Key &key) const |
| | Returns the number of elements matching specific key.
|
| |
| std::pair< typename std::map< Key, Value >::iterator, bool > | insert (const Key &key, const Value &value) |
| |
| std::pair< typename std::map< Key, Value >::iterator, bool > | insert (const std::pair< Key, Value > &pair) |
| | Inserts a new element or assigns to the current element if the key already exists.
|
| |
| lock_guard | get_lock_guard () const |
| | Acquires a lock guard for the set, ensuring thread safety.
|
| |
| | thread_safe_container ()=default |
| | Default constructor.
|
| |
| virtual | ~thread_safe_container () noexcept |
| |
| bool | empty () const |
| | Checks if the container is empty.
|
| |
| void | clear () |
| | Clears the contents.
|
| |
| std::size_t | size () const |
| | Returns the number of elements.
|
| |
| auto | begin () |
| | Returns an iterator to the beginning.
|
| |
| auto | end () |
| | Returns an iterator to the end.
|
| |
| bool | is_being_modified () const |
| |
template<typename Key, typename Value>
class cbeam::container::thread_safe_map< Key, Value >
Thread-safe wrapper for std::map.
- Template Parameters
-
| Key | Type of the keys |
| Value | Type of the values |