1#ifndef TATOOINE_TIME_STAMP_QUEUE_H
2#define TATOOINE_TIME_STAMP_QUEUE_H
9template <
typename T,
typename Timer>
12 auto operator()(std::pair<T, std::chrono::time_point<Timer>>
const& lhs,
13 std::pair<T, std::chrono::time_point<Timer>>
const& rhs)
const
15 return lhs.second < rhs.second;
19template <
typename T,
typename Timer = std::chrono::high_resolution_clock>
21 :
public std::priority_queue<
22 std::pair<T, std::chrono::time_point<Timer>>,
23 std::vector<std::pair<T, std::chrono::time_point<Timer>>>,
24 time_stamp_queue_components_type<T, Timer>> {
26 std::pair<T, std::chrono::time_point<Timer>>,
27 std::vector<std::pair<T, std::chrono::time_point<Timer>>>,
32 template <
typename... Args>
35 auto t = T{std::forward<Args>(args)...};
36 std::erase_if(this->c, [&](
auto const& elem) {
return elem.first == t; });
41 std::erase_if(this->c, [&](
auto const& elem) {
return elem.first == t; });
46 std::erase_if(this->c, [&](
auto const& elem) {
return elem.first == t; });
auto emplace(const Key &key, Args &&... args)
Definition: cache.h:112
Definition: time_stamp_queue.h:10
auto operator()(std::pair< T, std::chrono::time_point< Timer > > const &lhs, std::pair< T, std::chrono::time_point< Timer > > const &rhs) const -> bool
Definition: time_stamp_queue.h:12
Definition: time_stamp_queue.h:24
std::priority_queue< std::pair< T, std::chrono::time_point< Timer > >, std::vector< std::pair< T, std::chrono::time_point< Timer > > >, time_stamp_queue_components_type< T, Timer > > parent_t
Definition: time_stamp_queue.h:28
auto emplace(Args &&... args)
Definition: time_stamp_queue.h:34
auto push(T const &t)
Definition: time_stamp_queue.h:40
auto push(T &&t)
Definition: time_stamp_queue.h:45
Definition: algorithm.h:6