Reduce inclusions of <boost/asio.hpp> in public headers
And especially, stop including it from the precompiled header
"common-pch.hpp". This is a necessary step in order to avoid
conflicts between net/if.h (pulled in by Asio) and linux/if.h
(required by future commits).
Change-Id: I0207be0d2be796d8ef369062a8d5195fedfef6b0
diff --git a/src/util/dns.cpp b/src/util/dns.cpp
index 0adfbd2..73fd8b1 100644
--- a/src/util/dns.cpp
+++ b/src/util/dns.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,9 +20,11 @@
*/
#include "dns.hpp"
-
#include "scheduler.hpp"
+#include <boost/asio/io_service.hpp>
+#include <boost/asio/ip/udp.hpp>
+
namespace ndn {
namespace dns {
diff --git a/src/util/dns.hpp b/src/util/dns.hpp
index 64d3865..fec923b 100644
--- a/src/util/dns.hpp
+++ b/src/util/dns.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -25,7 +25,13 @@
#include "../util/time.hpp"
#include <boost/asio/ip/address.hpp>
-#include <boost/asio/io_service.hpp>
+
+// forward declaration
+namespace boost {
+namespace asio {
+class io_service;
+} // namespace asio
+} // namespace boost
namespace ndn {
namespace dns {
diff --git a/src/util/dummy-client-face.cpp b/src/util/dummy-client-face.cpp
index 1db5b8d..8cdb9dc 100644
--- a/src/util/dummy-client-face.cpp
+++ b/src/util/dummy-client-face.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -24,6 +24,8 @@
#include "../management/nfd-controller.hpp"
#include "../management/nfd-control-response.hpp"
+#include <boost/asio/io_service.hpp>
+
namespace ndn {
namespace util {
diff --git a/src/util/monotonic_deadline_timer.hpp b/src/util/monotonic_deadline_timer.hpp
index 6572ca4..c2b28cf 100644
--- a/src/util/monotonic_deadline_timer.hpp
+++ b/src/util/monotonic_deadline_timer.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2014 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -26,9 +26,10 @@
#ifndef NDN_UTIL_MONOTONIC_DEADLINE_TIMER_HPP
#define NDN_UTIL_MONOTONIC_DEADLINE_TIMER_HPP
-#include <boost/asio.hpp>
#include "time.hpp"
+#include <boost/asio/basic_deadline_timer.hpp>
+
namespace boost {
namespace asio {
diff --git a/src/util/network-monitor.hpp b/src/util/network-monitor.hpp
index f3fc6b8..dae4941 100644
--- a/src/util/network-monitor.hpp
+++ b/src/util/network-monitor.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -24,7 +24,12 @@
#include "signal.hpp"
-#include <boost/asio/io_service.hpp>
+// forward declaration
+namespace boost {
+namespace asio {
+class io_service;
+} // namespace asio
+} // namespace boost
namespace ndn {
namespace util {