3#include <xrpl/beast/hash/uhash.h>
4#include <xrpl/beast/utility/instrumentation.h>
19template <
typename Key>
30 return ::beast::Uhash<>{}(key);
63 partition_map_type::iterator
ait{};
64 map_type::iterator
mit;
126 partition_map_type::iterator
ait{};
199 it.ait = it.map->end();
200 it.mit = it.map->back().end();
207 for (it.ait = it.map->begin(); it.ait != it.map->end(); ++it.ait)
209 if (it.ait->begin() == it.ait->end())
211 it.mit = it.ait->begin();
227 "xrpl::PartitionedUnorderedMap::PartitionedUnorderedMap : "
228 "nonzero partitions");
254 ConstIterator it(&
map_);
276 ConstIterator it(&
map_);
293 it.mit = it.ait->find(key);
294 if (it.mit == it.ait->end())
310 ConstIterator it(&
map_);
315 template <
class T,
class U>
319 auto const& key = std::get<0>(keyTuple);
322 auto [eit, inserted] = it.ait->emplace(
325 return {it, inserted};
328 template <
class T,
class U>
336 return {it, inserted};
350 it.ait = position.ait;
351 it.mit = position.ait->erase(position.mit);
353 while (it.mit == it.ait->end())
356 if (it.ait == it.map->
end())
358 it.mit = it.ait->begin();
Iterator find(key_type const &key)
void find(key_type const &key, T &it) const
ConstIterator begin() const
PartitionedUnorderedMap(std::optional< std::size_t > partitions=std::nullopt)
std::pair< Key const, mapped_type > value_type
ConstIterator cend() const
Value & operator[](Key const &key)
value_type const * const_pointer
std::size_t partitions() const
Iterator erase(ConstIterator position)
ConstIterator cbegin() const
std::size_t difference_type
std::size_t partitioner(Key const &key) const
std::unordered_map< key_type, mapped_type, hasher, key_equal, allocator_type > map_type
std::pair< Iterator, bool > emplace(std::piecewise_construct_t const &, T &&keyTuple, U &&valueTuple)
ConstIterator end() const
value_type const & const_reference
std::vector< map_type > partition_map_type
std::pair< Iterator, bool > emplace(T &&key, U &&val)
ConstIterator find(key_type const &key) const
partition_map_type & map()
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::size_t extract(uint256 const &key)
ConstIterator(partition_map_type *m)
std::forward_iterator_tag iterator_category
ConstIterator & operator++()
friend bool operator==(ConstIterator const &lhs, ConstIterator const &rhs)
partition_map_type::iterator ait
const_reference operator*() const
const_pointer operator->() const
ConstIterator(Iterator const &orig)
ConstIterator operator++(int)
reference operator*() const
std::forward_iterator_tag iterator_category
friend bool operator==(Iterator const &lhs, Iterator const &rhs)
partition_map_type::iterator ait
pointer operator->() const
Iterator(partition_map_type *m)