src: Remove unnecessary uses of boost::cref in make_shared and replace boost::cref/boost::ref with just cref/ref

In some cases, due to argument-dependent lookup, it is necessary to use
ndn::ref, instead of just ref.

Change-Id: I682180a007609535855f77511b49622154ad4f11
Refs: #1591
diff --git a/common.hpp b/common.hpp
index 6e13c4e..c815bbc 100644
--- a/common.hpp
+++ b/common.hpp
@@ -46,7 +46,6 @@
 #include <boost/assert.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/noncopyable.hpp>
-#include <boost/ref.hpp>
 #include <boost/scoped_ptr.hpp>
 
 namespace nfd {
@@ -63,6 +62,8 @@
 using ndn::const_pointer_cast;
 using ndn::function;
 using ndn::bind;
+using ndn::ref;
+using ndn::cref;
 
 using ndn::Interest;
 using ndn::Data;
diff --git a/core/scheduler.cpp b/core/scheduler.cpp
index fb09557..5f9e707 100644
--- a/core/scheduler.cpp
+++ b/core/scheduler.cpp
@@ -34,7 +34,7 @@
 getGlobalScheduler()
 {
   if (!static_cast<bool>(g_scheduler)) {
-    g_scheduler = make_shared<Scheduler>(boost::ref(getGlobalIoService()));
+    g_scheduler = make_shared<Scheduler>(ref(getGlobalIoService()));
   }
   return *g_scheduler;
 }
diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp
index 6809e6c..0408f03 100644
--- a/daemon/face/ethernet-factory.cpp
+++ b/daemon/face/ethernet-factory.cpp
@@ -47,11 +47,9 @@
     return face;
 
   shared_ptr<boost::asio::posix::stream_descriptor> socket =
-    make_shared<boost::asio::posix::stream_descriptor>(boost::ref(getGlobalIoService()));
+    make_shared<boost::asio::posix::stream_descriptor>(ref(getGlobalIoService()));
 
-  face = make_shared<EthernetFace>(boost::cref(socket),
-                                   boost::cref(interface),
-                                   boost::cref(address));
+  face = make_shared<EthernetFace>(socket, interface, address);
   face->onFail += bind(&EthernetFactory::afterFaceFailed,
                        this, name, address);
   m_multicastFaces[std::make_pair(name, address)] = face;
diff --git a/daemon/face/face.cpp b/daemon/face/face.cpp
index 46dbcf6..75600b4 100644
--- a/daemon/face/face.cpp
+++ b/daemon/face/face.cpp
@@ -40,10 +40,10 @@
   , m_localUri(localUri)
   , m_isOnDemand(false)
 {
-  onReceiveInterest += bind(&increaseCounter, boost::ref(m_counters.getNInInterests()));
-  onReceiveData     += bind(&increaseCounter, boost::ref(m_counters.getNInDatas()));
-  onSendInterest    += bind(&increaseCounter, boost::ref(m_counters.getNOutInterests()));
-  onSendData        += bind(&increaseCounter, boost::ref(m_counters.getNOutDatas()));
+  onReceiveInterest += bind(&increaseCounter, ref(m_counters.getNInInterests()));
+  onReceiveData     += bind(&increaseCounter, ref(m_counters.getNInDatas()));
+  onSendInterest    += bind(&increaseCounter, ref(m_counters.getNOutInterests()));
+  onSendData        += bind(&increaseCounter, ref(m_counters.getNOutDatas()));
 }
 
 Face::~Face()
diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp
index 708f36b..cd2fb4f 100644
--- a/daemon/face/tcp-channel.cpp
+++ b/daemon/face/tcp-channel.cpp
@@ -48,7 +48,7 @@
                    const ConnectFailedCallback& onAcceptFailed,
                    int backlog/* = tcp::acceptor::max_connections*/)
 {
-  m_acceptor = make_shared<ip::tcp::acceptor>(boost::ref(getGlobalIoService()));
+  m_acceptor = make_shared<ip::tcp::acceptor>(ref(getGlobalIoService()));
   m_acceptor->open(m_localEndpoint.protocol());
   m_acceptor->set_option(ip::tcp::acceptor::reuse_address(true));
   if (m_localEndpoint.address().is_v6())
@@ -59,7 +59,7 @@
   m_acceptor->listen(backlog);
 
   shared_ptr<ip::tcp::socket> clientSocket =
-    make_shared<ip::tcp::socket>(boost::ref(getGlobalIoService()));
+    make_shared<ip::tcp::socket>(ref(getGlobalIoService()));
   m_acceptor->async_accept(*clientSocket,
                            bind(&TcpChannel::handleSuccessfulAccept, this, _1,
                                 clientSocket,
@@ -81,10 +81,10 @@
   }
 
   shared_ptr<ip::tcp::socket> clientSocket =
-    make_shared<ip::tcp::socket>(boost::ref(getGlobalIoService()));
+    make_shared<ip::tcp::socket>(ref(getGlobalIoService()));
 
   shared_ptr<ndn::monotonic_deadline_timer> connectTimeoutTimer =
-    make_shared<ndn::monotonic_deadline_timer>(boost::ref(getGlobalIoService()));
+    make_shared<ndn::monotonic_deadline_timer>(ref(getGlobalIoService()));
 
   clientSocket->async_connect(remoteEndpoint,
                               bind(&TcpChannel::handleSuccessfulConnect, this, _1,
@@ -104,14 +104,14 @@
                     const time::seconds& timeout/* = time::seconds(4)*/)
 {
   shared_ptr<ip::tcp::socket> clientSocket =
-    make_shared<ip::tcp::socket>(boost::ref(getGlobalIoService()));
+    make_shared<ip::tcp::socket>(ref(getGlobalIoService()));
 
   shared_ptr<ndn::monotonic_deadline_timer> connectTimeoutTimer =
-    make_shared<ndn::monotonic_deadline_timer>(boost::ref(getGlobalIoService()));
+    make_shared<ndn::monotonic_deadline_timer>(ref(getGlobalIoService()));
 
   ip::tcp::resolver::query query(remoteHost, remotePort);
   shared_ptr<ip::tcp::resolver> resolver =
-    make_shared<ip::tcp::resolver>(boost::ref(getGlobalIoService()));
+    make_shared<ip::tcp::resolver>(ref(getGlobalIoService()));
 
   resolver->async_resolve(query,
                           bind(&TcpChannel::handleEndpointResolution, this, _1, _2,
@@ -140,9 +140,9 @@
 
   shared_ptr<Face> face;
   if (socket->local_endpoint().address().is_loopback())
-    face = make_shared<TcpLocalFace>(boost::cref(socket), isOnDemand);
+    face = make_shared<TcpLocalFace>(socket, isOnDemand);
   else
-    face = make_shared<TcpFace>(boost::cref(socket), isOnDemand);
+    face = make_shared<TcpFace>(socket, isOnDemand);
 
   face->onFail += bind(&TcpChannel::afterFaceFailed, this, remoteEndpoint);
 
@@ -178,7 +178,7 @@
 
   // prepare accepting the next connection
   shared_ptr<ip::tcp::socket> clientSocket =
-    make_shared<ip::tcp::socket>(boost::ref(getGlobalIoService()));
+    make_shared<ip::tcp::socket>(ref(getGlobalIoService()));
   m_acceptor->async_accept(*clientSocket,
                            bind(&TcpChannel::handleSuccessfulAccept, this, _1,
                                 clientSocket,
diff --git a/daemon/face/tcp-factory.cpp b/daemon/face/tcp-factory.cpp
index 07d7a86..bb08313 100644
--- a/daemon/face/tcp-factory.cpp
+++ b/daemon/face/tcp-factory.cpp
@@ -115,7 +115,7 @@
   if(static_cast<bool>(channel))
     return channel;
 
-  channel = make_shared<TcpChannel>(boost::cref(endpoint));
+  channel = make_shared<TcpChannel>(endpoint);
   m_channels[endpoint] = channel;
   prohibitEndpoint(endpoint);
 
diff --git a/daemon/face/udp-channel.cpp b/daemon/face/udp-channel.cpp
index ca052a2..99d01e3 100644
--- a/daemon/face/udp-channel.cpp
+++ b/daemon/face/udp-channel.cpp
@@ -42,7 +42,7 @@
   ///       We need to check this
   ///       (SO_REUSEADDR doesn't behave uniformly in different OS)
 
-  m_socket = make_shared<ip::udp::socket>(boost::ref(getGlobalIoService()));
+  m_socket = make_shared<ip::udp::socket>(ref(getGlobalIoService()));
   m_socket->open(m_localEndpoint.protocol());
   m_socket->set_option(boost::asio::ip::udp::socket::reuse_address(true));
   if (m_localEndpoint.address().is_v6())
@@ -106,7 +106,7 @@
 
   //creating a new socket for the face that will be created soon
   shared_ptr<ip::udp::socket> clientSocket =
-    make_shared<ip::udp::socket>(boost::ref(getGlobalIoService()));
+    make_shared<ip::udp::socket>(ref(getGlobalIoService()));
 
   clientSocket->open(m_localEndpoint.protocol());
   clientSocket->set_option(ip::udp::socket::reuse_address(true));
@@ -134,7 +134,7 @@
 {
   ip::udp::resolver::query query(remoteHost, remotePort);
   shared_ptr<ip::udp::resolver> resolver =
-  make_shared<ip::udp::resolver>(boost::ref(getGlobalIoService()));
+    make_shared<ip::udp::resolver>(ref(getGlobalIoService()));
 
   resolver->async_resolve(query,
                           bind(&UdpChannel::handleEndpointResolution, this, _1, _2,
@@ -180,7 +180,7 @@
 {
   udp::Endpoint remoteEndpoint = socket->remote_endpoint();
 
-  shared_ptr<UdpFace> face = make_shared<UdpFace>(boost::cref(socket), isOnDemand);
+  shared_ptr<UdpFace> face = make_shared<UdpFace>(socket, isOnDemand);
   face->onFail += bind(&UdpChannel::afterFaceFailed, this, remoteEndpoint);
 
   onFaceCreated(face);
@@ -215,7 +215,7 @@
   }
   else {
     shared_ptr<ip::udp::socket> clientSocket =
-      make_shared<ip::udp::socket>(boost::ref(getGlobalIoService()));
+      make_shared<ip::udp::socket>(ref(getGlobalIoService()));
     clientSocket->open(m_localEndpoint.protocol());
     clientSocket->set_option(ip::udp::socket::reuse_address(true));
     clientSocket->bind(m_localEndpoint);
diff --git a/daemon/face/udp-channel.hpp b/daemon/face/udp-channel.hpp
index f97c3a3..73403aa 100644
--- a/daemon/face/udp-channel.hpp
+++ b/daemon/face/udp-channel.hpp
@@ -124,8 +124,7 @@
    *        associated with any UdpFace
    */
   void
-  newPeer(const boost::system::error_code& error,
-                   std::size_t nBytesReceived);
+  newPeer(const boost::system::error_code& error, std::size_t nBytesReceived);
 
   void
   handleEndpointResolution(const boost::system::error_code& error,
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index e97e9bb..470fd5e 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -148,8 +148,7 @@
                 "create a multicast face");
   }
 
-  channel = make_shared<UdpChannel>(boost::cref(endpoint),
-                                    timeout);
+  channel = make_shared<UdpChannel>(endpoint, timeout);
   m_channels[endpoint] = channel;
   prohibitEndpoint(endpoint);
 
@@ -208,7 +207,7 @@
   }
 
   shared_ptr<ip::udp::socket> clientSocket =
-    make_shared<ip::udp::socket>(boost::ref(getGlobalIoService()));
+    make_shared<ip::udp::socket>(ref(getGlobalIoService()));
 
   clientSocket->open(multicastEndpoint.protocol());
 
@@ -249,7 +248,7 @@
 
   clientSocket->set_option(ip::multicast::enable_loopback(false));
 
-  multicastFace = make_shared<MulticastUdpFace>(boost::cref(clientSocket), localEndpoint);
+  multicastFace = make_shared<MulticastUdpFace>(clientSocket, localEndpoint);
   multicastFace->onFail += bind(&UdpFactory::afterFaceFailed, this, localEndpoint);
 
   m_multicastFaces[localEndpoint] = multicastFace;
@@ -326,8 +325,8 @@
       return;
     }
   }
-  onConnectFailed("No channels available to connect to "
-                  + boost::lexical_cast<std::string>(endpoint));
+  onConnectFailed("No channels available to connect to " +
+                  boost::lexical_cast<std::string>(endpoint));
 }
 
 shared_ptr<UdpChannel>
diff --git a/daemon/face/unix-stream-channel.cpp b/daemon/face/unix-stream-channel.cpp
index efdf700..d64f333 100644
--- a/daemon/face/unix-stream-channel.cpp
+++ b/daemon/face/unix-stream-channel.cpp
@@ -96,7 +96,7 @@
       throw Error(m_endpoint.path() + " already exists and is not a socket file");
     }
 
-  m_acceptor = make_shared<stream_protocol::acceptor>(boost::ref(getGlobalIoService()));
+  m_acceptor = make_shared<stream_protocol::acceptor>(ref(getGlobalIoService()));
   m_acceptor->open();
   m_acceptor->bind(m_endpoint);
   m_acceptor->listen(backlog);
@@ -108,7 +108,7 @@
     }
 
   shared_ptr<stream_protocol::socket> clientSocket =
-    make_shared<stream_protocol::socket>(boost::ref(getGlobalIoService()));
+    make_shared<stream_protocol::socket>(ref(getGlobalIoService()));
 
   m_acceptor->async_accept(*clientSocket,
                            bind(&UnixStreamChannel::handleSuccessfulAccept, this,
@@ -134,7 +134,7 @@
   NFD_LOG_DEBUG("[" << m_endpoint << "] << Incoming connection");
 
   shared_ptr<stream_protocol::socket> clientSocket =
-    make_shared<stream_protocol::socket>(boost::ref(getGlobalIoService()));
+    make_shared<stream_protocol::socket>(ref(getGlobalIoService()));
 
   // prepare accepting the next connection
   m_acceptor->async_accept(*clientSocket,
@@ -142,7 +142,7 @@
                                 boost::asio::placeholders::error, clientSocket,
                                 onFaceCreated, onAcceptFailed));
 
-  shared_ptr<UnixStreamFace> face = make_shared<UnixStreamFace>(boost::cref(socket));
+  shared_ptr<UnixStreamFace> face = make_shared<UnixStreamFace>(socket);
   onFaceCreated(face);
 }
 
diff --git a/daemon/face/unix-stream-factory.cpp b/daemon/face/unix-stream-factory.cpp
index 96a158a..45668c9 100644
--- a/daemon/face/unix-stream-factory.cpp
+++ b/daemon/face/unix-stream-factory.cpp
@@ -39,7 +39,7 @@
   if (channel)
     return channel;
 
-  channel = make_shared<UnixStreamChannel>(boost::cref(endpoint));
+  channel = make_shared<UnixStreamChannel>(endpoint);
   m_channels[endpoint] = channel;
   return channel;
 }
diff --git a/daemon/face/websocket-channel.cpp b/daemon/face/websocket-channel.cpp
index db7fdc0..f409dc9 100644
--- a/daemon/face/websocket-channel.cpp
+++ b/daemon/face/websocket-channel.cpp
@@ -78,7 +78,7 @@
       m_server.close(hdl, websocketpp::close::status::normal, "closed by channel", ecode);
     }
   shared_ptr<WebSocketFace> face = make_shared<WebSocketFace>(FaceUri(remote), this->getUri(),
-                                                              hdl, boost::ref(m_server));
+                                                              hdl, ref(m_server));
   m_onFaceCreatedCallback(face);
   m_channelFaces[hdl] = face;
 }
diff --git a/daemon/face/websocket-factory.cpp b/daemon/face/websocket-factory.cpp
index 224a75b..8a6e6c3 100644
--- a/daemon/face/websocket-factory.cpp
+++ b/daemon/face/websocket-factory.cpp
@@ -43,7 +43,7 @@
   if (static_cast<bool>(channel))
     return channel;
 
-  channel = make_shared<WebSocketChannel>(boost::cref(endpoint));
+  channel = make_shared<WebSocketChannel>(endpoint);
   m_channels[endpoint] = channel;
 
   return channel;
diff --git a/daemon/fw/available-strategies.cpp b/daemon/fw/available-strategies.cpp
index fce0fc5..c6f7d42 100644
--- a/daemon/fw/available-strategies.cpp
+++ b/daemon/fw/available-strategies.cpp
@@ -33,7 +33,7 @@
 shared_ptr<Strategy>
 makeDefaultStrategy(Forwarder& forwarder)
 {
-  return make_shared<BestRouteStrategy>(boost::ref(forwarder));
+  return make_shared<BestRouteStrategy>(ref(forwarder));
 }
 
 template<typename S>
@@ -42,7 +42,7 @@
 {
   StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
   if (!strategyChoice.hasStrategy(S::STRATEGY_NAME)) {
-    strategyChoice.install(make_shared<S>(boost::ref(forwarder)));
+    strategyChoice.install(make_shared<S>(ref(forwarder)));
   }
 }
 
diff --git a/daemon/fw/face-table.cpp b/daemon/fw/face-table.cpp
index ce66a89..ec9deb6 100644
--- a/daemon/fw/face-table.cpp
+++ b/daemon/fw/face-table.cpp
@@ -58,9 +58,9 @@
                                               " local=" << face->getLocalUri());
 
   face->onReceiveInterest += bind(&Forwarder::onInterest,
-                                  &m_forwarder, boost::ref(*face), _1);
+                                  &m_forwarder, ref(*face), _1);
   face->onReceiveData     += bind(&Forwarder::onData,
-                                  &m_forwarder, boost::ref(*face), _1);
+                                  &m_forwarder, ref(*face), _1);
   face->onFail            += bind(&FaceTable::remove,
                                   this, face);
 
