Definition at line 240 of file rcu_map.hpp.
Public Types | |
| using | Hash |
| using | KeyEqual |
| using | MutexType |
| using | ValuePtr |
| using | Iterator |
| using | ConstValuePtr |
| using | ConstIterator |
| using | RawMap |
| using | Snapshot |
| using | InsertReturnType |
Public Member Functions | |
| RcuMap< K, V, RcuMapTraits >::InsertReturnType | Emplace (const K &key, Args &&... args) |
| RcuMap< K, V, RcuMapTraits >::InsertReturnType | TryEmplace (const K &key, Args &&... args) |
| RcuMap ()=default | |
| RcuMap (const RcuMap &)=delete | |
| RcuMap (RcuMap &&)=delete | |
| RcuMap & | operator= (const RcuMap &)=delete |
| RcuMap & | operator= (RcuMap &&)=delete |
| size_t | SizeApprox () const |
| Returns an estimated size of the map at some point in time. | |
| const ConstValuePtr | operator[] (const K &) const |
| Returns a readonly value pointer by its key if exists. | |
| const ValuePtr | operator[] (const K &) |
| Returns a modifiable value pointer by key if exists or default-creates one. | |
| InsertReturnType | Insert (const K &key, ValuePtr value) |
| Inserts a new element into the container if there is no element with the key in the container. Returns a pair consisting of a pointer to the inserted element, or the already-existing element if no insertion happened, and a bool denoting whether the insertion took place. | |
| InsertReturnType | Emplace (const K &key, Args &&... args) |
| Inserts a new element into the container constructed in-place with the given args if there is no element with the key in the container. Returns a pair consisting of a pointer to the inserted element, or the already-existing element if no insertion happened, and a bool denoting whether the insertion took place. | |
| RcuMap< K, V, RcuMapTraits >::InsertReturnType | Emplace (const K &key, Args &&... args) |
| InsertReturnType | TryEmplace (const K &key, Args &&... args) |
If a key equivalent to key already exists in the container, does nothing. Otherwise, behaves like Emplace except that the element is constructed as std::make_shared<Value>(std::piecewise_construct, / std::forward_as_tuple(key), / std::forward_as_tuple(std::forward<Args>(args)...)). Returns a pair consisting of a pointer to the inserted element, or the already-existing element if no insertion happened, and a bool denoting whether the insertion took place. | |
| RcuMap< K, V, RcuMapTraits >::InsertReturnType | TryEmplace (const K &key, Args &&... args) |
| void | InsertOrAssign (RawKey &&key, ValuePtr value) |
If a key equivalent to key already exists in the container, replaces the associated value. Otherwise, inserts a new pair into the map. | |
| const ConstValuePtr | Get (const K &) const |
| Returns a readonly value pointer by its key or an empty pointer. | |
| const ValuePtr | Get (const K &) |
| Returns a modifiable value pointer by key or an empty pointer. | |
| bool | Erase (const K &) |
| Removes a key from the map. | |
| ValuePtr | Pop (const K &) |
| Removes a key from the map returning its value. | |
| void | Clear () |
| Resets the map to an empty state. | |
| void | Assign (RawMap new_map) |
Replace current data by data from new_map. | |
| rcu::WritablePtr< RawMap, RcuTraits > | StartWrite () |
| Starts a transaction, used to perform a series of arbitrary changes to the map. | |
| Snapshot | GetSnapshot () const |
| Returns a readonly copy of the map. | |
Iteration support | |
Keyset is fixed at the start of the iteration and is not affected by concurrent changes. | |
| ConstIterator | begin () const |
| Iterator | begin () |
| ConstIterator | end () const |
| Iterator | end () |
Public Attributes | |
| ValuePtrType | value |
| bool | inserted |
| using rcu::RcuMap< K, V, RcuMapTraits >::ConstIterator |
Definition at line 132 of file rcu_map.hpp.
| using rcu::RcuMap< K, V, RcuMapTraits >::ConstValuePtr |
Definition at line 131 of file rcu_map.hpp.
| using rcu::RcuMap< K, V, RcuMapTraits >::Hash |
Definition at line 126 of file rcu_map.hpp.
| using rcu::RcuMap< K, V, RcuMapTraits >::InsertReturnType |
Definition at line 135 of file rcu_map.hpp.
| using rcu::RcuMap< K, V, RcuMapTraits >::Iterator |
Definition at line 130 of file rcu_map.hpp.
| using rcu::RcuMap< K, V, RcuMapTraits >::KeyEqual |
Definition at line 127 of file rcu_map.hpp.
| using rcu::RcuMap< K, V, RcuMapTraits >::MutexType |
Definition at line 128 of file rcu_map.hpp.
| using rcu::RcuMap< K, V, RcuMapTraits >::RawMap |
Definition at line 133 of file rcu_map.hpp.
| using rcu::RcuMap< K, V, RcuMapTraits >::Snapshot |
Definition at line 134 of file rcu_map.hpp.
| using rcu::RcuMap< K, V, RcuMapTraits >::ValuePtr |
Definition at line 129 of file rcu_map.hpp.
| void rcu::RcuMap< K, V, RcuMapTraits >::Assign | ( | RawMap | new_map | ) |
Replace current data by data from new_map.
Definition at line 220 of file rcu_map.hpp.
| RcuMap< K, V, RcuMapTraits >::Iterator rcu::RcuMap< K, V, RcuMapTraits >::begin | ( | ) |
Definition at line 153 of file rcu_map.hpp.
| RcuMap< K, V, RcuMapTraits >::ConstIterator rcu::RcuMap< K, V, RcuMapTraits >::begin | ( | ) | const |
Definition at line 151 of file rcu_map.hpp.
| void rcu::RcuMap< K, V, RcuMapTraits >::Clear | ( | ) |
Resets the map to an empty state.
Definition at line 217 of file rcu_map.hpp.
| InsertReturnType rcu::RcuMap< K, V, RcuMapTraits >::Emplace | ( | const K & | key, |
| Args &&... | args ) |
Inserts a new element into the container constructed in-place with the given args if there is no element with the key in the container. Returns a pair consisting of a pointer to the inserted element, or the already-existing element if no insertion happened, and a bool denoting whether the insertion took place.
| RcuMap< K, V, RcuMapTraits >::InsertReturnType rcu::RcuMap< K, V, RcuMapTraits >::Emplace | ( | const K & | key, |
| Args &&... | args ) |
Definition at line 331 of file rcu_map.hpp.
| RcuMap< K, V, RcuMapTraits >::InsertReturnType rcu::RcuMap< K, V, RcuMapTraits >::Emplace | ( | const K & | key, |
| Args &&... | args ) |
Definition at line 331 of file rcu_map.hpp.
| RcuMap< K, V, RcuMapTraits >::Iterator rcu::RcuMap< K, V, RcuMapTraits >::end | ( | ) |
Definition at line 154 of file rcu_map.hpp.
| RcuMap< K, V, RcuMapTraits >::ConstIterator rcu::RcuMap< K, V, RcuMapTraits >::end | ( | ) | const |
Definition at line 152 of file rcu_map.hpp.
| bool rcu::RcuMap< K, V, RcuMapTraits >::Erase | ( | const K & | ) |
Removes a key from the map.
Definition at line 209 of file rcu_map.hpp.
| RcuMap< K, V, RcuMapTraits >::Snapshot rcu::RcuMap< K, V, RcuMapTraits >::GetSnapshot | ( | ) | const |
Returns a readonly copy of the map.
{begin(), end()} construct, preferable for long-running operations. Definition at line 230 of file rcu_map.hpp.
| RcuMap< K, V, RcuMapTraits >::InsertReturnType rcu::RcuMap< K, V, RcuMapTraits >::Insert | ( | const K & | key, |
| ValuePtr | value ) |
Inserts a new element into the container if there is no element with the key in the container. Returns a pair consisting of a pointer to the inserted element, or the already-existing element if no insertion happened, and a bool denoting whether the insertion took place.
Definition at line 172 of file rcu_map.hpp.
| void rcu::RcuMap< K, V, RcuMapTraits >::InsertOrAssign | ( | RawKey && | key, |
| RcuMap::ValuePtr | value ) |
If a key equivalent to key already exists in the container, replaces the associated value. Otherwise, inserts a new pair into the map.
Definition at line 198 of file rcu_map.hpp.
| const ValuePtr rcu::RcuMap< K, V, RcuMapTraits >::operator[] | ( | const K & | ) |
Returns a modifiable value pointer by key if exists or default-creates one.
| const ConstValuePtr rcu::RcuMap< K, V, RcuMapTraits >::operator[] | ( | const K & | ) | const |
Returns a readonly value pointer by its key if exists.
| MissingKeyException | if the key is not present |
| RcuMap< K, V, RcuMapTraits >::ValuePtr rcu::RcuMap< K, V, RcuMapTraits >::Pop | ( | const K & | ) |
Removes a key from the map returning its value.
Definition at line 214 of file rcu_map.hpp.
| size_t rcu::RcuMap< K, V, RcuMapTraits >::SizeApprox | ( | ) | const |
Returns an estimated size of the map at some point in time.
Definition at line 145 of file rcu_map.hpp.
| auto rcu::RcuMap< K, V, RcuMapTraits >::StartWrite | ( | ) |
Starts a transaction, used to perform a series of arbitrary changes to the map.
The map is copied. Don't forget to Commit to apply the changes.
Definition at line 225 of file rcu_map.hpp.
| RcuMap< K, V, RcuMapTraits >::InsertReturnType rcu::RcuMap< K, V, RcuMapTraits >::TryEmplace | ( | const K & | key, |
| Args &&... | args ) |
Definition at line 359 of file rcu_map.hpp.
| RcuMap< K, V, RcuMapTraits >::InsertReturnType rcu::RcuMap< K, V, RcuMapTraits >::TryEmplace | ( | const K & | key, |
| Args &&... | args ) |
Definition at line 359 of file rcu_map.hpp.
| bool rcu::RcuMap< Key, Value, RcuMapTraits >::InsertReturnTypeImpl< ValuePtrType >::inserted |
Definition at line 242 of file rcu_map.hpp.
| ValuePtrType rcu::RcuMap< Key, Value, RcuMapTraits >::InsertReturnTypeImpl< ValuePtrType >::value |
Definition at line 241 of file rcu_map.hpp.