1#ifndef BEAST_CONTAINER_DETAIL_AGED_UNORDERED_CONTAINER_H_INCLUDED
2#define BEAST_CONTAINER_DETAIL_AGED_UNORDERED_CONTAINER_H_INCLUDED
4#include <xrpl/beast/clock/abstract_clock.h>
5#include <xrpl/beast/container/aged_container.h>
6#include <xrpl/beast/container/detail/aged_associative_container.h>
7#include <xrpl/beast/container/detail/aged_container_iterator.h>
8#include <xrpl/beast/container/detail/empty_base_optimization.h>
10#include <boost/intrusive/list.hpp>
11#include <boost/intrusive/unordered_set.hpp>
34#ifndef BEAST_NO_CXX14_IS_PERMUTATION
35#define BEAST_NO_CXX14_IS_PERMUTATION 1
95 : boost::intrusive::unordered_set_base_hook<
96 boost::intrusive::link_mode<boost::intrusive::normal_link>>,
97 boost::intrusive::list_base_hook<
98 boost::intrusive::link_mode<boost::intrusive::normal_link>>
216 make_list<element, boost::intrusive::constant_time_size<false>>::type;
220 typename boost::intrusive::make_unordered_multiset<
222 boost::intrusive::constant_time_size<true>,
223 boost::intrusive::hash<ValueHash>,
224 boost::intrusive::equal<KeyValueEqual>,
225 boost::intrusive::cache_begin<true>>::type,
226 typename boost::intrusive::make_unordered_set<
228 boost::intrusive::constant_time_size<true>,
229 boost::intrusive::hash<ValueHash>,
230 boost::intrusive::equal<KeyValueEqual>,
231 boost::intrusive::cache_begin<true>>::type>::type;
237 Allocator>::template rebind_alloc<element>;
242 Allocator>::template rebind_alloc<element>;
286 KeyEqual
const& keyEqual,
287 Allocator
const& alloc_)
297 KeyEqual
const& keyEqual,
298 Allocator
const& alloc_)
355 key_eq() = std::move(other.key_eq());
356 alloc() = std::move(other.alloc());
436 m_vec.
resize(cont_type::suggested_upper_bucket_count(0));
441 m_vec.
resize(cont_type::suggested_upper_bucket_count(0));
474 template <
class Container>
507 template <
class Container>
512 cont_type::suggested_upper_bucket_count(n));
521 template <
class... Args>
535 ElementAllocatorTraits::deallocate(a_.
get(), p, 1);
579 aged_container_iterator<!IsMap, typename cont_type::iterator>;
581 aged_container_iterator<true, typename cont_type::iterator>;
584 aged_container_iterator<!IsMap, typename cont_type::local_iterator>;
586 aged_container_iterator<true, typename cont_type::local_iterator>;
603 aged_container_iterator<!IsMap, typename list_type::iterator>;
605 aged_container_iterator<true, typename list_type::iterator>;
608 typename list_type::reverse_iterator>;
610 aged_container_iterator<true, typename list_type::reverse_iterator>;
689 "must be standard layout");
690 return list.iterator_to(*
reinterpret_cast<element*
>(
691 reinterpret_cast<uint8_t*
>(&value) -
700 "must be standard layout");
701 return list.iterator_to(*
reinterpret_cast<element const*
>(
702 reinterpret_cast<uint8_t const*
>(&value) -
742 Allocator
const& alloc);
747 Allocator
const& alloc);
753 Allocator
const& alloc);
755 template <
class InputIt>
758 template <
class InputIt>
765 template <
class InputIt>
772 template <
class InputIt>
777 Allocator
const& alloc);
779 template <
class InputIt>
787 template <
class InputIt>
793 Allocator
const& alloc);
795 template <
class InputIt>
801 Allocator
const& alloc);
803 template <
class InputIt>
810 Allocator
const& alloc);
816 Allocator
const& alloc);
822 Allocator
const& alloc);
841 Allocator
const& alloc);
853 Allocator
const& alloc);
859 Allocator
const& alloc);
866 Allocator
const& alloc);
905 bool maybe_multi = IsMulti,
906 bool maybe_map = IsMap,
913 bool maybe_multi = IsMulti,
914 bool maybe_map = IsMap,
917 at(K
const& k)
const;
920 bool maybe_multi = IsMulti,
921 bool maybe_map = IsMap,
927 bool maybe_multi = IsMulti,
928 bool maybe_map = IsMap,
981 reinterpret_cast<uint8_t*
>(&value) -
991 reinterpret_cast<uint8_t const*
>(&value) -
1029 template <
bool maybe_multi = IsMulti>
1035 template <
bool maybe_multi = IsMulti>
1041 template <
bool maybe_multi = IsMulti,
bool maybe_map = IsMap>
1044 !maybe_multi && !maybe_map,
1048 template <
bool maybe_multi = IsMulti,
bool maybe_map = IsMap>
1054 template <
bool maybe_multi = IsMulti>
1060 return insert(value).first;
1064 template <
bool maybe_multi = IsMulti>
1074 template <
bool maybe_multi = IsMulti>
1080 return insert(std::move(value)).first;
1084 template <
bool maybe_multi = IsMulti>
1090 return insert(std::move(value));
1094 template <
class P,
bool maybe_map = IsMap>
1106 template <
class P,
bool maybe_map = IsMap>
1117 template <
class InputIt>
1134 template <
bool maybe_multi = IsMulti,
class... Args>
1140 template <
bool maybe_multi = IsMulti,
class... Args>
1146 template <
bool maybe_multi = IsMulti,
class... Args>
1152 template <
bool maybe_multi = IsMulti,
class... Args>
1161 template <
bool is_const,
class Iterator>
1165 template <
bool is_const,
class Iterator>
1178 template <
bool is_const,
class Iterator>
1233 auto const r(
m_cont.equal_range(
1245 auto const r(
m_cont.equal_range(
1298 return m_cont.bucket_count();
1310 return m_cont.bucket_size(n);
1318 "beast::detail::aged_unordered_container::bucket : nonzero bucket "
1332 return size() /
static_cast<float>(
m_cont.bucket_count());
1392 class OtherDuration,
1394 class OtherAllocator,
1395 bool maybe_multi = IsMulti>
1405 OtherAllocator>
const& other)
const;
1411 class OtherDuration,
1413 class OtherAllocator,
1414 bool maybe_multi = IsMulti>
1424 OtherAllocator>
const& other)
const;
1431 class OtherDuration,
1433 class OtherAllocator>
1443 OtherAllocator>
const& other)
const
1462 "beast::detail::aged_unordered_container::maybe_rehash : maximum "
1467 template <
bool maybe_multi = IsMulti>
1473 template <
bool maybe_multi = IsMulti>
1478 template <
class InputIt>
1482 for (; first != last; ++first)
1486 template <
class InputIt>
1490 for (; first != last; ++first)
1494 template <
class InputIt>
1503 template <
bool is_const,
class Iterator>
1517 Allocator>::propagate_on_container_swap::value>
1528 Allocator>::propagate_on_container_swap::value>
1565 std::cref(m_config.value_hash()),
1566 std::cref(m_config.key_value_equal()))
1587 Allocator>::aged_unordered_container(
clock_type& clock, Hash
const& hash)
1588 : m_config(clock, hash)
1591 std::cref(m_config.value_hash()),
1592 std::cref(m_config.key_value_equal()))
1614 aged_unordered_container(
clock_type& clock, KeyEqual
const& key_eq)
1615 : m_config(clock, key_eq)
1618 std::cref(m_config.value_hash()),
1619 std::cref(m_config.key_value_equal()))
1641 aged_unordered_container(
clock_type& clock, Allocator
const& alloc)
1642 : m_config(clock, alloc)
1646 std::cref(m_config.value_hash()),
1647 std::cref(m_config.key_value_equal()))
1669 aged_unordered_container(
1672 KeyEqual
const& key_eq)
1673 : m_config(clock, hash, key_eq)
1676 std::cref(m_config.value_hash()),
1677 std::cref(m_config.key_value_equal()))
1699 aged_unordered_container(
1702 Allocator
const& alloc)
1703 : m_config(clock, hash, alloc)
1707 std::cref(m_config.value_hash()),
1708 std::cref(m_config.key_value_equal()))
1730 aged_unordered_container(
1732 KeyEqual
const& key_eq,
1733 Allocator
const& alloc)
1734 : m_config(clock, key_eq, alloc)
1738 std::cref(m_config.value_hash()),
1739 std::cref(m_config.key_value_equal()))
1761 aged_unordered_container(
1764 KeyEqual
const& key_eq,
1765 Allocator
const& alloc)
1766 : m_config(clock, hash, key_eq, alloc)
1770 std::cref(m_config.value_hash()),
1771 std::cref(m_config.key_value_equal()))
1784template <
class InputIt>
1794 aged_unordered_container(InputIt first, InputIt last,
clock_type& clock)
1798 std::cref(m_config.value_hash()),
1799 std::cref(m_config.key_value_equal()))
1813template <
class InputIt>
1823 aged_unordered_container(
1828 : m_config(clock, hash)
1831 std::cref(m_config.value_hash()),
1832 std::cref(m_config.key_value_equal()))
1846template <
class InputIt>
1856 aged_unordered_container(
1860 KeyEqual
const& key_eq)
1861 : m_config(clock, key_eq)
1864 std::cref(m_config.value_hash()),
1865 std::cref(m_config.key_value_equal()))
1879template <
class InputIt>
1889 aged_unordered_container(
1893 Allocator
const& alloc)
1894 : m_config(clock, alloc)
1898 std::cref(m_config.value_hash()),
1899 std::cref(m_config.key_value_equal()))
1913template <
class InputIt>
1923 aged_unordered_container(
1928 KeyEqual
const& key_eq)
1929 : m_config(clock, hash, key_eq)
1932 std::cref(m_config.value_hash()),
1933 std::cref(m_config.key_value_equal()))
1947template <
class InputIt>
1957 aged_unordered_container(
1962 Allocator
const& alloc)
1963 : m_config(clock, hash, alloc)
1967 std::cref(m_config.value_hash()),
1968 std::cref(m_config.key_value_equal()))
1982template <
class InputIt>
1992 aged_unordered_container(
1996 KeyEqual
const& key_eq,
1997 Allocator
const& alloc)
1998 : m_config(clock, key_eq, alloc)
2002 std::cref(m_config.value_hash()),
2003 std::cref(m_config.key_value_equal()))
2017template <
class InputIt>
2027 aged_unordered_container(
2032 KeyEqual
const& key_eq,
2033 Allocator
const& alloc)
2034 : m_config(clock, hash, key_eq, alloc)
2038 std::cref(m_config.value_hash()),
2039 std::cref(m_config.key_value_equal()))
2062 : m_config(other.m_config)
2063 , m_buck(m_config.alloc())
2066 std::cref(m_config.value_hash()),
2067 std::cref(m_config.key_value_equal()))
2090 aged_unordered_container(
2092 Allocator
const& alloc)
2093 : m_config(other.m_config, alloc)
2097 std::cref(m_config.value_hash()),
2098 std::cref(m_config.key_value_equal()))
2121 : m_config(
std::move(other.m_config))
2122 , m_buck(
std::move(other.m_buck))
2123 , m_cont(
std::move(other.m_cont))
2146 aged_unordered_container(
2148 Allocator
const& alloc)
2149 : m_config(
std::move(other.m_config), alloc)
2153 std::cref(m_config.value_hash()),
2154 std::cref(m_config.key_value_equal()))
2156 insert(other.cbegin(), other.cend());
2178 aged_unordered_container(
2184 std::cref(m_config.value_hash()),
2185 std::cref(m_config.key_value_equal()))
2208 aged_unordered_container(
2212 : m_config(clock, hash)
2215 std::cref(m_config.value_hash()),
2216 std::cref(m_config.key_value_equal()))
2239 aged_unordered_container(
2242 KeyEqual
const& key_eq)
2243 : m_config(clock, key_eq)
2246 std::cref(m_config.value_hash()),
2247 std::cref(m_config.key_value_equal()))
2270 aged_unordered_container(
2273 Allocator
const& alloc)
2274 : m_config(clock, alloc)
2278 std::cref(m_config.value_hash()),
2279 std::cref(m_config.key_value_equal()))
2302 aged_unordered_container(
2306 KeyEqual
const& key_eq)
2307 : m_config(clock, hash, key_eq)
2310 std::cref(m_config.value_hash()),
2311 std::cref(m_config.key_value_equal()))
2334 aged_unordered_container(
2338 Allocator
const& alloc)
2339 : m_config(clock, hash, alloc)
2343 std::cref(m_config.value_hash()),
2344 std::cref(m_config.key_value_equal()))
2367 aged_unordered_container(
2370 KeyEqual
const& key_eq,
2371 Allocator
const& alloc)
2372 : m_config(clock, key_eq, alloc)
2376 std::cref(m_config.value_hash()),
2377 std::cref(m_config.key_value_equal()))
2400 aged_unordered_container(
2404 KeyEqual
const& key_eq,
2405 Allocator
const& alloc)
2406 : m_config(clock, hash, key_eq, alloc)
2410 std::cref(m_config.value_hash()),
2411 std::cref(m_config.key_value_equal()))
2433 Allocator>::~aged_unordered_container()
2463 m_config = other.m_config;
2464 m_buck =
Buckets(m_config.alloc());
2466 insert_unchecked(other.begin(), other.end());
2494 m_config = std::move(other.m_config);
2495 m_buck =
Buckets(m_config.alloc());
2497 insert_unchecked(other.begin(), other.end());
2539template <
class K,
bool maybe_multi,
bool maybe_map,
class>
2549 Allocator>::at(K
const& k)
2551 auto const iter(m_cont.find(
2554 std::cref(m_config.key_value_equal())));
2555 if (iter == m_cont.end())
2557 return iter->value.second;
2569template <
class K,
bool maybe_multi,
bool maybe_map,
class>
2579 Allocator>::at(K
const& k)
const
2581 auto const iter(m_cont.find(
2584 std::cref(m_config.key_value_equal())));
2585 if (iter == m_cont.end())
2587 return iter->value.second;
2599template <
bool maybe_multi,
bool maybe_map,
class>
2609 Allocator>::operator[](Key
const& key)
2612 typename cont_type::insert_commit_data d;
2613 auto const result(m_cont.insert_check(
2624 m_cont.insert_commit(*p, d);
2625 chronological.list.push_back(*p);
2626 return p->
value.second;
2628 return result.first->value.second;
2640template <
bool maybe_multi,
bool maybe_map,
class>
2650 Allocator>::operator[](Key&& key)
2653 typename cont_type::insert_commit_data d;
2654 auto const result(m_cont.insert_check(
2665 m_cont.insert_commit(*p, d);
2666 chronological.list.push_back(*p);
2667 return p->
value.second;
2669 return result.first->value.second;
2694 for (
auto iter(chronological.list.begin());
2695 iter != chronological.list.end();)
2696 unlink_and_delete_element(&*iter++);
2697 chronological.list.clear();
2712template <
bool maybe_multi>
2726 typename cont_type::insert_commit_data d;
2727 auto const result(m_cont.insert_check(
2734 element*
const p(new_element(value));
2735 auto const iter(m_cont.insert_commit(*p, d));
2736 chronological.list.push_back(*p);
2752template <
bool maybe_multi>
2762 Allocator>::insert(value_type
const& value) ->
2766 element*
const p(new_element(value));
2767 chronological.list.push_back(*p);
2768 auto const iter(m_cont.insert(*p));
2769 return iterator(iter);
2782template <
bool maybe_multi,
bool maybe_map>
2784aged_unordered_container<
2797 typename cont_type::insert_commit_data d;
2798 auto const result(m_cont.insert_check(
2805 element*
const p(new_element(std::move(value)));
2806 auto const iter(m_cont.insert_commit(*p, d));
2807 chronological.list.push_back(*p);
2823template <
bool maybe_multi,
bool maybe_map>
2833 Allocator>::insert(value_type&& value) ->
2837 element*
const p(new_element(std::move(value)));
2838 chronological.list.push_back(*p);
2839 auto const iter(m_cont.insert(*p));
2840 return iterator(iter);
2854template <
bool maybe_multi,
class... Args>
2856aged_unordered_container<
2864 Allocator>::emplace(Args&&... args) ->
2871 auto const result(m_cont.insert(*p));
2874 chronological.list.push_back(*p);
2891template <
bool maybe_multi,
class... Args>
2901 Allocator>::emplace(Args&&... args) ->
2908 typename cont_type::insert_commit_data d;
2909 auto const result(m_cont.insert_check(
2916 auto const iter(m_cont.insert_commit(*p, d));
2917 chronological.list.push_back(*p);
2935template <
bool maybe_multi,
class... Args>
2937aged_unordered_container<
2945 Allocator>::emplace(Args&&... args) ->
2950 chronological.list.push_back(*p);
2951 auto const iter(m_cont.insert(*p));
2952 return iterator(iter);
2965template <
bool maybe_multi,
class... Args>
2967aged_unordered_container<
2982 typename cont_type::insert_commit_data d;
2983 auto const result(m_cont.insert_check(
2990 auto const iter(m_cont.insert_commit(*p, d));
2991 chronological.list.push_back(*p);
3007template <
bool is_const,
class Iterator>
3020 unlink_and_delete_element(&*((pos++).
iterator()));
3034template <
bool is_const,
class Iterator>
3049 for (; first != last;)
3050 unlink_and_delete_element(&*((first++).
iterator()));
3077 auto iter(m_cont.find(
3080 std::cref(m_config.key_value_equal())));
3081 if (iter == m_cont.end())
3087 bool const done(m_config(*p, extract(iter->value)));
3088 unlink_and_delete_element(p);
3117 std::swap(chronological, other.chronological);
3142 auto const now(clock().now());
3144 auto const range(equal_range(k));
3145 for (
auto iter : range)
3166 class OtherDuration,
3168 class OtherAllocator,
3188 OtherAllocator>
const& other)
const
3190 if (size() != other.size())
3192 for (
auto iter(cbegin()), last(cend()), olast(other.cend()); iter != last;
3195 auto oiter(other.find(extract(*iter)));
3215 class OtherDuration,
3217 class OtherAllocator,
3237 OtherAllocator>
const& other)
const
3239 if (size() != other.size())
3241 for (
auto iter(cbegin()), last(cend()); iter != last;)
3243 auto const& k(extract(*iter));
3244 auto const eq(equal_range(k));
3245 auto const oeq(other.equal_range(k));
3246#if BEAST_NO_CXX14_IS_PERMUTATION
3272template <
bool maybe_multi>
3285 typename cont_type::insert_commit_data d;
3286 auto const result(m_cont.insert_check(
3293 element*
const p(new_element(value));
3294 auto const iter(m_cont.insert_commit(*p, d));
3295 chronological.list.push_back(*p);
3311template <
bool maybe_multi>
3321 Allocator>::insert_unchecked(value_type
const& value) ->
3324 element*
const p(new_element(value));
3325 chronological.list.push_back(*p);
3326 auto const iter(m_cont.insert(*p));
3327 return iterator(iter);
3388 Allocator>& rhs)
noexcept
3419 auto const expired(c.clock().now() - age);
3420 for (
auto iter(c.chronological.cbegin());
3421 iter != c.chronological.cend() && iter.when() <= expired;)
3423 iter = c.erase(iter);
Abstract interface to a clock.
typename Clock::time_point time_point
typename Clock::duration duration
Iterator const & iterator() const
float & max_load_factor()
void rehash(size_type count, Container &c)
Buckets(Allocator const &alloc)
void resize(size_type n, Container &c)
float const & max_load_factor() const
size_type max_bucket_count() const
bool operator()(element const &e, Key const &k) const
KeyEqual const & key_eq() const
bool operator()(Key const &k, element const &e) const
KeyValueEqual(KeyEqual const &keyEqual)
bool operator()(element const &lhs, element const &rhs) const
std::size_t operator()(element const &e) const
Hash const & hash_function() const
const_iterator iterator_to(value_type const &value) const
chronological_t(chronological_t const &)=delete
const_reverse_iterator crbegin() const
beast::detail::aged_container_iterator< true, typename list_type::reverse_iterator > const_reverse_iterator
const_iterator end() const
chronological_t(chronological_t &&)=delete
beast::detail::aged_container_iterator<!IsMap, typename list_type::iterator > iterator
const_reverse_iterator rbegin() const
beast::detail::aged_container_iterator< true, typename list_type::iterator > const_iterator
const_iterator cbegin() const
reverse_iterator rbegin()
const_iterator begin() const
beast::detail::aged_container_iterator< !IsMap, typename list_type::reverse_iterator > reverse_iterator
iterator iterator_to(value_type &value)
const_reverse_iterator rend() const
const_reverse_iterator crend() const
const_iterator cend() const
KeyValueEqual & key_value_equal()
config_t(config_t &&other, Allocator const &alloc)
config_t(clock_type &clock_, KeyEqual const &keyEqual)
config_t(clock_type &clock_)
Hash const & hash_function() const
config_t(config_t &&other)
config_t & operator=(config_t const &other)
KeyValueEqual const & key_value_equal() const
ElementAllocator & alloc()
config_t(clock_type &clock_, KeyEqual const &keyEqual, Allocator const &alloc_)
config_t(clock_type &clock_, Hash const &hash, Allocator const &alloc_)
config_t(clock_type &clock_, Allocator const &alloc_)
config_t(clock_type &clock_, Hash const &hash)
std::reference_wrapper< clock_type > clock
config_t(clock_type &clock_, Hash const &hash, KeyEqual const &keyEqual, Allocator const &alloc_)
config_t(config_t const &other, Allocator const &alloc)
config_t(config_t const &other)
ElementAllocator const & alloc() const
ValueHash const & value_hash() const
config_t(clock_type &clock_, Hash const &hash, KeyEqual const &keyEqual)
KeyEqual const & key_eq() const
config_t & operator=(config_t &&other)
Associative container where each element is also indexed by time.
aged_unordered_container(clock_type &clock, Hash const &hash, KeyEqual const &key_eq)
std::conditional< IsMap, T, void * >::type & at(K const &k)
aged_unordered_container(clock_type &clock, KeyEqual const &key_eq, Allocator const &alloc)
aged_unordered_container(std::initializer_list< value_type > init, clock_type &clock, Hash const &hash)
abstract_clock< Clock > clock_type
auto insert(value_type const &value) -> typename std::enable_if<!maybe_multi, std::pair< iterator, bool > >::type
std::enable_if< maybe_map &&std::is_constructible< value_type, P && >::value, typenamestd::conditional< IsMulti, iterator, std::pair< iterator, bool > >::type >::type insert(P &&value)
typename std::allocator_traits< Allocator >::const_pointer const_pointer
aged_unordered_container(InputIt first, InputIt last, clock_type &clock, Hash const &hash, KeyEqual const &key_eq)
aged_unordered_container(InputIt first, InputIt last, clock_type &clock, Allocator const &alloc)
auto erase(K const &k) -> size_type
static Key const & extract(value_type const &value)
beast::detail::aged_container_iterator< false, Iterator > erase(beast::detail::aged_container_iterator< is_const, Iterator > first, beast::detail::aged_container_iterator< is_const, Iterator > last)
bool would_exceed(size_type additional) const
aged_unordered_container & operator=(aged_unordered_container const &other)
aged_unordered_container(clock_type &clock, KeyEqual const &key_eq)
std::enable_if< maybe_multi, iterator >::type insert(const_iterator, value_type const &value)
key_equal const & key_eq() const
const_local_iterator begin(size_type n) const
void insert_unchecked(InputIt first, InputIt last)
size_type max_size() const noexcept
aged_unordered_container(aged_unordered_container const &other)
const_local_iterator cend(size_type n) const
typename boost::intrusive::make_list< element, boost::intrusive::constant_time_size< false > >::type list_type
aged_unordered_container(std::initializer_list< value_type > init, clock_type &clock, KeyEqual const &key_eq, Allocator const &alloc)
local_iterator end(size_type n)
typename std::allocator_traits< Allocator >::template rebind_alloc< element > ElementAllocator
aged_unordered_container(InputIt first, InputIt last, clock_type &clock, Hash const &hash)
const_local_iterator end(size_type n) const
typename std::allocator_traits< Allocator >::pointer pointer
float load_factor() const
std::enable_if<!maybe_multi, bool >::type operator==(aged_unordered_container< false, OtherIsMap, OtherKey, OtherT, OtherDuration, OtherHash, KeyEqual, OtherAllocator > const &other) const
void max_load_factor(float ml)
const_iterator find(K const &k) const
void insert(std::initializer_list< value_type > init)
std::enable_if<!maybe_multi, iterator >::type insert(const_iterator, value_type const &value)
std::pair< iterator, iterator > equal_range(K const &k)
size_type max_bucket_count() const
typename clock_type::duration duration
float max_load_factor() const
std::enable_if< maybe_multi, iterator >::type emplace_hint(const_iterator, Args &&... args)
aged_unordered_container(std::initializer_list< value_type > init, clock_type &clock)
typename cont_type::bucket_type bucket_type
aged_unordered_container(clock_type &clock, Hash const &hash, Allocator const &alloc)
typename std::conditional< IsMap, std::pair< Key const, T >, Key >::type value_type
size_type bucket_count() const
auto insert_unchecked(value_type const &value) -> typename std::enable_if< maybe_multi, iterator >::type
const_iterator iterator_to(value_type const &value) const
std::enable_if<!maybe_propagate >::type swap_data(aged_unordered_container &other) noexcept
auto touch(K const &k) -> size_type
beast::detail::aged_container_iterator<!IsMap, typename cont_type::local_iterator > local_iterator
typename cont_type::bucket_traits bucket_traits
aged_unordered_container(std::initializer_list< value_type > init, clock_type &clock, Hash const &hash, KeyEqual const &key_eq, Allocator const &alloc)
auto insert(value_type &&value) -> typename std::enable_if< maybe_multi &&!maybe_map, iterator >::type
void rehash(size_type count)
local_iterator begin(size_type n)
const_iterator cbegin() const
std::pair< const_iterator, const_iterator > equal_range(K const &k) const
void touch(beast::detail::aged_container_iterator< is_const, Iterator > pos)
typename clock_type::time_point time_point
std::conditional< IsMap, T, void * >::type & operator[](Key const &key)
aged_unordered_container(std::initializer_list< value_type > init, clock_type &clock, Allocator const &alloc)
std::enable_if<!maybe_multi, iterator >::type insert(const_iterator, value_type &&value)
bool empty() const noexcept
auto emplace(Args &&... args) -> typename std::enable_if< maybe_multi, iterator >::type
std::enable_if< maybe_multi, bool >::type operator==(aged_unordered_container< true, OtherIsMap, OtherKey, OtherT, OtherDuration, OtherHash, KeyEqual, OtherAllocator > const &other) const
size_type bucket(Key const &k) const
void delete_element(element const *p)
std::enable_if< maybe_multi, iterator >::type insert(const_iterator, value_type &&value)
aged_unordered_container(InputIt first, InputIt last, clock_type &clock, Hash const &hash, KeyEqual const &key_eq, Allocator const &alloc)
const_local_iterator cbegin(size_type n) const
const_iterator end() const
const_iterator cend() const
auto insert_unchecked(value_type const &value) -> typename std::enable_if<!maybe_multi, std::pair< iterator, bool > >::type
aged_unordered_container(aged_unordered_container const &other, Allocator const &alloc)
~aged_unordered_container()
allocator_type get_allocator() const
aged_unordered_container(clock_type &clock, Allocator const &alloc)
auto emplace_hint(const_iterator, Args &&... args) -> typename std::enable_if<!maybe_multi, std::pair< iterator, bool > >::type
hasher const & hash_function() const
void touch(beast::detail::aged_container_iterator< is_const, Iterator > pos, typename clock_type::time_point const &now)
void insert(InputIt first, InputIt last)
beast::detail::aged_container_iterator< true, typename cont_type::local_iterator > const_local_iterator
beast::detail::aged_container_iterator< false, Iterator > erase(beast::detail::aged_container_iterator< is_const, Iterator > pos)
void insert(InputIt first, InputIt last, std::input_iterator_tag)
aged_unordered_container & operator=(aged_unordered_container &&other)
beast::detail::aged_container_iterator<!IsMap, typename cont_type::iterator > iterator
iterator find(K const &k)
size_type count(K const &k) const
std::enable_if< maybe_propagate >::type swap_data(aged_unordered_container &other) noexcept
aged_unordered_container & operator=(std::initializer_list< value_type > init)
void unlink_and_delete_element(element const *p)
aged_unordered_container(InputIt first, InputIt last, clock_type &clock, Hash const &hash, Allocator const &alloc)
bool operator!=(aged_unordered_container< OtherIsMulti, OtherIsMap, OtherKey, OtherT, OtherDuration, OtherHash, KeyEqual, OtherAllocator > const &other) const
void insert(InputIt first, InputIt last, std::random_access_iterator_tag)
typename std::conditional< IsMulti, typename boost::intrusive::make_unordered_multiset< element, boost::intrusive::constant_time_size< true >, boost::intrusive::hash< ValueHash >, boost::intrusive::equal< KeyValueEqual >, boost::intrusive::cache_begin< true > >::type, typename boost::intrusive::make_unordered_set< element, boost::intrusive::constant_time_size< true >, boost::intrusive::hash< ValueHash >, boost::intrusive::equal< KeyValueEqual >, boost::intrusive::cache_begin< true > >::type >::type cont_type
aged_unordered_container(clock_type &clock, Hash const &hash)
size_type size() const noexcept
const_iterator begin() const
aged_unordered_container(clock_type &clock, Hash const &hash, KeyEqual const &key_eq, Allocator const &alloc)
auto emplace(Args &&... args) -> typename std::enable_if<!maybe_multi, std::pair< iterator, bool > >::type
std::conditional< IsMap, T, void * >::type const & at(K const &k) const
iterator iterator_to(value_type &value)
aged_unordered_container()=delete
aged_unordered_container(clock_type &clock)
void swap(aged_unordered_container &other) noexcept
void reserve(size_type count)
element * new_element(Args &&... args)
aged_unordered_container(InputIt first, InputIt last, clock_type &clock)
aged_unordered_container(aged_unordered_container &&other)
size_type bucket_size(size_type n) const
beast::detail::aged_container_iterator< true, typename cont_type::iterator > const_iterator
void maybe_rehash(size_type additional)
std::enable_if< maybe_map &&std::is_constructible< value_type, P && >::value, typenamestd::conditional< IsMulti, iterator, std::pair< iterator, bool > >::type >::type insert(const_iterator hint, P &&value)
auto insert(value_type const &value) -> typename std::enable_if< maybe_multi, iterator >::type
aged_unordered_container(std::initializer_list< value_type > init, clock_type &clock, Hash const &hash, KeyEqual const &key_eq)
std::conditional< IsMap, T, void * >::type & operator[](Key &&key)
aged_unordered_container(InputIt first, InputIt last, clock_type &clock, KeyEqual const &key_eq, Allocator const &alloc)
clock_type const & clock() const
aged_unordered_container(InputIt first, InputIt last, clock_type &clock, KeyEqual const &key_eq)
class beast::detail::aged_unordered_container::chronological_t chronological
auto insert(value_type &&value) -> typename std::enable_if< !maybe_multi &&!maybe_map, std::pair< iterator, bool > >::type
typename std::allocator_traits< Allocator >::template rebind_alloc< element > BucketAllocator
value_type const & const_reference
aged_unordered_container(std::initializer_list< value_type > init, clock_type &clock, KeyEqual const &key_eq)
aged_unordered_container(aged_unordered_container &&other, Allocator const &alloc)
aged_unordered_container(std::initializer_list< value_type > init, clock_type &clock, Hash const &hash, Allocator const &alloc)
ElementAllocator & member() noexcept
T forward_as_tuple(T... args)
T get_allocator(T... args)
T is_permutation(T... args)
std::enable_if< is_aged_container< AgedContainer >::value, std::size_t >::type expire(AgedContainer &c, std::chrono::duration< Rep, Period > const &age)
Expire aged container items past the specified age.
void swap(beast::detail::aged_ordered_container< IsMulti, IsMap, Key, T, Clock, Compare, Allocator > &lhs, beast::detail::aged_ordered_container< IsMulti, IsMap, Key, T, Clock, Compare, Allocator > &rhs) noexcept
typename aged_unordered_container::value_type value_type
typename aged_unordered_container::time_point time_point
element(time_point const &when_, value_type const &value_)
element(time_point const &when_, value_type &&value_)
element(time_point const &when_, Args &&... args)
is_aged_container()=default