22 #ifndef NDN_UTIL_SCHEDULER_HPP 23 #define NDN_UTIL_SCHEDULER_HPP 27 #include <boost/asio/io_service.hpp> 34 class MonotonicDeadlineTimer;
68 operator bool()
const;
95 EventId(
const weak_ptr<EventInfo>& info)
101 weak_ptr<EventInfo> m_info;
114 operator()(
const shared_ptr<EventInfo>& a,
const shared_ptr<EventInfo>& b)
const;
126 Scheduler(boost::asio::io_service& ioService);
135 scheduleEvent(time::nanoseconds after,
const EventCallback& callback);
141 cancelEvent(
const EventId& eventId);
163 executeEvent(
const boost::system::error_code& code);
166 unique_ptr<detail::MonotonicDeadlineTimer> m_deadlineTimer;
168 bool m_isEventExecuting;
183 #endif // NDN_UTIL_SCHEDULER_HPP Copyright (c) 2013-2017 Regents of the University of California.
std::ostream & operator<<(std::ostream &os, LogLevel level)
output LogLevel as string
void reset()
clear this EventId
bool operator!=(const EventId &other) const
std::function< void()> EventCallback
Function to be invoked when a scheduled event expires.
std::multiset< shared_ptr< EventInfo >, EventQueueCompare > EventQueue
EventId(std::nullptr_t=nullptr)
Constructs an empty EventId.
bool operator==(const Data &lhs, const Data &rhs)
Identifies a scheduled event.