NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
network-monitor.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_HPP
23 #define NDN_UTIL_NETWORK_MONITOR_HPP
24 
25 #include "signal.hpp"
26 
27 #include <boost/asio/io_service.hpp>
28 
29 namespace ndn {
30 namespace util {
31 
48 class NetworkMonitor : boost::noncopyable
49 {
50 public:
51  class Error : public std::runtime_error
52  {
53  public:
54  explicit
55  Error(const std::string& what)
56  : std::runtime_error(what)
57  {
58  }
59  };
60 
66  explicit
67  NetworkMonitor(boost::asio::io_service& io);
68 
73 
74  Signal<NetworkMonitor> onNetworkStateChanged;
75 
76 private:
77  class Impl;
78  std::unique_ptr<Impl> m_impl;
79 };
80 
81 } // namespace util
82 } // namespace autoconfig
83 
84 #endif // NDN_UTIL_NETWORK_MONITOR_HPP
Error(const std::string &what)
Copyright (c) 2011-2015 Regents of the University of California.
Network state change monitor.
STL namespace.
NetworkMonitor(boost::asio::io_service &io)
Construct instance and start monitoring for network state changes.
Signal< NetworkMonitor > onNetworkStateChanged
~NetworkMonitor()
Terminate network state monitoring.