diff --git a/daemon/fw/forwarder.cpp b/daemon/fw/forwarder.cpp
index 6b06d10..4c8aa36 100644
--- a/daemon/fw/forwarder.cpp
+++ b/daemon/fw/forwarder.cpp
@@ -105,7 +105,7 @@
 
   // dispatch to strategy
   this->dispatchToStrategy(pitEntry, bind(&Strategy::afterReceiveInterest, _1,
-    boost::cref(inFace), boost::cref(interest), fibEntry, pitEntry));
+                                          cref(inFace), cref(interest), fibEntry, pitEntry));
 }
 
 void
@@ -191,7 +191,7 @@
 
   // invoke PIT unsatisfied callback
   this->dispatchToStrategy(pitEntry, bind(&Strategy::beforeExpirePendingInterest, _1,
-    pitEntry));
+                                          pitEntry));
 
   // PIT delete
   m_pit.erase(pitEntry);
@@ -254,7 +254,7 @@
 
     // invoke PIT satisfy callback
     this->dispatchToStrategy(pitEntry, bind(&Strategy::beforeSatisfyPendingInterest, _1,
-      pitEntry, boost::cref(inFace), boost::cref(data)));
+                                            pitEntry, cref(inFace), cref(data)));
   }
 
   // foreach pending downstream
