NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
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 
43 
46 EventId
47 schedule(time::nanoseconds after, const EventCallback& event);
48 
51 void
52 cancel(const EventId& eventId);
53 
54 Scheduler&
56 
59 class ScopedEventId : noncopyable
60 {
61 public:
62  ScopedEventId();
63 
67  ScopedEventId(const EventId& event);
68 
72 
79  operator=(const EventId& event);
80 
84 
87  void
88  cancel();
89 
93  void
94  release();
95 
96 private:
97  EventId m_event;
98 };
99 
100 } // namespace scheduler
101 
102 } // namespace nfd
103 
104 #endif // NFD_CORE_SCHEDULER_HPP
function< void()> EventCallback
Definition: scheduler.hpp:43
void cancel()
cancels the event manually
Definition: scheduler.cpp:95
ScopedEventId & operator=(const EventId &event)
assigns an event
Definition: scheduler.cpp:80
void cancel(const EventId &eventId)
cancel a scheduled event
Definition: scheduler.cpp:53
~ScopedEventId()
cancels the event
Definition: scheduler.cpp:89
std::shared_ptr< ns3::EventId > EventId
Definition: scheduler.hpp:48
Opaque type (shared_ptr) representing ID of a scheduled event.
void release()
releases the event so that it won&#39;t be disconnected when this ScopedEventId is destructed ...
Definition: scheduler.cpp:101
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
cancels an event automatically upon destruction
Definition: scheduler.hpp:59
EventId schedule(time::nanoseconds after, const EventCallback &event)
schedule an event
Definition: scheduler.cpp:47
Scheduler & getGlobalScheduler()
Definition: scheduler.cpp:37