NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
network-monitor-impl-osx.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_UTIL_NETWORK_MONITOR_IMPL_OSX_HPP
23 #define NDN_UTIL_NETWORK_MONITOR_IMPL_OSX_HPP
24 
25 #include "../network-monitor.hpp"
26 
27 #include "../scheduler.hpp"
28 #include "../scheduler-scoped-event-id.hpp"
29 
30 #include <CoreFoundation/CoreFoundation.h>
31 #include <SystemConfiguration/SystemConfiguration.h>
32 
33 namespace ndn {
34 namespace util {
35 
37 {
38 public:
39  Impl(NetworkMonitor& nm, boost::asio::io_service& io);
40 
41  ~Impl();
42 
43  static void
44  afterNotificationCenterEvent(CFNotificationCenterRef center,
45  void *observer,
46  CFStringRef name,
47  const void *object,
48  CFDictionaryRef userInfo);
49 
50 private:
51  void
52  scheduleCfLoop();
53 
54  void
55  pollCfLoop();
56 
57 private:
58  NetworkMonitor& m_nm;
59 
60  Scheduler m_scheduler;
61  scheduler::ScopedEventId m_cfLoopEvent;
62 };
63 
64 } // namespace util
65 } // namespace ndn
66 
67 #endif // NDN_UTIL_NETWORK_MONITOR_IMPL_OSX_HPP
Impl(NetworkMonitor &nm, boost::asio::io_service &io)
Copyright (c) 2011-2015 Regents of the University of California.
Network state change monitor.
static void afterNotificationCenterEvent(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo)
Event that is automatically cancelled upon destruction.