diff --git a/daemon/main.cpp b/daemon/main.cpp
index fdf14b5..697b65b 100644
--- a/daemon/main.cpp
+++ b/daemon/main.cpp
@@ -107,19 +107,19 @@
   {
     m_internalFace = make_shared<InternalFace>();
 
-    m_fibManager = make_shared<FibManager>(boost::ref(m_forwarder->getFib()),
+    m_fibManager = make_shared<FibManager>(ref(m_forwarder->getFib()),
                                            bind(&Forwarder::getFace, m_forwarder.get(), _1),
                                            m_internalFace);
 
-    m_faceManager = make_shared<FaceManager>(boost::ref(m_forwarder->getFaceTable()),
+    m_faceManager = make_shared<FaceManager>(ref(m_forwarder->getFaceTable()),
                                              m_internalFace);
 
     m_strategyChoiceManager =
-      make_shared<StrategyChoiceManager>(boost::ref(m_forwarder->getStrategyChoice()),
+      make_shared<StrategyChoiceManager>(ref(m_forwarder->getStrategyChoice()),
                                          m_internalFace);
 
     m_statusServer = make_shared<StatusServer>(m_internalFace,
-                                               boost::ref(*m_forwarder));
+                                               ref(*m_forwarder));
 
     ConfigFile config((IgnoreRibAndLogSections()));
 
@@ -232,8 +232,7 @@
     else
       {
         /// \todo May be try to reload config file (at least security section)
-        signalSet.async_wait(bind(&Nfd::terminate, this, _1, _2,
-                                  boost::ref(signalSet)));
+        signalSet.async_wait(bind(&Nfd::terminate, this, _1, _2, ref(signalSet)));
       }
   }
 
@@ -312,8 +311,7 @@
   signalSet.add(SIGHUP);
   signalSet.add(SIGUSR1);
   signalSet.add(SIGUSR2);
-  signalSet.async_wait(bind(&Nfd::terminate, &nfdInstance, _1, _2,
-                            boost::ref(signalSet)));
+  signalSet.async_wait(bind(&Nfd::terminate, &nfdInstance, _1, _2, ref(signalSet)));
 
   try {
     getGlobalIoService().run();
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index e2c2848..f91a8f8 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -314,7 +314,7 @@
 
   if (!isDryRun)
     {
-      shared_ptr<TcpFactory> factory = make_shared<TcpFactory>(boost::cref(port));
+      shared_ptr<TcpFactory> factory = ndn::make_shared<TcpFactory>(port);
       m_factories.insert(std::make_pair("tcp", factory));
 
       if (enableV4)
@@ -485,7 +485,7 @@
 
   if (!isDryRun)
     {
-      shared_ptr<UdpFactory> factory = make_shared<UdpFactory>(boost::cref(port));
+      shared_ptr<UdpFactory> factory = ndn::make_shared<UdpFactory>(port);
       m_factories.insert(std::make_pair("udp", factory));
 
       if (enableV4)
@@ -704,7 +704,7 @@
 
   if (!isDryRun)
     {
-      shared_ptr<WebSocketFactory> factory = make_shared<WebSocketFactory>(boost::cref(port));
+      shared_ptr<WebSocketFactory> factory = ndn::make_shared<WebSocketFactory>(port);
       m_factories.insert(std::make_pair("websocket", factory));
       uint16_t portNo = boost::lexical_cast<uint16_t>(port);
 
@@ -747,7 +747,7 @@
   if (unsignedVerbProcessor != m_unsignedVerbDispatch.end())
     {
       NFD_LOG_DEBUG("command result: processing verb: " << verb);
-      (unsignedVerbProcessor->second)(this, boost::cref(request));
+      (unsignedVerbProcessor->second)(this, request);
     }
   else if (COMMAND_UNSIGNED_NCOMPS <= commandNComps &&
            commandNComps < COMMAND_SIGNED_NCOMPS)
diff --git a/daemon/mgmt/fib-manager.cpp b/daemon/mgmt/fib-manager.cpp
index 0936f5c..98c4578 100644
--- a/daemon/mgmt/fib-manager.cpp
+++ b/daemon/mgmt/fib-manager.cpp
@@ -108,7 +108,7 @@
   if (unsignedVerbProcessor != m_unsignedVerbDispatch.end())
     {
       NFD_LOG_DEBUG("command result: processing verb: " << verb);
-      (unsignedVerbProcessor->second)(this, boost::cref(request));
+      (unsignedVerbProcessor->second)(this, request);
     }
   else if (COMMAND_UNSIGNED_NCOMPS <= commandNComps &&
            commandNComps < COMMAND_SIGNED_NCOMPS)
diff --git a/daemon/table/pit.cpp b/daemon/table/pit.cpp
index 9c2554a..6f0e446 100644
--- a/daemon/table/pit.cpp
+++ b/daemon/table/pit.cpp
@@ -82,7 +82,7 @@
   // then check if this Interest is already in the PIT entries
   std::vector<shared_ptr<pit::Entry> >::const_iterator it =
     std::find_if(pitEntries.begin(), pitEntries.end(),
-                 bind(&predicate_PitEntry_similar_Interest, _1, boost::cref(interest)));
+                 bind(&predicate_PitEntry_similar_Interest, _1, cref(interest)));
 
   if (it != pitEntries.end())
     {
diff --git a/daemon/table/strategy-choice.cpp b/daemon/table/strategy-choice.cpp
index fff84c1..2383118 100644
--- a/daemon/table/strategy-choice.cpp
+++ b/daemon/table/strategy-choice.cpp
@@ -265,7 +265,7 @@
 
   std::for_each(m_nameTree.partialEnumerate(entry->getPrefix(),
                            bind(&predicate_nameTreeEntry_needResetStrategyChoice,
-                                _1, boost::cref(*m_nameTree.get(*entry)))),
+                                _1, cref(*m_nameTree.get(*entry)))),
                 m_nameTree.end(),
                 &clearStrategyInfo);
 }
diff --git a/daemon/table/strategy-info-host.hpp b/daemon/table/strategy-info-host.hpp
index dfe9341..361eaaf 100644
--- a/daemon/table/strategy-info-host.hpp
+++ b/daemon/table/strategy-info-host.hpp
@@ -91,7 +91,7 @@
 {
   shared_ptr<T> info = this->getStrategyInfo<T>();
   if (!static_cast<bool>(info)) {
-    info = make_shared<T>(boost::ref(a1));
+    info = make_shared<T>(ref(a1));
     this->setStrategyInfo(info);
   }
   return info;
diff --git a/rib/main.cpp b/rib/main.cpp
index d74ed8d..75771b7 100644
--- a/rib/main.cpp
+++ b/rib/main.cpp
@@ -195,7 +195,7 @@
       {
         /// \todo May be try to reload config file
         signalSet.async_wait(bind(&Nrd::terminate, this, _1, _2,
-                                  boost::ref(signalSet)));
+                                  ref(signalSet)));
       }
   }
 
@@ -259,7 +259,7 @@
   signalSet.add(SIGUSR1);
   signalSet.add(SIGUSR2);
   signalSet.async_wait(bind(&Nrd::terminate, &nrdInstance, _1, _2,
-                            boost::ref(signalSet)));
+                            ndn::ref(signalSet)));
 
   try {
     nfd::getGlobalIoService().run();
diff --git a/rib/rib-manager.cpp b/rib/rib-manager.cpp
index 73ef71d..f4fc9c8 100644
--- a/rib/rib-manager.cpp
+++ b/rib/rib-manager.cpp
@@ -57,14 +57,8 @@
                      ),
   };
 
