22 #ifndef NDN_UTIL_SCHEDULER_HPP
23 #define NDN_UTIL_SCHEDULER_HPP
25 #include "../common.hpp"
100 EventId(
const weak_ptr<EventInfo>& info)
106 weak_ptr<EventInfo> m_info;
119 operator()(
const shared_ptr<EventInfo>& a,
const shared_ptr<EventInfo>& b)
const;
136 Scheduler(boost::asio::io_service& ioService);
143 scheduleEvent(
const time::nanoseconds& after,
const EventCallback& callback);
171 executeEvent(
const boost::system::error_code& code);
176 bool m_isEventExecuting;
191 #endif // NDN_UTIL_SCHEDULER_HPP
function< void()> EventCallback
Function to be invoked when a scheduled event expires.
Copyright (c) 2013-2016 Regents of the University of California.
bool operator()(const shared_ptr< EventInfo > &a, const shared_ptr< EventInfo > &b) const
void reset()
clear this EventId
void cancelEvent(const EventId &eventId)
Cancel a scheduled event.
friend std::ostream & operator<<(std::ostream &os, const EventId &eventId)
bool operator!=(const EventId &other) const
void cancelAllEvents()
Cancel all scheduled events.
Scheduler(boost::asio::io_service &ioService)
bool operator==(const EventId &other) const
std::multiset< shared_ptr< EventInfo >, EventQueueCompare > EventQueue
EventId(std::nullptr_t=nullptr)
Constructs an empty EventId.
EventId scheduleEvent(const time::nanoseconds &after, const EventCallback &callback)
Schedule a one-time event after the specified delay.
boost::asio::basic_deadline_timer< time::steady_clock > monotonic_deadline_timer
Identifies a scheduled event.
std::ostream & operator<<(std::ostream &os, const EventId &eventId)