1#ifndef XRPL_BASICS_PARTITIONED_UNORDERED_MAP_H
2#define XRPL_BASICS_PARTITIONED_UNORDERED_MAP_H
4#include <xrpl/beast/hash/uhash.h>
5#include <xrpl/beast/utility/instrumentation.h>
17template <
typename Key>
28 return ::beast::uhash<>{}(key);
62 typename partition_map_type::iterator
ait_;
63 typename map_type::iterator
mit_;
123 return !(lhs == rhs);
132 typename partition_map_type::iterator
ait_;
133 typename map_type::iterator
mit_;
200 return !(lhs == rhs);
215 it.ait_ = it.map_->end();
216 it.mit_ = it.map_->back().end();
223 for (it.ait_ = it.map_->begin(); it.ait_ != it.map_->end(); ++it.ait_)
225 if (it.ait_->begin() == it.ait_->end())
227 it.mit_ = it.ait_->begin();
245 "ripple::partitioned_unordered_map::partitioned_unordered_map : "
246 "nonzero partitions");
311 it.mit_ = it.ait_->find(key);
312 if (it.mit_ == it.ait_->end())
333 template <
class T,
class U>
340 auto [eit, inserted] = it.
ait_->emplace(
345 return {it, inserted};
348 template <
class T,
class U>
354 auto [eit, inserted] =
357 return {it, inserted};
value_type const & const_reference
const_iterator begin() const
value_type const * const_pointer
iterator erase(const_iterator position)
std::pair< iterator, bool > emplace(std::piecewise_construct_t const &, T &&keyTuple, U &&valueTuple)
std::pair< iterator, bool > emplace(T &&key, U &&val)
const_iterator cbegin() const
Value & operator[](Key const &key)
const_iterator cend() const
const_iterator end() const
iterator find(key_type const &key)
std::vector< map_type > partition_map_type
const_iterator find(key_type const &key) const
partition_map_type & map()
void find(key_type const &key, T &it) const
std::size_t partitions() const
partitioned_unordered_map(std::optional< std::size_t > partitions=std::nullopt)
std::size_t partitioner(Key const &key) const
T hardware_concurrency(T... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::size_t extract(uint256 const &key)
const_pointer operator->() const
friend bool operator!=(const_iterator const &lhs, const_iterator const &rhs)
const_iterator(partition_map_type *map)
friend bool operator==(const_iterator const &lhs, const_iterator const &rhs)
const_iterator(iterator const &orig)
const_reference operator*() const
const_iterator operator++(int)
const_iterator & operator++()
partition_map_type * map_
partition_map_type::iterator ait_
friend bool operator!=(iterator const &lhs, iterator const &rhs)
partition_map_type::iterator ait_
reference operator*() const
partition_map_type * map_
iterator(partition_map_type *map)
friend bool operator==(iterator const &lhs, iterator const &rhs)
pointer operator->() const