-inline static void
-NullDeleter(boost::asio::io_service* variable)
-{
-  // do nothing
-}
-
 RibManager::RibManager()
-  : m_face(shared_ptr<boost::asio::io_service>(&getGlobalIoService(), &NullDeleter))
+  : m_face(getGlobalIoService())
   , m_nfdController(new ndn::nfd::Controller(m_face))
   , m_localhostValidator(m_face)
   , m_localhopValidator(m_face)
@@ -96,7 +90,7 @@
     }
 
   NFD_LOG_INFO("Start monitoring face create/destroy events");
-  m_faceMonitor.addSubscriber(boost::bind(&RibManager::onNotification, this, _1));
+  m_faceMonitor.addSubscriber(bind(&RibManager::onNotification, this, _1));
   m_faceMonitor.startNotifications();
 }
 
diff --git a/rib/rib-manager.hpp b/rib/rib-manager.hpp
index 1d542fb..ef38ae1 100644
--- a/rib/rib-manager.hpp
+++ b/rib/rib-manager.hpp
@@ -149,9 +149,9 @@
   FaceMonitor m_faceMonitor;
   bool m_isLocalhopEnabled;
 
-  typedef boost::function<void(RibManager*,
-                               const shared_ptr<const Interest>& request,
-                               ControlParameters& parameters)> VerbProcessor;
+  typedef function<void(RibManager*,
+                        const shared_ptr<const Interest>& request,
+                        ControlParameters& parameters)> VerbProcessor;
 
   typedef std::map<name::Component, VerbProcessor> VerbDispatchTable;
 
