|
| | hamt_map (database const &db, typed_address< header_block > pos=typed_address< header_block >::null(), Hash const &hash=Hash(), KeyEqual const &equal=KeyEqual()) |
| | An associative container that contains key-value pairs with unique keys. More...
|
| |
|
| hamt_map (hamt_map const &)=delete |
| |
|
| hamt_map (hamt_map &&) noexcept=delete |
| |
|
hamt_map & | operator= (hamt_map const &)=delete |
| |
|
hamt_map & | operator= (hamt_map &&) noexcept=delete |
| |
| typed_address< header_block > | flush (transaction_base &transaction, unsigned generation) |
| | Flush any modified index nodes to the store. More...
|
| |
|
template<typename OtherValueType > |
| auto | insert_or_upsert (transaction_base &transaction, OtherValueType const &value, bool is_upsert) -> std::pair< iterator, bool > |
| |
|
template<typename OtherKeyType , typename > |
| auto | find (database const &db, OtherKeyType const &key) const -> const_iterator |
| |
|
|
range< database, hamt_map, iterator > | make_range (database &db) |
| |
|
range< database const, hamt_map const, const_iterator > | make_range (database const &db) const |
| |
|
iterator | begin (database &db) |
| | Returns an iterator to the beginning of the container.
|
| |
|
const_iterator | begin (database const &db) const |
| |
|
const_iterator | cbegin (database const &db) const |
| |
|
iterator | end (database &db) |
| | Returns an iterator to the end of the container.
|
| |
|
const_iterator | end (database const &db) const |
| |
|
const_iterator | cend (database const &db) const |
| |
|
|
bool | empty () const noexcept |
| | Checks whether the container is empty.
|
| |
|
std::size_t | size () const noexcept |
| | Returns the number of elements.
|
| |
|
| template<typename OtherKeyType , typename OtherValueType , typename = typename std::enable_if< pair_types_compatible<OtherKeyType, OtherValueType>::value>::type> |
| auto | insert (transaction_base &transaction, std::pair< OtherKeyType, OtherValueType > const &value) -> std::pair< iterator, bool > |
| | Inserts an element into the hamt_map if the hamt_map doesn't already contain an element with an equivalent key. More...
|
| |
| template<typename OtherKeyType , typename OtherValueType , typename = typename std::enable_if< pair_types_compatible<OtherKeyType, OtherValueType>::value>::type> |
| auto | insert_or_assign (transaction_base &transaction, std::pair< OtherKeyType, OtherValueType > const &value) -> std::pair< iterator, bool > |
| | If a key equivalent to value first already exists in the container, assigns value second to the mapped type. More...
|
| |
| template<typename OtherKeyType , typename OtherValueType , typename = typename std::enable_if< pair_types_compatible<OtherKeyType, OtherValueType>::value>::type> |
| auto | insert_or_assign (transaction_base &transaction, OtherKeyType const &key, OtherValueType const &value) -> std::pair< iterator, bool > |
| | If a key equivalent to key already exists in the container, assigns value to the mapped type. More...
|
| |
|
| template<typename OtherKeyType , typename = typename std::enable_if< serialize::is_compatible<OtherKeyType, KeyType>::value>::type> |
| const_iterator | find (database const &db, OtherKeyType const &key) const |
| | Finds an element with key equivalent to key. More...
|
| |
| template<typename OtherKeyType , typename = typename std::enable_if< serialize::is_compatible<OtherKeyType, KeyType>::value>::type> |
| bool | contains (database const &db, OtherKeyType const &key) const |
| | Checks if there is an element with key equivalent to key in the container. More...
|
| |
|
Provide access to index internals.
|
|
value_type | load_leaf_node (database const &db, address addr) const |
| | Read a leaf node from a store.
|
| |
|
index_pointer | root () const noexcept |
| | Returns the index root pointer.
|
| |
template<typename KeyType, typename ValueType, typename Hash, typename KeyEqual>
class pstore::index::hamt_map< KeyType, ValueType, Hash, KeyEqual >
A Hash array mapped trie index type for the pstore.
- Template Parameters
-
| KeyType | The map key type. |
| ValueType | The map value type. |
| Hash | A function which produces the hash of a supplied key. The signature must be compatible with: index::details::hash_type(KeyType) |
| KeyEqual | A function used to compare keys for equality. The signature must be compatible with: bool(KeyType, KeyType) |
template<typename KeyType , typename ValueType , typename Hash , typename KeyEqual >
template<typename OtherKeyType , typename OtherValueType , typename >
Inserts an element into the hamt_map if the hamt_map doesn't already contain an element with an equivalent key.
If insertion occurs, all iterators are invalidated.
- Template Parameters
-
| OtherKeyType | A type whose serialized representation is compatible with KeyType. |
| OtherValueType | A type whose serialized representation is compatible with ValueType. |
- Parameters
-
| transaction | The transaction to which the new key-value pair will be appended. |
| value | The key-value pair to be inserted. |
- Returns
- The bool component is true if the insertion took place and false if the assignment took place. The iterator component points at the exiting or new element.
template<typename KeyType , typename ValueType , typename Hash , typename KeyEqual >
template<typename OtherKeyType , typename OtherValueType , typename >
If a key equivalent to value first already exists in the container, assigns value second to the mapped type.
If the key does not exist, inserts the new value as if by insert(). If insertion occurs, all iterators are invalidated.
- Template Parameters
-
| OtherKeyType | A type whose serialized representation is compatible with KeyType. |
| OtherValueType | A type whose serialized representation is compatible with ValueType. |
- Parameters
-
| transaction | The transaction to which new data will be appended. |
| value | The key-value pair to be inserted or updated. |
- Returns
- The bool component is true if the insertion took place and false if the assignment took place. The iterator component points at the element inserted or updated.
template<typename KeyType , typename ValueType , typename Hash , typename KeyEqual >
template<typename OtherKeyType , typename OtherValueType , typename >
If a key equivalent to key already exists in the container, assigns value to the mapped type.
If the key does not exist, inserts the new value as if by insert(). If insertion occurs, all iterators are invalidated.
- Template Parameters
-
| OtherKeyType | A type whose serialized representation is compatible with KeyType. |
| OtherValueType | A type whose serialized representation is compatible with ValueType. |
- Parameters
-
| transaction | The transaction to which new data will be appended. |
| key | The key the used both to look up and to insert if not found. |
| value | The value that will be associated with 'key' after the call. |
- Returns
- The bool component is true if the insertion took place and false if the assignment took place. The iterator component points at the element inserted or updated.