3#include <xrpl/beast/clock/abstract_clock.h>
4#include <xrpl/beast/container/aged_container.h>
5#include <xrpl/beast/container/detail/aged_associative_container.h>
6#include <xrpl/beast/container/detail/aged_container_iterator.h>
7#include <xrpl/beast/container/detail/empty_base_optimization.h>
9#include <boost/intrusive/list.hpp>
10#include <boost/intrusive/unordered_set.hpp>
33#ifndef BEAST_NO_CXX14_IS_PERMUTATION
34#define BEAST_NO_CXX14_IS_PERMUTATION 1
92 : boost::intrusive::unordered_set_base_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>>,
93 boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>>
206 using list_type =
typename boost::intrusive::make_list<element, boost::intrusive::constant_time_size<false>>::type;
210 typename boost::intrusive::make_unordered_multiset<
212 boost::intrusive::constant_time_size<true>,
213 boost::intrusive::hash<ValueHash>,
214 boost::intrusive::equal<KeyValueEqual>,
215 boost::intrusive::cache_begin<true>>::type,
216 typename boost::intrusive::make_unordered_set<
218 boost::intrusive::constant_time_size<true>,
219 boost::intrusive::hash<ValueHash>,
220 boost::intrusive::equal<KeyValueEqual>,
221 boost::intrusive::cache_begin<true>>::type>::type;
326 key_eq() = std::move(other.key_eq());
327 alloc() = std::move(other.alloc());
403 m_vec.
resize(cont_type::suggested_upper_bucket_count(0));
408 m_vec.
resize(cont_type::suggested_upper_bucket_count(0));
441 template <
class Container>
474 template <
class Container>
478 size_type const suggested(cont_type::suggested_upper_bucket_count(n));
487 template <
class... Args>
501 ElementAllocatorTraits::deallocate(a_.
get(), p, 1);
639 return list.iterator_to(*
reinterpret_cast<element*
>(
647 return list.iterator_to(*
reinterpret_cast<element const*
>(
687 template <
class InputIt>
690 template <
class InputIt>
693 template <
class InputIt>
696 template <
class InputIt>
699 template <
class InputIt>
702 template <
class InputIt>
705 template <
class InputIt>
711 Allocator
const& alloc);
713 template <
class InputIt>
720 Allocator
const& alloc);
748 Allocator
const& alloc);
754 Allocator
const& alloc);
761 Allocator
const& alloc);
800 bool maybe_multi = IsMulti,
801 bool maybe_map = IsMap,
808 bool maybe_multi = IsMulti,
809 bool maybe_map = IsMap,
812 at(K
const& k)
const;
815 bool maybe_multi = IsMulti,
816 bool maybe_map = IsMap,
822 bool maybe_multi = IsMulti,
823 bool maybe_map = IsMap,
920 template <
bool maybe_multi = IsMulti>
925 template <
bool maybe_multi = IsMulti>
930 template <
bool maybe_multi = IsMulti,
bool maybe_map = IsMap>
935 template <
bool maybe_multi = IsMulti,
bool maybe_map = IsMap>
940 template <
bool maybe_multi = IsMulti>
946 return insert(value).first;
950 template <
bool maybe_multi = IsMulti>
960 template <
bool maybe_multi = IsMulti>
966 return insert(std::move(value)).first;
970 template <
bool maybe_multi = IsMulti>
976 return insert(std::move(value));
980 template <
class P,
bool maybe_map = IsMap>
990 template <
class P,
bool maybe_map = IsMap>
999 template <
class InputIt>
1013 template <
bool maybe_multi = IsMulti,
class... Args>
1018 template <
bool maybe_multi = IsMulti,
class... Args>
1023 template <
bool maybe_multi = IsMulti,
class... Args>
1029 template <
bool maybe_multi = IsMulti,
class... Args>
1038 template <
bool is_const,
class Iterator>
1042 template <
bool is_const,
class Iterator>
1055 template <
bool is_const,
class Iterator>
1160 return m_cont.bucket_count();
1172 return m_cont.bucket_size(n);
1180 "beast::detail::aged_unordered_container::bucket : nonzero bucket "
1194 return size() /
static_cast<float>(
m_cont.bucket_count());
1254 class OtherDuration,
1256 class OtherAllocator,
1257 bool maybe_multi = IsMulti>
1267 OtherAllocator>
const& other)
const;
1273 class OtherDuration,
1275 class OtherAllocator,
1276 bool maybe_multi = IsMulti>
1286 OtherAllocator>
const& other)
const;
1293 class OtherDuration,
1295 class OtherAllocator>
1305 OtherAllocator>
const& other)
const
1324 "beast::detail::aged_unordered_container::maybe_rehash : maximum "
1329 template <
bool maybe_multi = IsMulti>
1334 template <
bool maybe_multi = IsMulti>
1338 template <
class InputIt>
1342 for (; first != last; ++first)
1346 template <
class InputIt>
1350 for (; first != last; ++first)
1354 template <
class InputIt>
1363 template <
bool is_const,
class Iterator>
1373 template <bool maybe_propagate = std::allocator_traits<Allocator>::propagate_on_container_swap::value>
1382 template <bool maybe_propagate = std::allocator_traits<Allocator>::propagate_on_container_swap::value>
1398template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1401 : m_config(clock), m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1405template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1409 : m_config(clock, hash), m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1413template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1416 KeyEqual
const& key_eq)
1417 : m_config(clock, key_eq), m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1421template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1424 Allocator
const& alloc)
1425 : m_config(clock, alloc)
1427 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1431template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1435 KeyEqual
const& key_eq)
1436 : m_config(clock, hash, key_eq)
1437 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1441template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1445 Allocator
const& alloc)
1446 : m_config(clock, hash, alloc)
1448 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1452template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1455 KeyEqual
const& key_eq,
1456 Allocator
const& alloc)
1457 : m_config(clock, key_eq, alloc)
1459 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1463template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1467 KeyEqual
const& key_eq,
1468 Allocator
const& alloc)
1469 : m_config(clock, hash, key_eq, alloc)
1471 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1475template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1476template <
class InputIt>
1481 : m_config(clock), m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1486template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1487template <
class InputIt>
1493 : m_config(clock, hash), m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1498template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1499template <
class InputIt>
1504 KeyEqual
const& key_eq)
1505 : m_config(clock, key_eq), m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1510template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1511template <
class InputIt>
1516 Allocator
const& alloc)
1517 : m_config(clock, alloc)
1519 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1524template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1525template <
class InputIt>
1531 KeyEqual
const& key_eq)
1532 : m_config(clock, hash, key_eq)
1533 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1538template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1539template <
class InputIt>
1545 Allocator
const& alloc)
1546 : m_config(clock, hash, alloc)
1548 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1553template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1554template <
class InputIt>
1559 KeyEqual
const& key_eq,
1560 Allocator
const& alloc)
1561 : m_config(clock, key_eq, alloc)
1563 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1568template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1569template <
class InputIt>
1575 KeyEqual
const& key_eq,
1576 Allocator
const& alloc)
1577 : m_config(clock, hash, key_eq, alloc)
1579 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1584template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1587 : m_config(other.m_config)
1588 , m_buck(m_config.alloc())
1589 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1594template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1597 Allocator
const& alloc)
1598 : m_config(other.m_config, alloc)
1600 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1605template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1608 : m_config(
std::move(other.m_config)), m_buck(
std::move(other.m_buck)), m_cont(
std::move(other.m_cont))
1613template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1616 Allocator
const& alloc)
1617 : m_config(
std::move(other.m_config), alloc)
1619 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1621 insert(other.cbegin(), other.cend());
1625template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1629 : m_config(clock), m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1634template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1639 : m_config(clock, hash), m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1644template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1648 KeyEqual
const& key_eq)
1649 : m_config(clock, key_eq), m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1654template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1658 Allocator
const& alloc)
1659 : m_config(clock, alloc)
1661 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1666template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1671 KeyEqual
const& key_eq)
1672 : m_config(clock, hash, key_eq)
1673 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1678template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1683 Allocator
const& alloc)
1684 : m_config(clock, hash, alloc)
1686 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1691template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1695 KeyEqual
const& key_eq,
1696 Allocator
const& alloc)
1697 : m_config(clock, key_eq, alloc)
1699 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1704template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1709 KeyEqual
const& key_eq,
1710 Allocator
const& alloc)
1711 : m_config(clock, hash, key_eq, alloc)
1713 , m_cont(m_buck,
std::cref(m_config.value_hash()),
std::cref(m_config.key_value_equal()))
1718template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1724template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1733 m_config = other.m_config;
1734 m_buck =
Buckets(m_config.alloc());
1736 insert_unchecked(other.begin(), other.end());
1741template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1748 m_config = std::move(other.m_config);
1749 m_buck =
Buckets(m_config.alloc());
1751 insert_unchecked(other.begin(), other.end());
1756template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1768template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1769template <
class K,
bool maybe_multi,
bool maybe_map,
class>
1773 auto const iter(m_cont.find(k,
std::cref(m_config.hash_function()),
std::cref(m_config.key_value_equal())));
1774 if (iter == m_cont.end())
1776 return iter->value.second;
1779template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1780template <
class K,
bool maybe_multi,
bool maybe_map,
class>
1784 auto const iter(m_cont.find(k,
std::cref(m_config.hash_function()),
std::cref(m_config.key_value_equal())));
1785 if (iter == m_cont.end())
1787 return iter->value.second;
1790template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1791template <
bool maybe_multi,
bool maybe_map,
class>
1796 typename cont_type::insert_commit_data d;
1798 m_cont.insert_check(key,
std::cref(m_config.hash_function()),
std::cref(m_config.key_value_equal()), d));
1802 m_cont.insert_commit(*p, d);
1803 chronological.list.push_back(*p);
1804 return p->
value.second;
1806 return result.first->value.second;
1809template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1810template <
bool maybe_multi,
bool maybe_map,
class>
1815 typename cont_type::insert_commit_data d;
1817 m_cont.insert_check(key,
std::cref(m_config.hash_function()),
std::cref(m_config.key_value_equal()), d));
1822 m_cont.insert_commit(*p, d);
1823 chronological.list.push_back(*p);
1824 return p->
value.second;
1826 return result.first->value.second;
1831template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1835 for (
auto iter(chronological.list.begin()); iter != chronological.list.end();)
1836 unlink_and_delete_element(&*iter++);
1837 chronological.list.clear();
1843template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1844template <
bool maybe_multi>
1850 typename cont_type::insert_commit_data d;
1851 auto const result(m_cont.insert_check(
1852 extract(value),
std::cref(m_config.hash_function()),
std::cref(m_config.key_value_equal()), d));
1855 element*
const p(new_element(value));
1856 auto const iter(m_cont.insert_commit(*p, d));
1857 chronological.list.push_back(*p);
1864template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1865template <
bool maybe_multi>
1871 element*
const p(new_element(value));
1872 chronological.list.push_back(*p);
1873 auto const iter(m_cont.insert(*p));
1874 return iterator(iter);
1878template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1879template <
bool maybe_multi,
bool maybe_map>
1885 typename cont_type::insert_commit_data d;
1886 auto const result(m_cont.insert_check(
1887 extract(value),
std::cref(m_config.hash_function()),
std::cref(m_config.key_value_equal()), d));
1890 element*
const p(new_element(std::move(value)));
1891 auto const iter(m_cont.insert_commit(*p, d));
1892 chronological.list.push_back(*p);
1899template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1900template <
bool maybe_multi,
bool maybe_map>
1906 element*
const p(new_element(std::move(value)));
1907 chronological.list.push_back(*p);
1908 auto const iter(m_cont.insert(*p));
1909 return iterator(iter);
1914template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1915template <
bool maybe_multi,
class... Args>
1924 auto const result(m_cont.insert(*p));
1927 chronological.list.push_back(*p);
1935template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1936template <
bool maybe_multi,
class... Args>
1945 typename cont_type::insert_commit_data d;
1946 auto const result(m_cont.insert_check(
1947 extract(p->value),
std::cref(m_config.hash_function()),
std::cref(m_config.key_value_equal()), d));
1950 auto const iter(m_cont.insert_commit(*p, d));
1951 chronological.list.push_back(*p);
1960template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1961template <
bool maybe_multi,
class... Args>
1968 chronological.list.push_back(*p);
1969 auto const iter(m_cont.insert(*p));
1970 return iterator(iter);
1974template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1975template <
bool maybe_multi,
class... Args>
1985 typename cont_type::insert_commit_data d;
1986 auto const result(m_cont.insert_check(
1990 auto const iter(m_cont.insert_commit(*p, d));
1991 chronological.list.push_back(*p);
1998template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
1999template <
bool is_const,
class Iterator>
2004 unlink_and_delete_element(&*((pos++).
iterator()));
2008template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
2009template <
bool is_const,
class Iterator>
2015 for (; first != last;)
2016 unlink_and_delete_element(&*((first++).
iterator()));
2021template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
2026 auto iter(m_cont.find(k,
std::cref(m_config.hash_function()),
std::cref(m_config.key_value_equal())));
2027 if (iter == m_cont.end())
2033 bool const done(m_config(*p, extract(iter->value)));
2034 unlink_and_delete_element(p);
2042template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
2048 std::swap(chronological, other.chronological);
2052template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
2057 auto const now(clock().now());
2059 auto const range(equal_range(k));
2060 for (
auto iter : range)
2068template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
2073 class OtherDuration,
2075 class OtherAllocator,
2087 OtherAllocator>
const& other)
const
2089 if (size() != other.size())
2091 for (
auto iter(cbegin()), last(cend()), otherLast(other.cend()); iter != last; ++iter)
2093 auto otherIter(other.find(extract(*iter)));
2094 if (otherIter == otherLast)
2100template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
2105 class OtherDuration,
2107 class OtherAllocator,
2119 OtherAllocator>
const& other)
const
2121 if (size() != other.size())
2123 for (
auto iter(cbegin()), last(cend()); iter != last;)
2125 auto const& k(extract(*iter));
2126 auto const eq(equal_range(k));
2127 auto const oeq(other.equal_range(k));
2128#if BEAST_NO_CXX14_IS_PERMUTATION
2144template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
2145template <
bool maybe_multi>
2150 typename cont_type::insert_commit_data d;
2151 auto const result(m_cont.insert_check(
2152 extract(value),
std::cref(m_config.hash_function()),
std::cref(m_config.key_value_equal()), d));
2155 element*
const p(new_element(value));
2156 auto const iter(m_cont.insert_commit(*p, d));
2157 chronological.list.push_back(*p);
2164template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
2165template <
bool maybe_multi>
2170 element*
const p(new_element(value));
2171 chronological.list.push_back(*p);
2172 auto const iter(m_cont.insert(*p));
2173 return iterator(iter);
2182template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
2191template <
bool IsMulti,
bool IsMap,
class Key,
class T,
class Clock,
class Hash,
class KeyEqual,
class Allocator>
2218 auto const expired(c.clock().now() - age);
2219 for (
auto iter(c.chronological.cbegin()); iter != c.chronological.cend() && iter.when() <= expired;)
2221 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
const_iterator end() const
beast::detail::aged_container_iterator< true, typename list_type::reverse_iterator > const_reverse_iterator
chronological_t(chronological_t &&)=delete
const_reverse_iterator rbegin() const
beast::detail::aged_container_iterator< true, typename list_type::iterator > const_iterator
const_iterator cbegin() const
reverse_iterator rbegin()
beast::detail::aged_container_iterator<!IsMap, typename list_type::iterator > iterator
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.
beast::detail::aged_container_iterator< true, typename cont_type::iterator > const_iterator
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
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)
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::allocator_traits< Allocator >::template rebind_alloc< element > BucketAllocator
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
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)
beast::detail::aged_container_iterator<!IsMap, typename cont_type::local_iterator > local_iterator
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
beast::detail::aged_container_iterator<!IsMap, typename cont_type::iterator > iterator
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
typename std::allocator_traits< Allocator >::template rebind_alloc< element > ElementAllocator
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< 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)
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)
typename boost::intrusive::make_list< element, boost::intrusive::constant_time_size< false > >::type list_type
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
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
beast::detail::aged_container_iterator< true, typename cont_type::local_iterator > const_local_iterator
value_type const & const_reference
auto insert(value_type &&value) -> typename std::enable_if<!maybe_multi &&!maybe_map, std::pair< iterator, bool > >::type
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)
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