diff --git a/tests/daemon/face/packet-datasets.cpp b/tests/daemon/face/packet-datasets.cpp
index 86e01cd..cf661db 100644
--- a/tests/daemon/face/packet-datasets.cpp
+++ b/tests/daemon/face/packet-datasets.cpp
@@ -33,7 +33,7 @@
 
 BOOST_FIXTURE_TEST_SUITE(Datasets, BaseFixture)
 
-BOOST_AUTO_TEST_CASE(Currupted)
+BOOST_AUTO_TEST_CASE(Corrupted)
 {
   {
     typedef CorruptedInterest Dataset;
diff --git a/tests/daemon/face/unix-stream.cpp b/tests/daemon/face/unix-stream.cpp
index 06ff5d3..7d86f39 100644
--- a/tests/daemon/face/unix-stream.cpp
+++ b/tests/daemon/face/unix-stream.cpp
@@ -157,8 +157,7 @@
   channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
                    bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
 
-  shared_ptr<stream_protocol::socket> client =
-      make_shared<stream_protocol::socket>(boost::ref(g_io));
+  shared_ptr<stream_protocol::socket> client = make_shared<stream_protocol::socket>(ref(g_io));
   client->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
                         bind(&EndToEndFixture::client_onConnect, this, _1));
 
@@ -228,8 +227,7 @@
   channel->listen(bind(&EndToEndFixture::channel_onFaceCreated,   this, _1),
                   bind(&EndToEndFixture::channel_onConnectFailed, this, _1));
 
-  shared_ptr<stream_protocol::socket> client1 =
-      make_shared<stream_protocol::socket>(boost::ref(g_io));
+  shared_ptr<stream_protocol::socket> client1 = make_shared<stream_protocol::socket>(ref(g_io));
   client1->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
                          bind(&EndToEndFixture::client_onConnect, this, _1));
 
