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 
44 EventId
45 schedule(const time::nanoseconds& after, const Scheduler::Event& event);
46 
49 void
50 cancel(const EventId& eventId);
51 
54 class ScopedEventId : noncopyable
55 {
56 public:
57  ScopedEventId();
58 
62  ScopedEventId(const EventId& event);
63 
67 
74  operator=(const EventId& event);
75 
79 
82  void
83  cancel();
84 
88  void
89  release();
90 
91 private:
92  EventId m_event;
93 };
94 
95 } // namespace scheduler
96 
97 } // namespace nfd
98 
99 #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:54
void release()
releases the event so that it won'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(const time::nanoseconds &after, const Scheduler::Event &event)
schedule an event
Definition: scheduler.cpp:47
void cancel()
cancels the event manually
Definition: scheduler.cpp:95