88 using Identifier = CbfPacketIdentifier;
112 bool remove(
const Identifier&
id);
119 void update(
const Identifier&
id, Clock::duration timeout);
130 boost::optional<CbfPacket>
fetch(
const Identifier&
id);
145 std::size_t
counter(
const Identifier& packet)
const;
151 Timer(
const Runtime&, Clock::duration timeout);
152 Timer(
const Timer&) =
default;
153 Timer& operator=(
const Timer&) =
default;
154 bool operator<(
const Timer&)
const;
156 Clock::time_point expiry;
157 Clock::time_point start;
160 using timer_bimap = boost::bimaps::bimap<
161 boost::bimaps::multiset_of<Timer>,
162 boost::bimaps::unordered_set_of<Identifier, std::hash<Identifier>>,
163 boost::bimaps::with_info<std::list<CbfPacket>::iterator>
174 void remove_timer(
typename timer_bimap::left_map::iterator);
189 std::list<CbfPacket> m_packets;
190 timer_bimap m_timers;
192 std::unique_ptr<CbfCounter> m_counter;
193 const std::size_t m_capacity_bytes;
194 std::size_t m_stored_bytes;
195 TimerCallback m_timer_callback;