@@ -238,8 +236,7 @@
 
   BOOST_CHECK_EQUAL(faces.size(), 1);
 
-  shared_ptr<stream_protocol::socket> client2 =
-      make_shared<stream_protocol::socket>(boost::ref(g_io));
+  shared_ptr<stream_protocol::socket> client2 = make_shared<stream_protocol::socket>(ref(g_io));
   client2->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
                          bind(&EndToEndFixture::client_onConnect, this, _1));
 
@@ -297,8 +294,7 @@
   channel1->listen(bind(&EndToEndFixture::channel1_onFaceCreated,   this, _1),
                    bind(&EndToEndFixture::channel1_onConnectFailed, this, _1));
 
-  shared_ptr<stream_protocol::socket> client =
-      make_shared<stream_protocol::socket>(boost::ref(g_io));
+  shared_ptr<stream_protocol::socket> client = make_shared<stream_protocol::socket>(ref(g_io));
   client->async_connect(stream_protocol::endpoint(CHANNEL_PATH1),
                         bind(&EndToEndFixture::client_onConnect, this, _1));
 
diff --git a/tests/daemon/fw/face-table.cpp b/tests/daemon/fw/face-table.cpp
index daf9256..3f49525 100644
--- a/tests/daemon/fw/face-table.cpp
+++ b/tests/daemon/fw/face-table.cpp
@@ -46,8 +46,8 @@
   FaceTable& faceTable = forwarder.getFaceTable();
   std::vector<FaceId> onAddHistory;
   std::vector<FaceId> onRemoveHistory;
-  faceTable.onAdd    += bind(&saveFaceId, boost::ref(onAddHistory   ), _1);
-  faceTable.onRemove += bind(&saveFaceId, boost::ref(onRemoveHistory), _1);
+  faceTable.onAdd    += bind(&saveFaceId, ndn::ref(onAddHistory   ), _1);
+  faceTable.onRemove += bind(&saveFaceId, ndn::ref(onRemoveHistory), _1);
 
   shared_ptr<Face> face1 = make_shared<DummyFace>();
   shared_ptr<Face> face2 = make_shared<DummyFace>();
diff --git a/tests/daemon/fw/forwarder.cpp b/tests/daemon/fw/forwarder.cpp
index 0151460..0b72a0d 100644
--- a/tests/daemon/fw/forwarder.cpp
+++ b/tests/daemon/fw/forwarder.cpp
@@ -300,9 +300,9 @@
 
   StrategyChoice& strategyChoice = forwarder.getStrategyChoice();
   shared_ptr<DummyStrategy> strategyP = make_shared<DummyStrategy>(
-                                        boost::ref(forwarder), "ndn:/strategyP");
+                                        ref(forwarder), "ndn:/strategyP");
   shared_ptr<DummyStrategy> strategyQ = make_shared<DummyStrategy>(
-                                        boost::ref(forwarder), "ndn:/strategyQ");
+                                        ref(forwarder), "ndn:/strategyQ");
   strategyChoice.install(strategyP);
   strategyChoice.install(strategyQ);
   strategyChoice.insert("ndn:/" , strategyP->getName());
diff --git a/tests/daemon/fw/ncc-strategy.cpp b/tests/daemon/fw/ncc-strategy.cpp
index 29db3b3..9e1f7bc 100644
--- a/tests/daemon/fw/ncc-strategy.cpp
+++ b/tests/daemon/fw/ncc-strategy.cpp
@@ -43,7 +43,7 @@
   LimitedIo limitedIo;
   Forwarder forwarder;
   typedef StrategyTester<fw::NccStrategy> NccStrategyTester;
