rippled
aged_ordered_container.h
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of Beast: https://github.com/vinniefalco/Beast
4  Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #ifndef BEAST_CONTAINER_DETAIL_AGED_ORDERED_CONTAINER_H_INCLUDED
21 #define BEAST_CONTAINER_DETAIL_AGED_ORDERED_CONTAINER_H_INCLUDED
22 
23 #include <ripple/beast/clock/abstract_clock.h>
24 #include <ripple/beast/container/aged_container.h>
25 #include <ripple/beast/container/detail/aged_associative_container.h>
26 #include <ripple/beast/container/detail/aged_container_iterator.h>
27 #include <ripple/beast/container/detail/empty_base_optimization.h>
28 #include <boost/intrusive/list.hpp>
29 #include <boost/intrusive/set.hpp>
30 #include <boost/version.hpp>
31 #include <algorithm>
32 #include <functional>
33 #include <initializer_list>
34 #include <iterator>
35 #include <memory>
36 #include <type_traits>
37 #include <utility>
38 
39 namespace beast {
40 namespace detail {
41 
42 // Traits templates used to discern reverse_iterators, which are disallowed
43 // for mutating operations.
44 template <class It>
46 {
47  explicit is_boost_reverse_iterator() = default;
48 };
49 
50 template <class It>
51 struct is_boost_reverse_iterator<boost::intrusive::reverse_iterator<It>>
53 {
54  explicit is_boost_reverse_iterator() = default;
55 };
56 
73 template <
74  bool IsMulti,
75  bool IsMap,
76  class Key,
77  class T,
78  class Clock = std::chrono::steady_clock,
79  class Compare = std::less<Key>,
80  class Allocator = std::allocator<
83 {
84 public:
87  using duration = typename clock_type::duration;
88  using key_type = Key;
89  using mapped_type = T;
90  using value_type =
94 
95  // Introspection (for unit tests)
99 
100 private:
101  static Key const&
102  extract(value_type const& value)
103  {
105  }
106 
107  // VFALCO TODO hoist to remove template argument dependencies
108  struct element
109  : boost::intrusive::set_base_hook<
110  boost::intrusive::link_mode<boost::intrusive::normal_link>>,
111  boost::intrusive::list_base_hook<
112  boost::intrusive::link_mode<boost::intrusive::normal_link>>
113  {
114  // Stash types here so the iterator doesn't
115  // need to see the container declaration.
116  struct stashed
117  {
118  explicit stashed() = default;
119 
122  };
123 
124  element(time_point const& when_, value_type const& value_)
125  : value(value_), when(when_)
126  {
127  }
128 
129  element(time_point const& when_, value_type&& value_)
130  : value(std::move(value_)), when(when_)
131  {
132  }
133 
134  template <
135  class... Args,
136  class = typename std::enable_if<
137  std::is_constructible<value_type, Args...>::value>::type>
138  element(time_point const& when_, Args&&... args)
139  : value(std::forward<Args>(args)...), when(when_)
140  {
141  }
142 
145  };
146 
147  // VFALCO TODO This should only be enabled for maps.
148  class pair_value_compare : public Compare
149  {
150  public:
153  using result_type = bool;
154 
155  bool
156  operator()(value_type const& lhs, value_type const& rhs) const
157  {
158  return Compare::operator()(lhs.first, rhs.first);
159  }
160 
162  {
163  }
164 
165  pair_value_compare(pair_value_compare const& other) : Compare(other)
166  {
167  }
168 
169  private:
171 
172  pair_value_compare(Compare const& compare) : Compare(compare)
173  {
174  }
175  };
176 
177  // Compares value_type against element, used in insert_check
178  // VFALCO TODO hoist to remove template argument dependencies
179  class KeyValueCompare : public Compare
180  {
181  public:
182  using first_argument = Key;
184  using result_type = bool;
185 
186  KeyValueCompare() = default;
187 
188  KeyValueCompare(Compare const& compare) : Compare(compare)
189  {
190  }
191 
192  bool
193  operator()(Key const& k, element const& e) const
194  {
195  return Compare::operator()(k, extract(e.value));
196  }
197 
198  bool
199  operator()(element const& e, Key const& k) const
200  {
201  return Compare::operator()(extract(e.value), k);
202  }
203 
204  bool
205  operator()(element const& x, element const& y) const
206  {
207  return Compare::operator()(extract(x.value), extract(y.value));
208  }
209 
210  Compare&
212  {
213  return *this;
214  }
215 
216  Compare const&
217  compare() const
218  {
219  return *this;
220  }
221  };
222 
223  using list_type = typename boost::intrusive::
224  make_list<element, boost::intrusive::constant_time_size<false>>::type;
225 
226  using cont_type = typename std::conditional<
227  IsMulti,
228  typename boost::intrusive::make_multiset<
229  element,
230  boost::intrusive::constant_time_size<true>,
231  boost::intrusive::compare<KeyValueCompare>>::type,
232  typename boost::intrusive::make_set<
233  element,
234  boost::intrusive::constant_time_size<true>,
235  boost::intrusive::compare<KeyValueCompare>>::type>::type;
236 
237  using ElementAllocator = typename std::allocator_traits<
238  Allocator>::template rebind_alloc<element>;
239 
241 
242  class config_t
243  : private KeyValueCompare,
244  public beast::detail::empty_base_optimization<ElementAllocator>
245  {
246  public:
247  explicit config_t(clock_type& clock_) : clock(clock_)
248  {
249  }
250 
251  config_t(clock_type& clock_, Compare const& comp)
252  : KeyValueCompare(comp), clock(clock_)
253  {
254  }
255 
256  config_t(clock_type& clock_, Allocator const& alloc_)
258  , clock(clock_)
259  {
260  }
261 
263  clock_type& clock_,
264  Compare const& comp,
265  Allocator const& alloc_)
266  : KeyValueCompare(comp)
268  , clock(clock_)
269  {
270  }
271 
272  config_t(config_t const& other)
273  : KeyValueCompare(other.key_compare())
275  ElementAllocatorTraits::select_on_container_copy_construction(
276  other.alloc()))
277  , clock(other.clock)
278  {
279  }
280 
281  config_t(config_t const& other, Allocator const& alloc)
282  : KeyValueCompare(other.key_compare())
284  , clock(other.clock)
285  {
286  }
287 
289  : KeyValueCompare(std::move(other.key_compare()))
291  std::move(other))
292  , clock(other.clock)
293  {
294  }
295 
296  config_t(config_t&& other, Allocator const& alloc)
297  : KeyValueCompare(std::move(other.key_compare()))
299  , clock(other.clock)
300  {
301  }
302 
303  config_t&
304  operator=(config_t const& other)
305  {
306  if (this != &other)
307  {
308  compare() = other.compare();
309  alloc() = other.alloc();
310  clock = other.clock;
311  }
312  return *this;
313  }
314 
315  config_t&
317  {
318  compare() = std::move(other.compare());
319  alloc() = std::move(other.alloc());
320  clock = other.clock;
321  return *this;
322  }
323 
324  Compare&
326  {
327  return KeyValueCompare::compare();
328  }
329 
330  Compare const&
331  compare() const
332  {
333  return KeyValueCompare::compare();
334  }
335 
338  {
339  return *this;
340  }
341 
342  KeyValueCompare const&
343  key_compare() const
344  {
345  return *this;
346  }
347 
350  {
353  }
354 
355  ElementAllocator const&
356  alloc() const
357  {
360  }
361 
363  };
364 
365  template <class... Args>
366  element*
367  new_element(Args&&... args)
368  {
369  struct Deleter
370  {
372  Deleter(ElementAllocator& a) : a_(a)
373  {
374  }
375 
376  void
377  operator()(element* p)
378  {
380  }
381  };
382 
385  Deleter(m_config.alloc()));
387  m_config.alloc(),
388  p.get(),
389  clock().now(),
390  std::forward<Args>(args)...);
391  return p.release();
392  }
393 
394  void
395  delete_element(element const* p)
396  {
399  m_config.alloc(), const_cast<element*>(p), 1);
400  }
401 
402  void
403  unlink_and_delete_element(element const* p)
404  {
405  chronological.list.erase(chronological.list.iterator_to(*p));
406  m_cont.erase(m_cont.iterator_to(*p));
407  delete_element(p);
408  }
409 
410 public:
411  using key_compare = Compare;
412  using value_compare =
414  using allocator_type = Allocator;
416  using const_reference = value_type const&;
418  using const_pointer =
420 
421  // A set iterator (IsMap==false) is always const
422  // because the elements of a set are immutable.
423  using iterator = beast::detail::
424  aged_container_iterator<!IsMap, typename cont_type::iterator>;
425  using const_iterator = beast::detail::
426  aged_container_iterator<true, typename cont_type::iterator>;
427  using reverse_iterator = beast::detail::
428  aged_container_iterator<!IsMap, typename cont_type::reverse_iterator>;
429  using const_reverse_iterator = beast::detail::
430  aged_container_iterator<true, typename cont_type::reverse_iterator>;
431 
432  //--------------------------------------------------------------------------
433  //
434  // Chronological ordered iterators
435  //
436  // "Memberspace"
437  // http://accu.org/index.php/journals/1527
438  //
439  //--------------------------------------------------------------------------
440 
442  {
443  public:
444  // A set iterator (IsMap==false) is always const
445  // because the elements of a set are immutable.
446  using iterator = beast::detail::
447  aged_container_iterator<!IsMap, typename list_type::iterator>;
448  using const_iterator = beast::detail::
449  aged_container_iterator<true, typename list_type::iterator>;
451  !IsMap,
452  typename list_type::reverse_iterator>;
453  using const_reverse_iterator = beast::detail::
454  aged_container_iterator<true, typename list_type::reverse_iterator>;
455 
456  iterator
458  {
459  return iterator(list.begin());
460  }
461 
463  begin() const
464  {
465  return const_iterator(list.begin());
466  }
467 
469  cbegin() const
470  {
471  return const_iterator(list.begin());
472  }
473 
474  iterator
475  end()
476  {
477  return iterator(list.end());
478  }
479 
481  end() const
482  {
483  return const_iterator(list.end());
484  }
485 
487  cend() const
488  {
489  return const_iterator(list.end());
490  }
491 
494  {
495  return reverse_iterator(list.rbegin());
496  }
497 
499  rbegin() const
500  {
501  return const_reverse_iterator(list.rbegin());
502  }
503 
505  crbegin() const
506  {
507  return const_reverse_iterator(list.rbegin());
508  }
509 
512  {
513  return reverse_iterator(list.rend());
514  }
515 
517  rend() const
518  {
519  return const_reverse_iterator(list.rend());
520  }
521 
523  crend() const
524  {
525  return const_reverse_iterator(list.rend());
526  }
527 
528  iterator
530  {
531  static_assert(
533  "must be standard layout");
534  return list.iterator_to(*reinterpret_cast<element*>(
535  reinterpret_cast<uint8_t*>(&value) -
536  ((std::size_t)std::addressof(((element*)0)->member))));
537  }
538 
540  iterator_to(value_type const& value) const
541  {
542  static_assert(
544  "must be standard layout");
545  return list.iterator_to(*reinterpret_cast<element const*>(
546  reinterpret_cast<uint8_t const*>(&value) -
547  ((std::size_t)std::addressof(((element*)0)->member))));
548  }
549 
550  private:
552  {
553  }
554 
555  chronological_t(chronological_t const&) = delete;
556  chronological_t(chronological_t&&) = delete;
557 
559  list_type mutable list;
560  } chronological;
561 
562  //--------------------------------------------------------------------------
563  //
564  // Construction
565  //
566  //--------------------------------------------------------------------------
567 
568  aged_ordered_container() = delete;
569 
571 
572  aged_ordered_container(clock_type& clock, Compare const& comp);
573 
574  aged_ordered_container(clock_type& clock, Allocator const& alloc);
575 
577  clock_type& clock,
578  Compare const& comp,
579  Allocator const& alloc);
580 
581  template <class InputIt>
582  aged_ordered_container(InputIt first, InputIt last, clock_type& clock);
583 
584  template <class InputIt>
586  InputIt first,
587  InputIt last,
588  clock_type& clock,
589  Compare const& comp);
590 
591  template <class InputIt>
593  InputIt first,
594  InputIt last,
595  clock_type& clock,
596  Allocator const& alloc);
597 
598  template <class InputIt>
600  InputIt first,
601  InputIt last,
602  clock_type& clock,
603  Compare const& comp,
604  Allocator const& alloc);
605 
607 
609  aged_ordered_container const& other,
610  Allocator const& alloc);
611 
613 
615  aged_ordered_container&& other,
616  Allocator const& alloc);
617 
620  clock_type& clock);
621 
624  clock_type& clock,
625  Compare const& comp);
626 
629  clock_type& clock,
630  Allocator const& alloc);
631 
634  clock_type& clock,
635  Compare const& comp,
636  Allocator const& alloc);
637 
639 
641  operator=(aged_ordered_container const& other);
642 
645 
648 
651  {
652  return m_config.alloc();
653  }
654 
655  clock_type&
657  {
658  return m_config.clock;
659  }
660 
661  clock_type const&
662  clock() const
663  {
664  return m_config.clock;
665  }
666 
667  //--------------------------------------------------------------------------
668  //
669  // Element access (maps)
670  //
671  //--------------------------------------------------------------------------
672 
673  template <
674  class K,
675  bool maybe_multi = IsMulti,
676  bool maybe_map = IsMap,
679  at(K const& k);
680 
681  template <
682  class K,
683  bool maybe_multi = IsMulti,
684  bool maybe_map = IsMap,
687  at(K const& k) const;
688 
689  template <
690  bool maybe_multi = IsMulti,
691  bool maybe_map = IsMap,
694  operator[](Key const& key);
695 
696  template <
697  bool maybe_multi = IsMulti,
698  bool maybe_map = IsMap,
701  operator[](Key&& key);
702 
703  //--------------------------------------------------------------------------
704  //
705  // Iterators
706  //
707  //--------------------------------------------------------------------------
708 
709  iterator
711  {
712  return iterator(m_cont.begin());
713  }
714 
716  begin() const
717  {
718  return const_iterator(m_cont.begin());
719  }
720 
722  cbegin() const
723  {
724  return const_iterator(m_cont.begin());
725  }
726 
727  iterator
728  end()
729  {
730  return iterator(m_cont.end());
731  }
732 
734  end() const
735  {
736  return const_iterator(m_cont.end());
737  }
738 
740  cend() const
741  {
742  return const_iterator(m_cont.end());
743  }
744 
747  {
748  return reverse_iterator(m_cont.rbegin());
749  }
750 
752  rbegin() const
753  {
754  return const_reverse_iterator(m_cont.rbegin());
755  }
756 
758  crbegin() const
759  {
760  return const_reverse_iterator(m_cont.rbegin());
761  }
762 
765  {
766  return reverse_iterator(m_cont.rend());
767  }
768 
770  rend() const
771  {
772  return const_reverse_iterator(m_cont.rend());
773  }
774 
776  crend() const
777  {
778  return const_reverse_iterator(m_cont.rend());
779  }
780 
781  iterator
783  {
784  static_assert(
785  std::is_standard_layout<element>::value, "must be standard layout");
786  return m_cont.iterator_to(*reinterpret_cast<element*>(
787  reinterpret_cast<uint8_t*>(&value) -
788  ((std::size_t)std::addressof(((element*)0)->member))));
789  }
790 
792  iterator_to(value_type const& value) const
793  {
794  static_assert(
795  std::is_standard_layout<element>::value, "must be standard layout");
796  return m_cont.iterator_to(*reinterpret_cast<element const*>(
797  reinterpret_cast<uint8_t const*>(&value) -
798  ((std::size_t)std::addressof(((element*)0)->member))));
799  }
800 
801  //--------------------------------------------------------------------------
802  //
803  // Capacity
804  //
805  //--------------------------------------------------------------------------
806 
807  bool
808  empty() const noexcept
809  {
810  return m_cont.empty();
811  }
812 
813  size_type
814  size() const noexcept
815  {
816  return m_cont.size();
817  }
818 
819  size_type
820  max_size() const noexcept
821  {
822  return m_config.max_size();
823  }
824 
825  //--------------------------------------------------------------------------
826  //
827  // Modifiers
828  //
829  //--------------------------------------------------------------------------
830 
831  void
832  clear();
833 
834  // map, set
835  template <bool maybe_multi = IsMulti>
836  auto
837  insert(value_type const& value) ->
839 
840  // multimap, multiset
841  template <bool maybe_multi = IsMulti>
842  auto
843  insert(value_type const& value) ->
845 
846  // set
847  template <bool maybe_multi = IsMulti, bool maybe_map = IsMap>
848  auto
849  insert(value_type&& value) -> typename std::
850  enable_if<!maybe_multi && !maybe_map, std::pair<iterator, bool>>::type;
851 
852  // multiset
853  template <bool maybe_multi = IsMulti, bool maybe_map = IsMap>
854  auto
855  insert(value_type&& value) ->
857 
858  //---
859 
860  // map, set
861  template <bool maybe_multi = IsMulti>
862  auto
863  insert(const_iterator hint, value_type const& value) ->
865 
866  // multimap, multiset
867  template <bool maybe_multi = IsMulti>
869  insert(const_iterator /*hint*/, value_type const& value)
870  {
871  // VFALCO TODO Figure out how to utilize 'hint'
872  return insert(value);
873  }
874 
875  // map, set
876  template <bool maybe_multi = IsMulti>
877  auto
878  insert(const_iterator hint, value_type&& value) ->
880 
881  // multimap, multiset
882  template <bool maybe_multi = IsMulti>
884  insert(const_iterator /*hint*/, value_type&& value)
885  {
886  // VFALCO TODO Figure out how to utilize 'hint'
887  return insert(std::move(value));
888  }
889 
890  // map, multimap
891  template <class P, bool maybe_map = IsMap>
892  typename std::enable_if<
894  typename std::
895  conditional<IsMulti, iterator, std::pair<iterator, bool>>::type>::
896  type
897  insert(P&& value)
898  {
899  return emplace(std::forward<P>(value));
900  }
901 
902  // map, multimap
903  template <class P, bool maybe_map = IsMap>
904  typename std::enable_if<
906  typename std::
907  conditional<IsMulti, iterator, std::pair<iterator, bool>>::type>::
908  type
909  insert(const_iterator hint, P&& value)
910  {
911  return emplace_hint(hint, std::forward<P>(value));
912  }
913 
914  template <class InputIt>
915  void
916  insert(InputIt first, InputIt last)
917  {
918  for (; first != last; ++first)
919  insert(cend(), *first);
920  }
921 
922  void
924  {
925  insert(init.begin(), init.end());
926  }
927 
928  // map, set
929  template <bool maybe_multi = IsMulti, class... Args>
930  auto
931  emplace(Args&&... args) ->
933 
934  // multiset, multimap
935  template <bool maybe_multi = IsMulti, class... Args>
936  auto
937  emplace(Args&&... args) ->
939 
940  // map, set
941  template <bool maybe_multi = IsMulti, class... Args>
942  auto
943  emplace_hint(const_iterator hint, Args&&... args) ->
945 
946  // multiset, multimap
947  template <bool maybe_multi = IsMulti, class... Args>
949  emplace_hint(const_iterator /*hint*/, Args&&... args)
950  {
951  // VFALCO TODO Figure out how to utilize 'hint'
952  return emplace<maybe_multi>(std::forward<Args>(args)...);
953  }
954 
955  // enable_if prevents erase (reverse_iterator pos) from compiling
956  template <
957  bool is_const,
958  class Iterator,
962 
963  // enable_if prevents erase (reverse_iterator first, reverse_iterator last)
964  // from compiling
965  template <
966  bool is_const,
967  class Iterator,
970  erase(
973 
974  template <class K>
975  auto
976  erase(K const& k) -> size_type;
977 
978  void
979  swap(aged_ordered_container& other) noexcept;
980 
981  //--------------------------------------------------------------------------
982 
983  // enable_if prevents touch (reverse_iterator pos) from compiling
984  template <
985  bool is_const,
986  class Iterator,
988  void
990  {
991  touch(pos, clock().now());
992  }
993 
994  template <class K>
995  size_type
996  touch(K const& k);
997 
998  //--------------------------------------------------------------------------
999  //
1000  // Lookup
1001  //
1002  //--------------------------------------------------------------------------
1003 
1004  // VFALCO TODO Respect is_transparent (c++14)
1005  template <class K>
1006  size_type
1007  count(K const& k) const
1008  {
1009  return m_cont.count(k, std::cref(m_config.key_compare()));
1010  }
1011 
1012  // VFALCO TODO Respect is_transparent (c++14)
1013  template <class K>
1014  iterator
1015  find(K const& k)
1016  {
1017  return iterator(m_cont.find(k, std::cref(m_config.key_compare())));
1018  }
1019 
1020  // VFALCO TODO Respect is_transparent (c++14)
1021  template <class K>
1023  find(K const& k) const
1024  {
1025  return const_iterator(
1026  m_cont.find(k, std::cref(m_config.key_compare())));
1027  }
1028 
1029  // VFALCO TODO Respect is_transparent (c++14)
1030  template <class K>
1032  equal_range(K const& k)
1033  {
1034  auto const r(m_cont.equal_range(k, std::cref(m_config.key_compare())));
1035  return std::make_pair(iterator(r.first), iterator(r.second));
1036  }
1037 
1038  // VFALCO TODO Respect is_transparent (c++14)
1039  template <class K>
1041  equal_range(K const& k) const
1042  {
1043  auto const r(m_cont.equal_range(k, std::cref(m_config.key_compare())));
1044  return std::make_pair(
1045  const_iterator(r.first), const_iterator(r.second));
1046  }
1047 
1048  // VFALCO TODO Respect is_transparent (c++14)
1049  template <class K>
1050  iterator
1051  lower_bound(K const& k)
1052  {
1053  return iterator(
1054  m_cont.lower_bound(k, std::cref(m_config.key_compare())));
1055  }
1056 
1057  // VFALCO TODO Respect is_transparent (c++14)
1058  template <class K>
1060  lower_bound(K const& k) const
1061  {
1062  return const_iterator(
1063  m_cont.lower_bound(k, std::cref(m_config.key_compare())));
1064  }
1065 
1066  // VFALCO TODO Respect is_transparent (c++14)
1067  template <class K>
1068  iterator
1069  upper_bound(K const& k)
1070  {
1071  return iterator(
1072  m_cont.upper_bound(k, std::cref(m_config.key_compare())));
1073  }
1074 
1075  // VFALCO TODO Respect is_transparent (c++14)
1076  template <class K>
1078  upper_bound(K const& k) const
1079  {
1080  return const_iterator(
1081  m_cont.upper_bound(k, std::cref(m_config.key_compare())));
1082  }
1083 
1084  //--------------------------------------------------------------------------
1085  //
1086  // Observers
1087  //
1088  //--------------------------------------------------------------------------
1089 
1090  key_compare
1091  key_comp() const
1092  {
1093  return m_config.compare();
1094  }
1095 
1096  // VFALCO TODO Should this return const reference for set?
1098  value_comp() const
1099  {
1100  return value_compare(m_config.compare());
1101  }
1102 
1103  //--------------------------------------------------------------------------
1104  //
1105  // Comparison
1106  //
1107  //--------------------------------------------------------------------------
1108 
1109  // This differs from the standard in that the comparison
1110  // is only done on the key portion of the value type, ignoring
1111  // the mapped type.
1112  //
1113  template <
1114  bool OtherIsMulti,
1115  bool OtherIsMap,
1116  class OtherT,
1117  class OtherDuration,
1118  class OtherAllocator>
1119  bool
1121  OtherIsMulti,
1122  OtherIsMap,
1123  Key,
1124  OtherT,
1125  OtherDuration,
1126  Compare,
1127  OtherAllocator> const& other) const;
1128 
1129  template <
1130  bool OtherIsMulti,
1131  bool OtherIsMap,
1132  class OtherT,
1133  class OtherDuration,
1134  class OtherAllocator>
1135  bool
1137  OtherIsMulti,
1138  OtherIsMap,
1139  Key,
1140  OtherT,
1141  OtherDuration,
1142  Compare,
1143  OtherAllocator> const& other) const
1144  {
1145  return !(this->operator==(other));
1146  }
1147 
1148  template <
1149  bool OtherIsMulti,
1150  bool OtherIsMap,
1151  class OtherT,
1152  class OtherDuration,
1153  class OtherAllocator>
1154  bool
1156  OtherIsMulti,
1157  OtherIsMap,
1158  Key,
1159  OtherT,
1160  OtherDuration,
1161  Compare,
1162  OtherAllocator> const& other) const
1163  {
1164  value_compare const comp(value_comp());
1166  cbegin(), cend(), other.cbegin(), other.cend(), comp);
1167  }
1168 
1169  template <
1170  bool OtherIsMulti,
1171  bool OtherIsMap,
1172  class OtherT,
1173  class OtherDuration,
1174  class OtherAllocator>
1175  bool
1177  OtherIsMulti,
1178  OtherIsMap,
1179  Key,
1180  OtherT,
1181  OtherDuration,
1182  Compare,
1183  OtherAllocator> const& other) const
1184  {
1185  return !(other < *this);
1186  }
1187 
1188  template <
1189  bool OtherIsMulti,
1190  bool OtherIsMap,
1191  class OtherT,
1192  class OtherDuration,
1193  class OtherAllocator>
1194  bool
1196  OtherIsMulti,
1197  OtherIsMap,
1198  Key,
1199  OtherT,
1200  OtherDuration,
1201  Compare,
1202  OtherAllocator> const& other) const
1203  {
1204  return other < *this;
1205  }
1206 
1207  template <
1208  bool OtherIsMulti,
1209  bool OtherIsMap,
1210  class OtherT,
1211  class OtherDuration,
1212  class OtherAllocator>
1213  bool
1215  OtherIsMulti,
1216  OtherIsMap,
1217  Key,
1218  OtherT,
1219  OtherDuration,
1220  Compare,
1221  OtherAllocator> const& other) const
1222  {
1223  return !(*this < other);
1224  }
1225 
1226 private:
1227  // enable_if prevents erase (reverse_iterator pos, now) from compiling
1228  template <
1229  bool is_const,
1230  class Iterator,
1232  void
1233  touch(
1235  typename clock_type::time_point const& now);
1236 
1237  template <
1238  bool maybe_propagate = std::allocator_traits<
1239  Allocator>::propagate_on_container_swap::value>
1241  swap_data(aged_ordered_container& other) noexcept;
1242 
1243  template <
1244  bool maybe_propagate = std::allocator_traits<
1245  Allocator>::propagate_on_container_swap::value>
1247  swap_data(aged_ordered_container& other) noexcept;
1248 
1249 private:
1250  config_t m_config;
1252 };
1253 
1254 //------------------------------------------------------------------------------
1255 
1256 template <
1257  bool IsMulti,
1258  bool IsMap,
1259  class Key,
1260  class T,
1261  class Clock,
1262  class Compare,
1263  class Allocator>
1266  : m_config(clock)
1267 {
1268 }
1269 
1270 template <
1271  bool IsMulti,
1272  bool IsMap,
1273  class Key,
1274  class T,
1275  class Clock,
1276  class Compare,
1277  class Allocator>
1279  aged_ordered_container(clock_type& clock, Compare const& comp)
1280  : m_config(clock, comp), m_cont(comp)
1281 {
1282 }
1283 
1284 template <
1285  bool IsMulti,
1286  bool IsMap,
1287  class Key,
1288  class T,
1289  class Clock,
1290  class Compare,
1291  class Allocator>
1293  aged_ordered_container(clock_type& clock, Allocator const& alloc)
1294  : m_config(clock, alloc)
1295 {
1296 }
1297 
1298 template <
1299  bool IsMulti,
1300  bool IsMap,
1301  class Key,
1302  class T,
1303  class Clock,
1304  class Compare,
1305  class Allocator>
1308  clock_type& clock,
1309  Compare const& comp,
1310  Allocator const& alloc)
1311  : m_config(clock, comp, alloc), m_cont(comp)
1312 {
1313 }
1314 
1315 template <
1316  bool IsMulti,
1317  bool IsMap,
1318  class Key,
1319  class T,
1320  class Clock,
1321  class Compare,
1322  class Allocator>
1323 template <class InputIt>
1325  aged_ordered_container(InputIt first, InputIt last, clock_type& clock)
1326  : m_config(clock)
1327 {
1328  insert(first, last);
1329 }
1330 
1331 template <
1332  bool IsMulti,
1333  bool IsMap,
1334  class Key,
1335  class T,
1336  class Clock,
1337  class Compare,
1338  class Allocator>
1339 template <class InputIt>
1342  InputIt first,
1343  InputIt last,
1344  clock_type& clock,
1345  Compare const& comp)
1346  : m_config(clock, comp), m_cont(comp)
1347 {
1348  insert(first, last);
1349 }
1350 
1351 template <
1352  bool IsMulti,
1353  bool IsMap,
1354  class Key,
1355  class T,
1356  class Clock,
1357  class Compare,
1358  class Allocator>
1359 template <class InputIt>
1362  InputIt first,
1363  InputIt last,
1364  clock_type& clock,
1365  Allocator const& alloc)
1366  : m_config(clock, alloc)
1367 {
1368  insert(first, last);
1369 }
1370 
1371 template <
1372  bool IsMulti,
1373  bool IsMap,
1374  class Key,
1375  class T,
1376  class Clock,
1377  class Compare,
1378  class Allocator>
1379 template <class InputIt>
1382  InputIt first,
1383  InputIt last,
1384  clock_type& clock,
1385  Compare const& comp,
1386  Allocator const& alloc)
1387  : m_config(clock, comp, alloc), m_cont(comp)
1388 {
1389  insert(first, last);
1390 }
1391 
1392 template <
1393  bool IsMulti,
1394  bool IsMap,
1395  class Key,
1396  class T,
1397  class Clock,
1398  class Compare,
1399  class Allocator>
1402  : m_config(other.m_config)
1403 #if BOOST_VERSION >= 108000
1404  , m_cont(other.m_cont.get_comp())
1405 #else
1406  , m_cont(other.m_cont.comp())
1407 #endif
1408 {
1409  insert(other.cbegin(), other.cend());
1410 }
1411 
1412 template <
1413  bool IsMulti,
1414  bool IsMap,
1415  class Key,
1416  class T,
1417  class Clock,
1418  class Compare,
1419  class Allocator>
1422  aged_ordered_container const& other,
1423  Allocator const& alloc)
1424  : m_config(other.m_config, alloc)
1425 #if BOOST_VERSION >= 108000
1426  , m_cont(other.m_cont.get_comp())
1427 #else
1428  , m_cont(other.m_cont.comp())
1429 #endif
1430 {
1431  insert(other.cbegin(), other.cend());
1432 }
1433 
1434 template <
1435  bool IsMulti,
1436  bool IsMap,
1437  class Key,
1438  class T,
1439  class Clock,
1440  class Compare,
1441  class Allocator>
1444  : m_config(std::move(other.m_config)), m_cont(std::move(other.m_cont))
1445 {
1446  chronological.list = std::move(other.chronological.list);
1447 }
1448 
1449 template <
1450  bool IsMulti,
1451  bool IsMap,
1452  class Key,
1453  class T,
1454  class Clock,
1455  class Compare,
1456  class Allocator>
1459  aged_ordered_container&& other,
1460  Allocator const& alloc)
1461  : m_config(std::move(other.m_config), alloc)
1462 #if BOOST_VERSION >= 108000
1463  , m_cont(std::move(other.m_cont.get_comp()))
1464 #else
1465  , m_cont(std::move(other.m_cont.comp()))
1466 #endif
1467 
1468 {
1469  insert(other.cbegin(), other.cend());
1470  other.clear();
1471 }
1472 
1473 template <
1474  bool IsMulti,
1475  bool IsMap,
1476  class Key,
1477  class T,
1478  class Clock,
1479  class Compare,
1480  class Allocator>
1484  clock_type& clock)
1485  : m_config(clock)
1486 {
1487  insert(init.begin(), init.end());
1488 }
1489 
1490 template <
1491  bool IsMulti,
1492  bool IsMap,
1493  class Key,
1494  class T,
1495  class Clock,
1496  class Compare,
1497  class Allocator>
1501  clock_type& clock,
1502  Compare const& comp)
1503  : m_config(clock, comp), m_cont(comp)
1504 {
1505  insert(init.begin(), init.end());
1506 }
1507 
1508 template <
1509  bool IsMulti,
1510  bool IsMap,
1511  class Key,
1512  class T,
1513  class Clock,
1514  class Compare,
1515  class Allocator>
1519  clock_type& clock,
1520  Allocator const& alloc)
1521  : m_config(clock, alloc)
1522 {
1523  insert(init.begin(), init.end());
1524 }
1525 
1526 template <
1527  bool IsMulti,
1528  bool IsMap,
1529  class Key,
1530  class T,
1531  class Clock,
1532  class Compare,
1533  class Allocator>
1537  clock_type& clock,
1538  Compare const& comp,
1539  Allocator const& alloc)
1540  : m_config(clock, comp, alloc), m_cont(comp)
1541 {
1542  insert(init.begin(), init.end());
1543 }
1544 
1545 template <
1546  bool IsMulti,
1547  bool IsMap,
1548  class Key,
1549  class T,
1550  class Clock,
1551  class Compare,
1552  class Allocator>
1555 {
1556  clear();
1557 }
1558 
1559 template <
1560  bool IsMulti,
1561  bool IsMap,
1562  class Key,
1563  class T,
1564  class Clock,
1565  class Compare,
1566  class Allocator>
1567 auto
1570 {
1571  if (this != &other)
1572  {
1573  clear();
1574  this->m_config = other.m_config;
1575  insert(other.begin(), other.end());
1576  }
1577  return *this;
1578 }
1579 
1580 template <
1581  bool IsMulti,
1582  bool IsMap,
1583  class Key,
1584  class T,
1585  class Clock,
1586  class Compare,
1587  class Allocator>
1588 auto
1591 {
1592  clear();
1593  this->m_config = std::move(other.m_config);
1594  insert(other.begin(), other.end());
1595  other.clear();
1596  return *this;
1597 }
1598 
1599 template <
1600  bool IsMulti,
1601  bool IsMap,
1602  class Key,
1603  class T,
1604  class Clock,
1605  class Compare,
1606  class Allocator>
1607 auto
1610 {
1611  clear();
1612  insert(init);
1613  return *this;
1614 }
1615 
1616 //------------------------------------------------------------------------------
1617 
1618 template <
1619  bool IsMulti,
1620  bool IsMap,
1621  class Key,
1622  class T,
1623  class Clock,
1624  class Compare,
1625  class Allocator>
1626 template <class K, bool maybe_multi, bool maybe_map, class>
1629  K const& k)
1630 {
1631  auto const iter(m_cont.find(k, std::cref(m_config.key_compare())));
1632  if (iter == m_cont.end())
1633  throw std::out_of_range("key not found");
1634  return iter->value.second;
1635 }
1636 
1637 template <
1638  bool IsMulti,
1639  bool IsMap,
1640  class Key,
1641  class T,
1642  class Clock,
1643  class Compare,
1644  class Allocator>
1645 template <class K, bool maybe_multi, bool maybe_map, class>
1648  K const& k) const
1649 {
1650  auto const iter(m_cont.find(k, std::cref(m_config.key_compare())));
1651  if (iter == m_cont.end())
1652  throw std::out_of_range("key not found");
1653  return iter->value.second;
1654 }
1655 
1656 template <
1657  bool IsMulti,
1658  bool IsMap,
1659  class Key,
1660  class T,
1661  class Clock,
1662  class Compare,
1663  class Allocator>
1664 template <bool maybe_multi, bool maybe_map, class>
1667 operator[](Key const& key)
1668 {
1669  typename cont_type::insert_commit_data d;
1670  auto const result(
1671  m_cont.insert_check(key, std::cref(m_config.key_compare()), d));
1672  if (result.second)
1673  {
1674  element* const p(new_element(
1675  std::piecewise_construct,
1676  std::forward_as_tuple(key),
1678  m_cont.insert_commit(*p, d);
1679  chronological.list.push_back(*p);
1680  return p->value.second;
1681  }
1682  return result.first->value.second;
1683 }
1684 
1685 template <
1686  bool IsMulti,
1687  bool IsMap,
1688  class Key,
1689  class T,
1690  class Clock,
1691  class Compare,
1692  class Allocator>
1693 template <bool maybe_multi, bool maybe_map, class>
1696 operator[](Key&& key)
1697 {
1698  typename cont_type::insert_commit_data d;
1699  auto const result(
1700  m_cont.insert_check(key, std::cref(m_config.key_compare()), d));
1701  if (result.second)
1702  {
1703  element* const p(new_element(
1704  std::piecewise_construct,
1705  std::forward_as_tuple(std::move(key)),
1707  m_cont.insert_commit(*p, d);
1708  chronological.list.push_back(*p);
1709  return p->value.second;
1710  }
1711  return result.first->value.second;
1712 }
1713 
1714 //------------------------------------------------------------------------------
1715 
1716 template <
1717  bool IsMulti,
1718  bool IsMap,
1719  class Key,
1720  class T,
1721  class Clock,
1722  class Compare,
1723  class Allocator>
1724 void
1727 {
1728  for (auto iter(chronological.list.begin());
1729  iter != chronological.list.end();)
1730  delete_element(&*iter++);
1731  chronological.list.clear();
1732  m_cont.clear();
1733 }
1734 
1735 // map, set
1736 template <
1737  bool IsMulti,
1738  bool IsMap,
1739  class Key,
1740  class T,
1741  class Clock,
1742  class Compare,
1743  class Allocator>
1744 template <bool maybe_multi>
1745 auto
1747  insert(value_type const& value) ->
1749 {
1750  typename cont_type::insert_commit_data d;
1751  auto const result(m_cont.insert_check(
1752  extract(value), std::cref(m_config.key_compare()), d));
1753  if (result.second)
1754  {
1755  element* const p(new_element(value));
1756  auto const iter(m_cont.insert_commit(*p, d));
1757  chronological.list.push_back(*p);
1758  return std::make_pair(iterator(iter), true);
1759  }
1760  return std::make_pair(iterator(result.first), false);
1761 }
1762 
1763 // multimap, multiset
1764 template <
1765  bool IsMulti,
1766  bool IsMap,
1767  class Key,
1768  class T,
1769  class Clock,
1770  class Compare,
1771  class Allocator>
1772 template <bool maybe_multi>
1773 auto
1775  insert(value_type const& value) ->
1777 {
1778  auto const before(
1779  m_cont.upper_bound(extract(value), std::cref(m_config.key_compare())));
1780  element* const p(new_element(value));
1781  chronological.list.push_back(*p);
1782  auto const iter(m_cont.insert_before(before, *p));
1783  return iterator(iter);
1784 }
1785 
1786 // set
1787 template <
1788  bool IsMulti,
1789  bool IsMap,
1790  class Key,
1791  class T,
1792  class Clock,
1793  class Compare,
1794  class Allocator>
1795 template <bool maybe_multi, bool maybe_map>
1796 auto
1798  insert(value_type&& value) -> typename std::
1799  enable_if<!maybe_multi && !maybe_map, std::pair<iterator, bool>>::type
1800 {
1801  typename cont_type::insert_commit_data d;
1802  auto const result(m_cont.insert_check(
1803  extract(value), std::cref(m_config.key_compare()), d));
1804  if (result.second)
1805  {
1806  element* const p(new_element(std::move(value)));
1807  auto const iter(m_cont.insert_commit(*p, d));
1808  chronological.list.push_back(*p);
1809  return std::make_pair(iterator(iter), true);
1810  }
1811  return std::make_pair(iterator(result.first), false);
1812 }
1813 
1814 // multiset
1815 template <
1816  bool IsMulti,
1817  bool IsMap,
1818  class Key,
1819  class T,
1820  class Clock,
1821  class Compare,
1822  class Allocator>
1823 template <bool maybe_multi, bool maybe_map>
1824 auto
1826  insert(value_type&& value) ->
1828 {
1829  auto const before(
1830  m_cont.upper_bound(extract(value), std::cref(m_config.key_compare())));
1831  element* const p(new_element(std::move(value)));
1832  chronological.list.push_back(*p);
1833  auto const iter(m_cont.insert_before(before, *p));
1834  return iterator(iter);
1835 }
1836 
1837 //---
1838 
1839 // map, set
1840 template <
1841  bool IsMulti,
1842  bool IsMap,
1843  class Key,
1844  class T,
1845  class Clock,
1846  class Compare,
1847  class Allocator>
1848 template <bool maybe_multi>
1849 auto
1851  insert(const_iterator hint, value_type const& value) ->
1853 {
1854  typename cont_type::insert_commit_data d;
1855  auto const result(m_cont.insert_check(
1856  hint.iterator(), extract(value), std::cref(m_config.key_compare()), d));
1857  if (result.second)
1858  {
1859  element* const p(new_element(value));
1860  auto const iter(m_cont.insert_commit(*p, d));
1861  chronological.list.push_back(*p);
1862  return iterator(iter);
1863  }
1864  return iterator(result.first);
1865 }
1866 
1867 // map, set
1868 template <
1869  bool IsMulti,
1870  bool IsMap,
1871  class Key,
1872  class T,
1873  class Clock,
1874  class Compare,
1875  class Allocator>
1876 template <bool maybe_multi>
1877 auto
1881 {
1882  typename cont_type::insert_commit_data d;
1883  auto const result(m_cont.insert_check(
1884  hint.iterator(), extract(value), std::cref(m_config.key_compare()), d));
1885  if (result.second)
1886  {
1887  element* const p(new_element(std::move(value)));
1888  auto const iter(m_cont.insert_commit(*p, d));
1889  chronological.list.push_back(*p);
1890  return iterator(iter);
1891  }
1892  return iterator(result.first);
1893 }
1894 
1895 // map, set
1896 template <
1897  bool IsMulti,
1898  bool IsMap,
1899  class Key,
1900  class T,
1901  class Clock,
1902  class Compare,
1903  class Allocator>
1904 template <bool maybe_multi, class... Args>
1905 auto
1907  emplace(Args&&... args) ->
1909 {
1910  // VFALCO NOTE Its unfortunate that we need to
1911  // construct element here
1912  element* const p(new_element(std::forward<Args>(args)...));
1913  typename cont_type::insert_commit_data d;
1914  auto const result(m_cont.insert_check(
1915  extract(p->value), std::cref(m_config.key_compare()), d));
1916  if (result.second)
1917  {
1918  auto const iter(m_cont.insert_commit(*p, d));
1919  chronological.list.push_back(*p);
1920  return std::make_pair(iterator(iter), true);
1921  }
1922  delete_element(p);
1923  return std::make_pair(iterator(result.first), false);
1924 }
1925 
1926 // multiset, multimap
1927 template <
1928  bool IsMulti,
1929  bool IsMap,
1930  class Key,
1931  class T,
1932  class Clock,
1933  class Compare,
1934  class Allocator>
1935 template <bool maybe_multi, class... Args>
1936 auto
1938  emplace(Args&&... args) ->
1940 {
1941  element* const p(new_element(std::forward<Args>(args)...));
1942  auto const before(m_cont.upper_bound(
1943  extract(p->value), std::cref(m_config.key_compare())));
1944  chronological.list.push_back(*p);
1945  auto const iter(m_cont.insert_before(before, *p));
1946  return iterator(iter);
1947 }
1948 
1949 // map, set
1950 template <
1951  bool IsMulti,
1952  bool IsMap,
1953  class Key,
1954  class T,
1955  class Clock,
1956  class Compare,
1957  class Allocator>
1958 template <bool maybe_multi, class... Args>
1959 auto
1961  emplace_hint(const_iterator hint, Args&&... args) ->
1963 {
1964  // VFALCO NOTE Its unfortunate that we need to
1965  // construct element here
1966  element* const p(new_element(std::forward<Args>(args)...));
1967  typename cont_type::insert_commit_data d;
1968  auto const result(m_cont.insert_check(
1969  hint.iterator(),
1970  extract(p->value),
1971  std::cref(m_config.key_compare()),
1972  d));
1973  if (result.second)
1974  {
1975  auto const iter(m_cont.insert_commit(*p, d));
1976  chronological.list.push_back(*p);
1977  return std::make_pair(iterator(iter), true);
1978  }
1979  delete_element(p);
1980  return std::make_pair(iterator(result.first), false);
1981 }
1982 
1983 template <
1984  bool IsMulti,
1985  bool IsMap,
1986  class Key,
1987  class T,
1988  class Clock,
1989  class Compare,
1990  class Allocator>
1991 template <bool is_const, class Iterator, class>
1995 {
1996  unlink_and_delete_element(&*((pos++).iterator()));
1998  pos.iterator());
1999 }
2000 
2001 template <
2002  bool IsMulti,
2003  bool IsMap,
2004  class Key,
2005  class T,
2006  class Clock,
2007  class Compare,
2008  class Allocator>
2009 template <bool is_const, class Iterator, class>
2015 {
2016  for (; first != last;)
2017  unlink_and_delete_element(&*((first++).iterator()));
2018 
2020  first.iterator());
2021 }
2022 
2023 template <
2024  bool IsMulti,
2025  bool IsMap,
2026  class Key,
2027  class T,
2028  class Clock,
2029  class Compare,
2030  class Allocator>
2031 template <class K>
2032 auto
2034  erase(K const& k) -> size_type
2035 {
2036  auto iter(m_cont.find(k, std::cref(m_config.key_compare())));
2037  if (iter == m_cont.end())
2038  return 0;
2039  size_type n(0);
2040  for (;;)
2041  {
2042  auto p(&*iter++);
2043  bool const done(m_config(*p, extract(iter->value)));
2044  unlink_and_delete_element(p);
2045  ++n;
2046  if (done)
2047  break;
2048  }
2049  return n;
2050 }
2051 
2052 template <
2053  bool IsMulti,
2054  bool IsMap,
2055  class Key,
2056  class T,
2057  class Clock,
2058  class Compare,
2059  class Allocator>
2060 void
2062  aged_ordered_container& other) noexcept
2063 {
2064  swap_data(other);
2065  std::swap(chronological, other.chronological);
2066  std::swap(m_cont, other.m_cont);
2067 }
2068 
2069 //------------------------------------------------------------------------------
2070 
2071 template <
2072  bool IsMulti,
2073  bool IsMap,
2074  class Key,
2075  class T,
2076  class Clock,
2077  class Compare,
2078  class Allocator>
2079 template <class K>
2080 auto
2082  touch(K const& k) -> size_type
2083 {
2084  auto const now(clock().now());
2085  size_type n(0);
2086  auto const range(equal_range(k));
2087  for (auto iter : range)
2088  {
2089  touch(iter, now);
2090  ++n;
2091  }
2092  return n;
2093 }
2094 
2095 //------------------------------------------------------------------------------
2096 
2097 template <
2098  bool IsMulti,
2099  bool IsMap,
2100  class Key,
2101  class T,
2102  class Clock,
2103  class Compare,
2104  class Allocator>
2105 template <
2106  bool OtherIsMulti,
2107  bool OtherIsMap,
2108  class OtherT,
2109  class OtherDuration,
2110  class OtherAllocator>
2111 bool
2114  OtherIsMulti,
2115  OtherIsMap,
2116  Key,
2117  OtherT,
2118  OtherDuration,
2119  Compare,
2120  OtherAllocator> const& other) const
2121 {
2122  using Other = aged_ordered_container<
2123  OtherIsMulti,
2124  OtherIsMap,
2125  Key,
2126  OtherT,
2127  OtherDuration,
2128  Compare,
2129  OtherAllocator>;
2130  if (size() != other.size())
2131  return false;
2133  return std::equal(
2134  cbegin(),
2135  cend(),
2136  other.cbegin(),
2137  other.cend(),
2138  [&eq, &other](
2139  value_type const& lhs, typename Other::value_type const& rhs) {
2140  return eq(extract(lhs), other.extract(rhs));
2141  });
2142 }
2143 
2144 //------------------------------------------------------------------------------
2145 
2146 template <
2147  bool IsMulti,
2148  bool IsMap,
2149  class Key,
2150  class T,
2151  class Clock,
2152  class Compare,
2153  class Allocator>
2154 template <bool is_const, class Iterator, class>
2155 void
2159  typename clock_type::time_point const& now)
2160 {
2161  auto& e(*pos.iterator());
2162  e.when = now;
2163  chronological.list.erase(chronological.list.iterator_to(e));
2164  chronological.list.push_back(e);
2165 }
2166 
2167 template <
2168  bool IsMulti,
2169  bool IsMap,
2170  class Key,
2171  class T,
2172  class Clock,
2173  class Compare,
2174  class Allocator>
2175 template <bool maybe_propagate>
2179 {
2180  std::swap(m_config.key_compare(), other.m_config.key_compare());
2181  std::swap(m_config.alloc(), other.m_config.alloc());
2182  std::swap(m_config.clock, other.m_config.clock);
2183 }
2184 
2185 template <
2186  bool IsMulti,
2187  bool IsMap,
2188  class Key,
2189  class T,
2190  class Clock,
2191  class Compare,
2192  class Allocator>
2193 template <bool maybe_propagate>
2196  swap_data(aged_ordered_container& other) noexcept
2197 {
2198  std::swap(m_config.key_compare(), other.m_config.key_compare());
2199  std::swap(m_config.clock, other.m_config.clock);
2200 }
2201 
2202 } // namespace detail
2203 
2204 //------------------------------------------------------------------------------
2205 
2206 template <
2207  bool IsMulti,
2208  bool IsMap,
2209  class Key,
2210  class T,
2211  class Clock,
2212  class Compare,
2213  class Allocator>
2215  IsMulti,
2216  IsMap,
2217  Key,
2218  T,
2219  Clock,
2220  Compare,
2221  Allocator>> : std::true_type
2222 {
2223  explicit is_aged_container() = default;
2224 };
2225 
2226 // Free functions
2227 
2228 template <
2229  bool IsMulti,
2230  bool IsMap,
2231  class Key,
2232  class T,
2233  class Clock,
2234  class Compare,
2235  class Allocator>
2236 void
2237 swap(
2239  IsMulti,
2240  IsMap,
2241  Key,
2242  T,
2243  Clock,
2244  Compare,
2245  Allocator>& lhs,
2247  IsMulti,
2248  IsMap,
2249  Key,
2250  T,
2251  Clock,
2252  Compare,
2253  Allocator>& rhs) noexcept
2254 {
2255  lhs.swap(rhs);
2256 }
2257 
2259 template <
2260  bool IsMulti,
2261  bool IsMap,
2262  class Key,
2263  class T,
2264  class Clock,
2265  class Compare,
2266  class Allocator,
2267  class Rep,
2268  class Period>
2272  IsMulti,
2273  IsMap,
2274  Key,
2275  T,
2276  Clock,
2277  Compare,
2278  Allocator>& c,
2280 {
2281  std::size_t n(0);
2282  auto const expired(c.clock().now() - age);
2283  for (auto iter(c.chronological.cbegin());
2284  iter != c.chronological.cend() && iter.when() <= expired;)
2285  {
2286  iter = c.erase(iter);
2287  ++n;
2288  }
2289  return n;
2290 }
2291 
2292 } // namespace beast
2293 
2294 #endif
std::is_standard_layout
beast::detail::aged_ordered_container::config_t::alloc
ElementAllocator const & alloc() const
Definition: aged_ordered_container.h:356
beast::detail::aged_ordered_container::new_element
element * new_element(Args &&... args)
Definition: aged_ordered_container.h:367
beast::detail::aged_ordered_container::chronological_t::rbegin
reverse_iterator rbegin()
Definition: aged_ordered_container.h:493
beast::detail::aged_ordered_container::empty
bool empty() const noexcept
Definition: aged_ordered_container.h:808
beast::detail::aged_ordered_container::operator==
bool operator==(aged_ordered_container< OtherIsMulti, OtherIsMap, Key, OtherT, OtherDuration, Compare, OtherAllocator > const &other) const
Definition: aged_ordered_container.h:2113
beast::detail::aged_ordered_container::pair_value_compare::second_argument
value_type second_argument
Definition: aged_ordered_container.h:152
beast::detail::aged_ordered_container::chronological_t::begin
const_iterator begin() const
Definition: aged_ordered_container.h:463
beast::detail::aged_ordered_container::clear
void clear()
Definition: aged_ordered_container.h:1726
beast::detail::aged_ordered_container::element::stashed::time_point
typename aged_ordered_container::time_point time_point
Definition: aged_ordered_container.h:121
std::chrono::steady_clock
beast::detail::aged_ordered_container::config_t::key_compare
KeyValueCompare const & key_compare() const
Definition: aged_ordered_container.h:343
beast::detail::aged_ordered_container::config_t::config_t
config_t(clock_type &clock_, Compare const &comp, Allocator const &alloc_)
Definition: aged_ordered_container.h:262
beast::detail::aged_ordered_container::extract
static Key const & extract(value_type const &value)
Definition: aged_ordered_container.h:102
beast::detail::aged_ordered_container::chronological_t::cend
const_iterator cend() const
Definition: aged_ordered_container.h:487
beast::detail::aged_ordered_container::operator>
bool operator>(aged_ordered_container< OtherIsMulti, OtherIsMap, Key, OtherT, OtherDuration, Compare, OtherAllocator > const &other) const
Definition: aged_ordered_container.h:1195
std::false_type
beast::detail::aged_ordered_container::lower_bound
iterator lower_bound(K const &k)
Definition: aged_ordered_container.h:1051
beast::detail::aged_ordered_container::chronological_t::list
list_type list
Definition: aged_ordered_container.h:559
beast::detail::aged_ordered_container::begin
const_iterator begin() const
Definition: aged_ordered_container.h:716
std::equal
T equal(T... args)
beast::detail::aged_ordered_container< beast::IP::Address >::mapped_type
T mapped_type
Definition: aged_ordered_container.h:89
utility
beast::detail::aged_ordered_container::config_t::operator=
config_t & operator=(config_t const &other)
Definition: aged_ordered_container.h:304
beast::detail::aged_ordered_container::config_t::config_t
config_t(clock_type &clock_)
Definition: aged_ordered_container.h:247
beast::detail::aged_ordered_container::value_comp
value_compare value_comp() const
Definition: aged_ordered_container.h:1098
beast::detail::aged_ordered_container::rend
reverse_iterator rend()
Definition: aged_ordered_container.h:764
beast::detail::aged_ordered_container::chronological_t::crend
const_reverse_iterator crend() const
Definition: aged_ordered_container.h:523
beast::detail::aged_ordered_container::chronological_t::const_iterator
beast::detail::aged_container_iterator< true, typename list_type::iterator > const_iterator
Definition: aged_ordered_container.h:449
functional
beast::detail::aged_ordered_container::max_size
size_type max_size() const noexcept
Definition: aged_ordered_container.h:820
std::pair
beast::detail::aged_ordered_container::at
std::conditional< IsMap, T, void * >::type & at(K const &k)
Definition: aged_ordered_container.h:1628
beast::detail::is_boost_reverse_iterator::is_boost_reverse_iterator
is_boost_reverse_iterator()=default
beast::detail::aged_ordered_container::element::stashed::stashed
stashed()=default
beast::detail::aged_ordered_container::KeyValueCompare
Definition: aged_ordered_container.h:179
beast::is_aged_container
Definition: aged_container.h:28
beast::detail::aged_ordered_container< beast::IP::Address >::const_reference
value_type const & const_reference
Definition: aged_ordered_container.h:416
beast::detail::aged_ordered_container::config_t::config_t
config_t(clock_type &clock_, Compare const &comp)
Definition: aged_ordered_container.h:251
std::chrono::duration
beast::detail::aged_ordered_container::KeyValueCompare::compare
Compare const & compare() const
Definition: aged_ordered_container.h:217
beast::detail::aged_ordered_container::lower_bound
const_iterator lower_bound(K const &k) const
Definition: aged_ordered_container.h:1060
iterator
beast::detail::aged_ordered_container< beast::IP::Address >::value_type
typename std::conditional< IsMap, std::pair< Key const, T >, Key >::type value_type
Definition: aged_ordered_container.h:91
beast::detail::aged_ordered_container::list_type
typename boost::intrusive::make_list< element, boost::intrusive::constant_time_size< false > >::type list_type
Definition: aged_ordered_container.h:224
beast::detail::aged_ordered_container::insert
auto insert(value_type const &value) -> typename std::enable_if<!maybe_multi, std::pair< iterator, bool >>::type
Definition: aged_ordered_container.h:1747
beast::detail::aged_ordered_container::config_t::config_t
config_t(config_t &&other, Allocator const &alloc)
Definition: aged_ordered_container.h:296
beast::detail::aged_ordered_container::config_t::key_compare
KeyValueCompare & key_compare()
Definition: aged_ordered_container.h:337
beast::detail::aged_ordered_container::chronological_t::cbegin
const_iterator cbegin() const
Definition: aged_ordered_container.h:469
std::reference_wrapper::get
T get(T... args)
beast::compare
int compare(SemanticVersion const &lhs, SemanticVersion const &rhs)
Compare two SemanticVersions against each other.
Definition: SemanticVersion.cpp:259
std::unique_ptr::release
T release(T... args)
beast::detail::aged_ordered_container::equal_range
std::pair< const_iterator, const_iterator > equal_range(K const &k) const
Definition: aged_ordered_container.h:1041
beast::detail::aged_ordered_container::element::stashed
Definition: aged_ordered_container.h:116
beast::detail::aged_ordered_container::chronological_t::crbegin
const_reverse_iterator crbegin() const
Definition: aged_ordered_container.h:505
beast::detail::aged_ordered_container::end
const_iterator end() const
Definition: aged_ordered_container.h:734
beast::detail::aged_ordered_container::m_cont
cont_type m_cont
Definition: aged_ordered_container.h:1251
beast::detail::aged_ordered_container::KeyValueCompare::operator()
bool operator()(Key const &k, element const &e) const
Definition: aged_ordered_container.h:193
beast::detail::aged_ordered_container::iterator_to
iterator iterator_to(value_type &value)
Definition: aged_ordered_container.h:782
beast::detail::aged_ordered_container::config_t::config_t
config_t(config_t const &other)
Definition: aged_ordered_container.h:272
boost
Definition: IPAddress.h:103
beast::detail::aged_ordered_container::KeyValueCompare::operator()
bool operator()(element const &x, element const &y) const
Definition: aged_ordered_container.h:205
beast::detail::empty_base_optimization
Definition: empty_base_optimization.h:32
beast::detail::aged_ordered_container::operator>=
bool operator>=(aged_ordered_container< OtherIsMulti, OtherIsMap, Key, OtherT, OtherDuration, Compare, OtherAllocator > const &other) const
Definition: aged_ordered_container.h:1214
beast::detail::aged_ordered_container::unlink_and_delete_element
void unlink_and_delete_element(element const *p)
Definition: aged_ordered_container.h:403
beast::detail::aged_ordered_container::element::element
element(time_point const &when_, Args &&... args)
Definition: aged_ordered_container.h:138
beast::detail::aged_ordered_container::chronological_t::rend
reverse_iterator rend()
Definition: aged_ordered_container.h:511
std::less
beast::detail::aged_ordered_container::config_t::config_t
config_t(config_t &&other)
Definition: aged_ordered_container.h:288
beast::detail::empty_base_optimization< ElementAllocator >::member
ElementAllocator & member() noexcept
Definition: empty_base_optimization.h:50
std::allocator_traits
algorithm
beast::detail::aged_ordered_container< beast::IP::Address >::time_point
typename clock_type::time_point time_point
Definition: aged_ordered_container.h:86
beast::detail::aged_ordered_container::swap_data
std::enable_if< maybe_propagate >::type swap_data(aged_ordered_container &other) noexcept
Definition: aged_ordered_container.h:2178
beast::detail::aged_ordered_container::pair_value_compare::operator()
bool operator()(value_type const &lhs, value_type const &rhs) const
Definition: aged_ordered_container.h:156
beast::detail::aged_ordered_container::chronological_t::iterator_to
iterator iterator_to(value_type &value)
Definition: aged_ordered_container.h:529
beast::detail::aged_ordered_container::count
size_type count(K const &k) const
Definition: aged_ordered_container.h:1007
beast::detail::aged_ordered_container::config_t::clock
std::reference_wrapper< clock_type > clock
Definition: aged_ordered_container.h:362
beast::detail::aged_ordered_container::operator<=
bool operator<=(aged_ordered_container< OtherIsMulti, OtherIsMap, Key, OtherT, OtherDuration, Compare, OtherAllocator > const &other) const
Definition: aged_ordered_container.h:1176
beast::detail::aged_ordered_container::emplace_hint
std::enable_if< maybe_multi, iterator >::type emplace_hint(const_iterator, Args &&... args)
Definition: aged_ordered_container.h:949
beast::detail::aged_associative_container_extract_t
Definition: aged_associative_container.h:30
beast::detail::aged_ordered_container::insert
std::enable_if< maybe_multi, iterator >::type insert(const_iterator, value_type const &value)
Definition: aged_ordered_container.h:869
beast::detail::aged_ordered_container::chronological_t::iterator_to
const_iterator iterator_to(value_type const &value) const
Definition: aged_ordered_container.h:540
beast::detail::aged_ordered_container< beast::IP::Address >::ElementAllocator
typename std::allocator_traits< std::allocator< typename std::conditional< IsMap, std::pair< Key const, T >, Key >::type > >::template rebind_alloc< element > ElementAllocator
Definition: aged_ordered_container.h:238
beast::detail::aged_ordered_container::chronological_t::end
const_iterator end() const
Definition: aged_ordered_container.h:481
beast::detail::aged_ordered_container::key_comp
key_compare key_comp() const
Definition: aged_ordered_container.h:1091
beast::detail::aged_ordered_container::element::element
element(time_point const &when_, value_type const &value_)
Definition: aged_ordered_container.h:124
std::addressof
T addressof(T... args)
beast::detail::aged_ordered_container< beast::IP::Address >::pointer
typename std::allocator_traits< std::allocator< typename std::conditional< IsMap, std::pair< Key const, T >, Key >::type > >::pointer pointer
Definition: aged_ordered_container.h:417
beast::detail::aged_ordered_container::KeyValueCompare::operator()
bool operator()(element const &e, Key const &k) const
Definition: aged_ordered_container.h:199
std::reference_wrapper
beast::detail::aged_ordered_container::~aged_ordered_container
~aged_ordered_container()
Definition: aged_ordered_container.h:1554
beast::detail::aged_ordered_container::pair_value_compare::pair_value_compare
pair_value_compare(Compare const &compare)
Definition: aged_ordered_container.h:172
beast::detail::aged_ordered_container::chronological_t::end
iterator end()
Definition: aged_ordered_container.h:475
beast::detail::aged_ordered_container::swap
void swap(aged_ordered_container &other) noexcept
Definition: aged_ordered_container.h:2061
beast::detail::aged_ordered_container::find
iterator find(K const &k)
Definition: aged_ordered_container.h:1015
beast::detail::aged_ordered_container::cend
const_iterator cend() const
Definition: aged_ordered_container.h:740
std::enable_if
beast::detail::aged_ordered_container::clock
clock_type & clock()
Definition: aged_ordered_container.h:656
beast::detail::aged_ordered_container::pair_value_compare::first_argument
value_type first_argument
Definition: aged_ordered_container.h:151
beast::detail::aged_ordered_container::chronological_t::begin
iterator begin()
Definition: aged_ordered_container.h:457
beast::detail::aged_ordered_container::element::element
element(time_point const &when_, value_type &&value_)
Definition: aged_ordered_container.h:129
beast::detail::aged_ordered_container::chronological_t::rend
const_reverse_iterator rend() const
Definition: aged_ordered_container.h:517
std::lexicographical_compare
T lexicographical_compare(T... args)
beast::detail::aged_ordered_container::chronological_t
Definition: aged_ordered_container.h:441
std::allocator_traits::allocate
T allocate(T... args)
beast::detail::aged_ordered_container::emplace
auto emplace(Args &&... args) -> typename std::enable_if<!maybe_multi, std::pair< iterator, bool >>::type
Definition: aged_ordered_container.h:1907
beast::detail::aged_ordered_container::chronological_t::iterator
beast::detail::aged_container_iterator<!IsMap, typename list_type::iterator > iterator
Definition: aged_ordered_container.h:447
beast::detail::aged_ordered_container< beast::IP::Address >::reference
value_type & reference
Definition: aged_ordered_container.h:415
std::allocator_traits::deallocate
T deallocate(T... args)
beast::detail::aged_ordered_container::emplace_hint
auto emplace_hint(const_iterator hint, Args &&... args) -> typename std::enable_if<!maybe_multi, std::pair< iterator, bool >>::type
Definition: aged_ordered_container.h:1961
beast::detail::aged_ordered_container::operator!=
bool operator!=(aged_ordered_container< OtherIsMulti, OtherIsMap, Key, OtherT, OtherDuration, Compare, OtherAllocator > const &other) const
Definition: aged_ordered_container.h:1136
beast::detail::aged_ordered_container::config_t::compare
Compare & compare()
Definition: aged_ordered_container.h:325
std::allocator_traits::destroy
T destroy(T... args)
beast::detail::aged_ordered_container< beast::IP::Address >::cont_type
typename std::conditional< IsMulti, typename boost::intrusive::make_multiset< element, boost::intrusive::constant_time_size< true >, boost::intrusive::compare< KeyValueCompare > >::type, typename boost::intrusive::make_set< element, boost::intrusive::constant_time_size< true >, boost::intrusive::compare< KeyValueCompare > >::type >::type cont_type
Definition: aged_ordered_container.h:235
beast::detail::aged_ordered_container::insert
std::enable_if< maybe_map &&std::is_constructible< value_type, P && >::value, typename std::conditional< IsMulti, iterator, std::pair< iterator, bool > >::type >::type insert(P &&value)
Definition: aged_ordered_container.h:897
beast::detail::aged_ordered_container::element
Definition: aged_ordered_container.h:108
beast::detail::aged_ordered_container::iterator_to
const_iterator iterator_to(value_type const &value) const
Definition: aged_ordered_container.h:792
beast::aged_ordered_container
Definition: aged_container_iterator.h:29
beast::detail::aged_ordered_container::clock
clock_type const & clock() const
Definition: aged_ordered_container.h:662
beast::detail::aged_ordered_container::erase
beast::detail::aged_container_iterator< false, Iterator > erase(beast::detail::aged_container_iterator< is_const, Iterator > pos)
Definition: aged_ordered_container.h:1994
beast::detail::aged_ordered_container::config_t::config_t
config_t(config_t const &other, Allocator const &alloc)
Definition: aged_ordered_container.h:281
beast::expire
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.
Definition: aged_container_utility.h:33
beast::detail::aged_ordered_container::clock_type
abstract_clock< Clock > clock_type
Definition: aged_ordered_container.h:85
std::forward_as_tuple
T forward_as_tuple(T... args)
beast::detail::aged_ordered_container::crbegin
const_reverse_iterator crbegin() const
Definition: aged_ordered_container.h:758
beast::detail::aged_container_iterator::iterator
Iterator const & iterator() const
Definition: aged_container_iterator.h:170
beast::detail::aged_ordered_container::upper_bound
iterator upper_bound(K const &k)
Definition: aged_ordered_container.h:1069
beast::detail::aged_ordered_container::chronological_t::const_reverse_iterator
beast::detail::aged_container_iterator< true, typename list_type::reverse_iterator > const_reverse_iterator
Definition: aged_ordered_container.h:454
beast::detail::aged_ordered_container::insert
std::enable_if< maybe_map &&std::is_constructible< value_type, P && >::value, typename std::conditional< IsMulti, iterator, std::pair< iterator, bool > >::type >::type insert(const_iterator hint, P &&value)
Definition: aged_ordered_container.h:909
beast::detail::aged_ordered_container::crend
const_reverse_iterator crend() const
Definition: aged_ordered_container.h:776
beast::abstract_clock< std::chrono::steady_clock >
memory
beast::detail::aged_ordered_container::operator[]
std::conditional< IsMap, T, void * >::type & operator[](Key const &key)
Definition: aged_ordered_container.h:1667
beast::detail::aged_ordered_container::aged_ordered_container
aged_ordered_container()=delete
std::swap
T swap(T... args)
beast::detail::aged_ordered_container::pair_value_compare::pair_value_compare
pair_value_compare()
Definition: aged_ordered_container.h:161
std::equal_to
beast::detail::aged_ordered_container::element::value
value_type value
Definition: aged_ordered_container.h:143
beast::detail::aged_ordered_container::iterator
beast::detail::aged_container_iterator<!IsMap, typename cont_type::iterator > iterator
Definition: aged_ordered_container.h:424
beast::detail::aged_ordered_container::get_allocator
allocator_type get_allocator() const
Definition: aged_ordered_container.h:650
beast::detail::aged_ordered_container::const_iterator
beast::detail::aged_container_iterator< true, typename cont_type::iterator > const_iterator
Definition: aged_ordered_container.h:426
beast::detail::aged_ordered_container::chronological_t::rbegin
const_reverse_iterator rbegin() const
Definition: aged_ordered_container.h:499
beast::detail::aged_ordered_container::reverse_iterator
beast::detail::aged_container_iterator<!IsMap, typename cont_type::reverse_iterator > reverse_iterator
Definition: aged_ordered_container.h:428
beast::detail::aged_ordered_container::size
size_type size() const noexcept
Definition: aged_ordered_container.h:814
beast::detail::aged_ordered_container::end
iterator end()
Definition: aged_ordered_container.h:728
beast::detail::aged_ordered_container::operator=
aged_ordered_container & operator=(aged_ordered_container const &other)
Definition: aged_ordered_container.h:1569
beast::detail::aged_ordered_container::element::stashed::value_type
typename aged_ordered_container::value_type value_type
Definition: aged_ordered_container.h:120
beast::detail::aged_ordered_container
Associative container where each element is also indexed by time.
Definition: aged_ordered_container.h:82
beast::detail::aged_ordered_container::rbegin
const_reverse_iterator rbegin() const
Definition: aged_ordered_container.h:752
beast::detail::aged_ordered_container< beast::IP::Address >::const_pointer
typename std::allocator_traits< std::allocator< typename std::conditional< IsMap, std::pair< Key const, T >, Key >::type > >::const_pointer const_pointer
Definition: aged_ordered_container.h:419
beast::detail::aged_ordered_container::upper_bound
const_iterator upper_bound(K const &k) const
Definition: aged_ordered_container.h:1078
beast::detail::aged_ordered_container::operator<
bool operator<(aged_ordered_container< OtherIsMulti, OtherIsMap, Key, OtherT, OtherDuration, Compare, OtherAllocator > const &other) const
Definition: aged_ordered_container.h:1155
beast::detail::aged_ordered_container::chronological
class beast::detail::aged_ordered_container::chronological_t chronological
beast::detail::aged_ordered_container::config_t::compare
Compare const & compare() const
Definition: aged_ordered_container.h:331
std::initializer_list::begin
T begin(T... args)
beast::detail::aged_ordered_container::insert
void insert(std::initializer_list< value_type > init)
Definition: aged_ordered_container.h:923
std
STL namespace.
beast::detail::aged_ordered_container::chronological_t::reverse_iterator
beast::detail::aged_container_iterator< !IsMap, typename list_type::reverse_iterator > reverse_iterator
Definition: aged_ordered_container.h:452
beast::detail::aged_ordered_container::KeyValueCompare::compare
Compare & compare()
Definition: aged_ordered_container.h:211
beast::detail::aged_ordered_container::begin
iterator begin()
Definition: aged_ordered_container.h:710
beast::detail::aged_ordered_container::touch
void touch(beast::detail::aged_container_iterator< is_const, Iterator > pos)
Definition: aged_ordered_container.h:989
std::ptrdiff_t
beast::detail::aged_ordered_container::key_compare
Compare key_compare
Definition: aged_ordered_container.h:411
std::out_of_range
STL class.
std::allocator
STL class.
std::is_constructible
std::size_t
beast::detail::aged_ordered_container::KeyValueCompare::first_argument
Key first_argument
Definition: aged_ordered_container.h:182
beast::detail::aged_ordered_container::pair_value_compare::result_type
bool result_type
Definition: aged_ordered_container.h:153
std::make_pair
T make_pair(T... args)
beast::detail::aged_ordered_container::config_t::alloc
ElementAllocator & alloc()
Definition: aged_ordered_container.h:349
beast::detail::aged_ordered_container::config_t
Definition: aged_ordered_container.h:242
std::initializer_list::end
T end(T... args)
beast::detail::aged_ordered_container::const_reverse_iterator
beast::detail::aged_container_iterator< true, typename cont_type::reverse_iterator > const_reverse_iterator
Definition: aged_ordered_container.h:430
beast::detail::aged_ordered_container::insert
void insert(InputIt first, InputIt last)
Definition: aged_ordered_container.h:916
std::conditional
beast::detail::aged_ordered_container::config_t::config_t
config_t(clock_type &clock_, Allocator const &alloc_)
Definition: aged_ordered_container.h:256
beast::detail::aged_ordered_container::rbegin
reverse_iterator rbegin()
Definition: aged_ordered_container.h:746
beast::detail::aged_ordered_container::equal_range
std::pair< iterator, iterator > equal_range(K const &k)
Definition: aged_ordered_container.h:1032
beast::detail::aged_ordered_container::cbegin
const_iterator cbegin() const
Definition: aged_ordered_container.h:722
beast::detail::aged_ordered_container::rend
const_reverse_iterator rend() const
Definition: aged_ordered_container.h:770
beast::detail::aged_ordered_container< beast::IP::Address >::value_compare
typename std::conditional< IsMap, pair_value_compare, std::less< Key > >::type value_compare
Definition: aged_ordered_container.h:413
beast::detail::aged_ordered_container::config_t::operator=
config_t & operator=(config_t &&other)
Definition: aged_ordered_container.h:316
beast::detail::is_boost_reverse_iterator
Definition: aged_ordered_container.h:45
std::unique_ptr
STL class.
beast::detail::aged_ordered_container::pair_value_compare::pair_value_compare
pair_value_compare(pair_value_compare const &other)
Definition: aged_ordered_container.h:165
beast::detail::aged_ordered_container::m_config
config_t m_config
Definition: aged_ordered_container.h:1250
beast::detail::aged_ordered_container::chronological_t::chronological_t
chronological_t()
Definition: aged_ordered_container.h:551
beast::abstract_clock::time_point
typename Clock::time_point time_point
Definition: abstract_clock.h:63
beast::detail::aged_ordered_container::delete_element
void delete_element(element const *p)
Definition: aged_ordered_container.h:395
beast::detail::aged_ordered_container::find
const_iterator find(K const &k) const
Definition: aged_ordered_container.h:1023
type_traits
beast::detail::aged_container_iterator
Definition: aged_container_iterator.h:35
beast::detail::aged_ordered_container< beast::IP::Address >::duration
typename clock_type::duration duration
Definition: aged_ordered_container.h:87
beast::detail::aged_ordered_container::insert
std::enable_if< maybe_multi, iterator >::type insert(const_iterator, value_type &&value)
Definition: aged_ordered_container.h:884
beast::abstract_clock::duration
typename Clock::duration duration
Definition: abstract_clock.h:62
std::allocator_traits::construct
T construct(T... args)
beast::detail::aged_ordered_container::pair_value_compare::aged_ordered_container
friend aged_ordered_container
Definition: aged_ordered_container.h:170
std::cref
T cref(T... args)
beast::detail::aged_ordered_container::KeyValueCompare::KeyValueCompare
KeyValueCompare(Compare const &compare)
Definition: aged_ordered_container.h:188
beast::detail::aged_ordered_container::element::when
time_point when
Definition: aged_ordered_container.h:144
beast::detail::aged_ordered_container::size_type
std::size_t size_type
Definition: aged_ordered_container.h:92
beast::detail::aged_ordered_container::pair_value_compare
Definition: aged_ordered_container.h:148
beast::detail::aged_ordered_container::KeyValueCompare::result_type
bool result_type
Definition: aged_ordered_container.h:184
beast::detail::aged_ordered_container< beast::IP::Address >::key_type
Key key_type
Definition: aged_ordered_container.h:88
initializer_list
beast::detail::aged_ordered_container::allocator_type
Allocator allocator_type
Definition: aged_ordered_container.h:414
beast
Definition: base_uint.h:641