scheduler.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_CORE_SCHEDULER_HPP
27 #define NFD_CORE_SCHEDULER_HPP
28 
29 #include "common.hpp"
30 #include <ndn-cxx/util/scheduler.hpp>
31 
32 namespace nfd {
33 namespace scheduler {
34 
35 using ndn::Scheduler;
36 
40 using ndn::EventId;
41 
42 using ndn::util::scheduler::EventCallback;
43 
46 EventId
47 schedule(time::nanoseconds after, const EventCallback& event);
48 
51 void
52 cancel(const EventId& eventId);
53 
56 class ScopedEventId : noncopyable
57 {
58 public:
59  ScopedEventId();
60 
64  ScopedEventId(const EventId& event);
65 
69 
76  operator=(const EventId& event);
77 
81 
84  void
85  cancel();
86 
90  void
91  release();
92 
93 private:
94  EventId m_event;
95 };
96 
97 } // namespace scheduler
98 
99 } // namespace nfd
100 
101 #endif // NFD_CORE_SCHEDULER_HPP
~ScopedEventId()
cancels the event
Definition: scheduler.cpp:89
void cancel(const EventId &eventId)
cancel a scheduled event
Definition: scheduler.cpp:53
cancels an event automatically upon destruction
Definition: scheduler.hpp:56
void release()
releases the event so that it won&#39;t be disconnected when this ScopedEventId is destructed ...
Definition: scheduler.cpp:101
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
Definition: algorithm.hpp:32
ScopedEventId & operator=(const EventId &event)
assigns an event
Definition: scheduler.cpp:80
EventId schedule(time::nanoseconds after, const EventCallback &event)
schedule an event
Definition: scheduler.cpp:47
void cancel()
cancels the event manually
Definition: scheduler.cpp:95