-  shared_ptr<NccStrategyTester> strategy = make_shared<NccStrategyTester>(boost::ref(forwarder));
+  shared_ptr<NccStrategyTester> strategy = make_shared<NccStrategyTester>(ref(forwarder));
   strategy->onAction += bind(&LimitedIo::afterOp, &limitedIo);
 
   shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
diff --git a/tests/daemon/mgmt/command-validator.cpp b/tests/daemon/mgmt/command-validator.cpp
index 834cc5b..5e1dd30 100644
--- a/tests/daemon/mgmt/command-validator.cpp
+++ b/tests/daemon/mgmt/command-validator.cpp
@@ -230,21 +230,21 @@
   config.parse(CONFIG, false, CONFIG_PATH.native());
 
   validator.validate(*fibCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidated());
   m_tester1.resetValidation();
 
   validator.validate(*statsCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidated());
 
   validator.validate(*facesCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester2), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester2), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester2), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester2), _1, _2));
 
   BOOST_REQUIRE(m_tester2.commandValidated());
   m_tester2.resetValidation();
@@ -254,8 +254,8 @@
   generator.generateWithIdentity(*unauthorizedFibCommand, m_tester2.getIdentityName());
 
   validator.validate(*unauthorizedFibCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester2), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester2), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester2), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester2), _1, _2));
 
   BOOST_REQUIRE(m_tester2.commandValidationFailed());
 }
@@ -290,21 +290,21 @@
   config.parse(CONFIG, true, CONFIG_PATH.native());
 
   validator.validate(*fibCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidationFailed());
   m_tester1.resetValidation();
 
   validator.validate(*statsCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidationFailed());
 
   validator.validate(*facesCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester2), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester2), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester2), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester2), _1, _2));
 
   BOOST_REQUIRE(m_tester2.commandValidationFailed());
   m_tester2.resetValidation();
@@ -314,8 +314,8 @@
   generator.generateWithIdentity(*unauthorizedFibCommand, m_tester2.getIdentityName());
 
   validator.validate(*unauthorizedFibCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester2), _1),
-                     bind(&CommandValidatorTester::onValidationFailed, boost::ref(m_tester2), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester2), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester2), _1, _2));
 
   BOOST_REQUIRE(m_tester2.commandValidationFailed());
 }
@@ -629,25 +629,22 @@
   config.parse(WILDCARD_CERT_CONFIG, false, CONFIG_PATH.native());
 
   validator.validate(*fibCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed,
-                          boost::ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidationFailed());
   m_tester1.resetValidation();
 
   validator.validate(*statsCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed,
-                          boost::ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidated());
   m_tester1.resetValidation();
 
   validator.validate(*facesCommand,
-                     bind(&CommandValidatorTester::onValidated, boost::ref(m_tester1), _1),
-                     bind(&CommandValidatorTester::onValidationFailed,
-                          boost::ref(m_tester1), _1, _2));
+                     bind(&CommandValidatorTester::onValidated, ref(m_tester1), _1),
+                     bind(&CommandValidatorTester::onValidationFailed, ref(m_tester1), _1, _2));
 
   BOOST_REQUIRE(m_tester1.commandValidated());
   m_tester1.resetValidation();
diff --git a/tests/daemon/mgmt/face-manager.cpp b/tests/daemon/mgmt/face-manager.cpp
index 14b62d4..974e417 100644
--- a/tests/daemon/mgmt/face-manager.cpp
+++ b/tests/daemon/mgmt/face-manager.cpp
@@ -1591,8 +1591,8 @@
                    .setFlags(0);
 
   getFace()->onReceiveData +=
-    bind(&FaceFixture::callbackDispatch, this, _1,
-         command->getName(), 200, "Success", boost::ref(encodedParameters), expectedFaceEvent);
+    bind(&FaceFixture::callbackDispatch, this, _1, command->getName(),
+         200, "Success", ref(encodedParameters), expectedFaceEvent);
 
   destroyFace(*command, parameters);
 
diff --git a/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp b/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp
index d972d79..301d396 100644
--- a/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp
+++ b/tests/daemon/mgmt/fib-enumeration-publisher-common.hpp
@@ -125,8 +125,8 @@
 
     std::set<shared_ptr<fib::Entry> >::const_iterator referenceIter =
       std::find_if(m_referenceEntries.begin(), m_referenceEntries.end(),
-                   boost::bind(&FibEnumerationPublisherFixture::entryHasPrefix,
-                               this, _1, prefix));
+                   bind(&FibEnumerationPublisherFixture::entryHasPrefix,
+                        this, _1, prefix));
 
     BOOST_REQUIRE(referenceIter != m_referenceEntries.end());
 
diff --git a/tests/daemon/mgmt/fib-manager.cpp b/tests/daemon/mgmt/fib-manager.cpp
index b38c3b8..2305c2c 100644
--- a/tests/daemon/mgmt/fib-manager.cpp
+++ b/tests/daemon/mgmt/fib-manager.cpp
@@ -160,10 +160,8 @@
   }
 
 protected:
-    FibManagerFixture()
-      : m_manager(boost::ref(m_fib),
-                  bind(&FibManagerFixture::getFace, this, _1),
-                  m_face)
+  FibManagerFixture()
+    : m_manager(ref(m_fib), bind(&FibManagerFixture::getFace, this, _1), m_face)
     , m_callbackFired(false)
   {
   }
