|
| string_key_store (const allocator_type &allocator=allocator_type()) |
| Constructor.
|
|
| string_key_store (const bool unique, const uint64_t hash_seed, const allocator_type &allocator=allocator_type()) |
| Constructor.
|
|
| string_key_store (const string_key_store &)=default |
| Copy constructor.
|
|
| string_key_store (const string_key_store &other, const allocator_type &alloc) |
| Allocator-extended copy constructor.
|
|
| string_key_store (string_key_store &&) noexcept=default |
| Move constructor.
|
|
| string_key_store (string_key_store &&other, const allocator_type &alloc) noexcept |
| Allocator-extended move constructor.
|
|
string_key_store & | operator= (const string_key_store &)=default |
| Copy assignment operator.
|
|
string_key_store & | operator= (string_key_store &&) noexcept=default |
| Move assignment operator.
|
|
bool | insert (const key_type &key) |
| Inserts a key with the default value. If the unique parameter in the constructor was set to true and a duplicate key item already exists, this function does nothing and returns false.
|
|
bool | insert (const key_type &key, const value_type &value) |
| Inserts an item. Suppose the unique parameter was set to true in the constructor and a duplicate key item exists. In that case, this function just updates the value of the existing one.
|
|
bool | insert (const key_type &key, value_type &&value) |
| Insert() with move operator version.
|
|
void | clear () |
| Clear all contents. This call does not reduce the memory usage.
|
|
std::size_t | count (const key_type &key) const |
| Counts the number of items associated with the key.
|
|
std::size_t | size () const |
| Returns the number of elements in this container.
|
|
const key_type | key (const locator_type &position) const |
| Returns the key of the element at 'position'.
|
|
value_type & | value (const locator_type &position) |
| Returns the value of the element at 'position'.
|
|
const value_type & | value (const locator_type &position) const |
| Returns the value of the element at 'position'.
|
|
locator_type | find (const key_type &key) const |
| Finds an element with key equivalent to 'key'.
|
|
std::pair< locator_type, locator_type > | equal_range (const key_type &key) const |
| Returns a range containing all elements with key key in the container.
|
|
locator_type | begin () const |
| Return an iterator that points the first element in the container.
|
|
locator_type | end () const |
| Returns an iterator to the element following the last element.
|
|
std::size_t | erase (const key_type &key) |
| Removes all elements with the key equivalent to key.
|
|
locator_type | erase (const locator_type &position) |
| Removes the element at 'position'.
|
|
std::size_t | max_id_probe_distance () const |
| Returns the maximum ID probe distance. In other words, the maximum number of key pairs that have the same hash value.
|
|
void | rehash () |
| Rehash elements.
|
|
allocator_type | get_allocator () |
| Returns an instance of the internal allocator.
|
|
bool | unique () const |
| Returns if this container inserts keys uniquely.
|
|
bool | hash_seed () const |
| Returns the hash seed.
|
|
template<
typename _value_type,
typename allocator_type = metall::manager::allocator_type<std::byte>>
class metall::container::string_key_store< _value_type, allocator_type >
A ke-value store that uses string for its key.
- Warning
- This container is designed to work as the top-level container, i.e., it does not work if used inside another container.
- Template Parameters
-
_value_type | A value type. |
allocator_type | An allocator type. |