22 #ifndef NDN_UTIL_SCHEDULER_HPP 23 #define NDN_UTIL_SCHEDULER_HPP 26 #include "../net/asio-fwd.hpp" 28 #include <boost/system/error_code.hpp> 61 EventId(std::nullptr_t =
nullptr) noexcept
70 operator bool()
const noexcept;
97 EventId(weak_ptr<EventInfo> info) noexcept
98 : m_info(std::move(info))
103 weak_ptr<EventInfo> m_info;
116 operator()(
const shared_ptr<EventInfo>& a,
const shared_ptr<EventInfo>& b)
const noexcept;
128 Scheduler(boost::asio::io_service& ioService);
137 scheduleEvent(time::nanoseconds after,
const EventCallback& callback);
143 cancelEvent(
const EventId& eventId);
165 executeEvent(
const boost::system::error_code& code);
168 unique_ptr<detail::SteadyTimer> m_timer;
170 bool m_isEventExecuting;
185 #endif // NDN_UTIL_SCHEDULER_HPP void reset() noexcept
clear this EventId
constexpr EventId(std::nullptr_t=nullptr) noexcept
Constructs an empty EventId.
bool operator!=(const EventId &other) const noexcept
Copyright (c) 2013-2017 Regents of the University of California.
std::ostream & operator<<(std::ostream &os, LoggerTimestamp)
Write a timestamp to os.
std::function< void()> EventCallback
Function to be invoked when a scheduled event expires.
std::multiset< shared_ptr< EventInfo >, EventQueueCompare > EventQueue
bool operator==(const Data &lhs, const Data &rhs)
Identifies a scheduled event.