diff --git a/tests/daemon/mgmt/internal-face.cpp b/tests/daemon/mgmt/internal-face.cpp
index 04ef4a2..e76d80f 100644
--- a/tests/daemon/mgmt/internal-face.cpp
+++ b/tests/daemon/mgmt/internal-face.cpp
@@ -108,7 +108,7 @@
 
   bool didPutData = false;
   Name dataName("/hello");
-  face->onReceiveData += bind(&validatePutData, boost::ref(didPutData), dataName, _1);
+  face->onReceiveData += bind(&validatePutData, ref(didPutData), dataName, _1);
 
   Data testData(dataName);
   face->sign(testData);
diff --git a/tests/daemon/mgmt/status-server.cpp b/tests/daemon/mgmt/status-server.cpp
index 75b4114..d9f3129 100644
--- a/tests/daemon/mgmt/status-server.cpp
+++ b/tests/daemon/mgmt/status-server.cpp
@@ -50,7 +50,7 @@
   Forwarder forwarder;
   shared_ptr<InternalFace> internalFace = make_shared<InternalFace>();
   internalFace->onReceiveData += &interceptResponse;
-  StatusServer statusServer(internalFace, boost::ref(forwarder));
+  StatusServer statusServer(internalFace, ref(forwarder));
   time::system_clock::TimePoint t2 = time::system_clock::now();
 
   // populate tables
diff --git a/tests/daemon/mgmt/strategy-choice-manager.cpp b/tests/daemon/mgmt/strategy-choice-manager.cpp
index 99d5636..9b5f2c5 100644
--- a/tests/daemon/mgmt/strategy-choice-manager.cpp
+++ b/tests/daemon/mgmt/strategy-choice-manager.cpp
@@ -50,7 +50,8 @@
     , m_manager(m_strategyChoice, m_face)
     , m_callbackFired(false)
   {
-    m_strategyChoice.install(make_shared<DummyStrategy>(boost::ref(m_forwarder), "/localhost/nfd/strategy/test-strategy-a"));
+    m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
+                                                        "/localhost/nfd/strategy/test-strategy-a"));
     m_strategyChoice.insert("ndn:/", "/localhost/nfd/strategy/test-strategy-a");
   }
 
@@ -169,7 +170,8 @@
 public:
   AllStrategiesFixture()
   {
-    m_strategyChoice.install(make_shared<DummyStrategy>(boost::ref(m_forwarder), "/localhost/nfd/strategy/test-strategy-b"));
+    m_strategyChoice.install(make_shared<DummyStrategy>(ref(m_forwarder),
+                                                        "/localhost/nfd/strategy/test-strategy-b"));
   }
 
   virtual
diff --git a/tests/daemon/table/measurements-accessor.cpp b/tests/daemon/table/measurements-accessor.cpp
index 6dc8ff3..cbcbe5a 100644
--- a/tests/daemon/table/measurements-accessor.cpp
+++ b/tests/daemon/table/measurements-accessor.cpp
@@ -68,9 +68,9 @@
   Forwarder forwarder;
 
   shared_ptr<MeasurementsAccessorTestStrategy> strategy1 =
-    make_shared<MeasurementsAccessorTestStrategy>(boost::ref(forwarder), "ndn:/strategy1");
+    make_shared<MeasurementsAccessorTestStrategy>(ref(forwarder), "ndn:/strategy1");
   shared_ptr<MeasurementsAccessorTestStrategy> strategy2 =
-    make_shared<MeasurementsAccessorTestStrategy>(boost::ref(forwarder), "ndn:/strategy2");
+    make_shared<MeasurementsAccessorTestStrategy>(ref(forwarder), "ndn:/strategy2");
 
   Name nameRoot("ndn:/");
   Name nameA   ("ndn:/A");
diff --git a/tests/daemon/table/strategy-choice.cpp b/tests/daemon/table/strategy-choice.cpp
index 6927375..3f8c2bc 100644
--- a/tests/daemon/table/strategy-choice.cpp
+++ b/tests/daemon/table/strategy-choice.cpp
@@ -40,8 +40,8 @@
   Name nameP("ndn:/strategy/P");
   Name nameQ("ndn:/strategy/Q");
   Name nameZ("ndn:/strategy/Z");
-  shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(boost::ref(forwarder), nameP);
-  shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(boost::ref(forwarder), nameQ);
+  shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(ref(forwarder), nameP);
+  shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(ref(forwarder), nameQ);
 
   StrategyChoice& table = forwarder.getStrategyChoice();
 
@@ -110,8 +110,8 @@
   Forwarder forwarder;
   Name nameP("ndn:/strategy/P");
   Name nameQ("ndn:/strategy/Q");
-  shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(boost::ref(forwarder), nameP);
-  shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(boost::ref(forwarder), nameQ);
+  shared_ptr<Strategy> strategyP = make_shared<DummyStrategy>(ref(forwarder), nameP);
+  shared_ptr<Strategy> strategyQ = make_shared<DummyStrategy>(ref(forwarder), nameQ);
 
   StrategyChoice& table = forwarder.getStrategyChoice();
   Measurements& measurements = forwarder.getMeasurements();
diff --git a/tools/nfd-autoreg.cpp b/tools/nfd-autoreg.cpp
index 40ea488..3d8dc98 100644
--- a/tools/nfd-autoreg.cpp
+++ b/tools/nfd-autoreg.cpp
@@ -230,7 +230,7 @@
                            bind(&AutoregServer::onTimeout, this, _1));
 
     boost::asio::signal_set signalSet(*m_face.ioService(), SIGINT, SIGTERM);
-    signalSet.async_wait(boost::bind(&AutoregServer::signalHandler, this));
+    signalSet.async_wait(bind(&AutoregServer::signalHandler, this));
 
     m_face.processEvents();
   }