22 #ifndef NDN_UTIL_SCHEDULER_HPP 23 #define NDN_UTIL_SCHEDULER_HPP 29 #include "ns3/simulator.h" 74 operator bool() const noexcept;
80 operator==(const
EventId& other) const noexcept;
83 operator!=(const
EventId& other) const noexcept
101 friend std::ostream& operator<<(std::ostream& os, const
EventId& eventId);
105 operator<<(std::ostream& os, const
EventId& eventId);
126 using ScopedCancelHandle::ScopedCancelHandle;
143 operator()(
const shared_ptr<EventInfo>& a,
const shared_ptr<EventInfo>& b)
const noexcept;
162 scheduleEvent(time::nanoseconds after,
const EventCallback& callback);
181 cancelImpl(
const shared_ptr<EventInfo>& info);
195 bool m_isEventExecuting;
196 ndn::optional<ns3::EventId> m_timerEvent;
208 using util::scheduler::Scheduler;
209 using util::scheduler::EventId;
213 #endif // NDN_UTIL_SCHEDULER_HPP void reset() noexcept
Clear this EventId without canceling.
Copyright (c) 2011-2015 Regents of the University of California.
EventId() noexcept=default
Constructs an empty EventId.
EventId(std::nullptr_t) noexcept
Allow implicit conversion from nullptr.
std::function< void()> EventCallback
Function to be invoked when a scheduled event expires.
std::multiset< shared_ptr< EventInfo >, EventQueueCompare > EventQueue
Stores internal information about a scheduled event.
A scoped handle of scheduled event.
Handle to cancel an operation.
void cancelEvent(const EventId &eid)
Cancel a scheduled event.
A handle of scheduled event.
bool operator==(const EventId &other) const noexcept
Determine whether this and other refer to the same event, or are both empty/expired/cancelled.
void cancel() const
Cancel the operation.
ScopedEventId(Scheduler &scheduler) noexcept