]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1308] Got rid of boost function/bind
authorFrancis Dupont <fdupont@isc.org>
Thu, 30 Jul 2020 22:04:26 +0000 (00:04 +0200)
committerTomek Mrugalski <tomek@isc.org>
Thu, 13 Aug 2020 13:54:14 +0000 (13:54 +0000)
115 files changed:
src/bin/agent/ca_controller.cc
src/bin/agent/tests/ca_command_mgr_unittests.cc
src/bin/agent/tests/ca_process_unittests.cc
src/bin/agent/tests/ca_response_creator_unittests.cc
src/bin/d2/d2_controller.cc
src/bin/d2/d2_process.cc
src/bin/d2/nc_add.cc
src/bin/d2/nc_remove.cc
src/bin/d2/tests/d2_command_unittest.cc
src/bin/d2/tests/d2_process_unittests.cc
src/bin/d2/tests/d2_queue_mgr_unittests.cc
src/bin/d2/tests/dns_client_unittests.cc
src/bin/d2/tests/nc_test_utils.cc
src/bin/d2/tests/nc_trans_unittests.cc
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
src/bin/dhcp4/tests/hooks_unittest.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/bin/dhcp6/dhcp6_srv.cc
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
src/bin/dhcp6/tests/hooks_unittest.cc
src/bin/dhcp6/tests/host_unittest.cc
src/bin/netconf/tests/netconf_process_unittests.cc
src/bin/perfdhcp/receiver.cc
src/hooks/dhcp/high_availability/communication_state.cc
src/hooks/dhcp/high_availability/communication_state.h
src/hooks/dhcp/high_availability/ha_service.cc
src/hooks/dhcp/high_availability/tests/communication_state_unittest.cc
src/hooks/dhcp/high_availability/tests/ha_test.cc
src/hooks/dhcp/lease_cmds/tests/lease_cmds_unittest.cc
src/lib/asiodns/io_fetch.cc
src/lib/asiodns/tests/io_fetch_unittest.cc
src/lib/asiolink/interval_timer.cc
src/lib/asiolink/interval_timer.h
src/lib/asiolink/io_service.cc
src/lib/asiolink/io_service.h
src/lib/asiolink/tests/io_service_unittest.cc
src/lib/asiolink/tests/tcp_acceptor_unittest.cc
src/lib/asiolink/testutils/test_server_unix_socket.cc
src/lib/asiolink/testutils/test_server_unix_socket.h
src/lib/asiolink/unix_domain_socket.cc
src/lib/cc/json_feed.cc
src/lib/config/base_command_mgr.cc
src/lib/config/base_command_mgr.h
src/lib/config/client_connection.cc
src/lib/config/command_mgr.cc
src/lib/database/database_connection.h
src/lib/database/tests/database_connection_unittest.cc
src/lib/dhcp/iface_mgr.cc
src/lib/dhcp/iface_mgr.h
src/lib/dhcp/tests/iface_mgr_unittest.cc
src/lib/dhcp_ddns/ncr_udp.cc
src/lib/dhcp_ddns/ncr_udp.h
src/lib/dhcp_ddns/tests/ncr_udp_unittests.cc
src/lib/dhcpsrv/alloc_engine.cc
src/lib/dhcpsrv/alloc_engine.h
src/lib/dhcpsrv/cfg_expiration.h
src/lib/dhcpsrv/cfg_iface.cc
src/lib/dhcpsrv/d2_client_mgr.cc
src/lib/dhcpsrv/d2_client_mgr.h
src/lib/dhcpsrv/host_data_source_factory.h
src/lib/dhcpsrv/memfile_lease_mgr.cc
src/lib/dhcpsrv/network_state.cc
src/lib/dhcpsrv/tests/alloc_engine_expiration_unittest.cc
src/lib/dhcpsrv/tests/cfg_expiration_unittest.cc
src/lib/dhcpsrv/tests/d2_udp_unittest.cc
src/lib/dhcpsrv/tests/dhcp4o6_ipc_unittest.cc
src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc
src/lib/dhcpsrv/tests/host_mgr_unittest.cc
src/lib/dhcpsrv/tests/ncr_generator_unittest.cc
src/lib/dhcpsrv/tests/network_state_unittest.cc
src/lib/dhcpsrv/tests/timer_mgr_unittest.cc
src/lib/dhcpsrv/testutils/dhcp4o6_test_ipc.cc
src/lib/dhcpsrv/timer_mgr.cc
src/lib/dns/master_loader.cc
src/lib/dns/master_loader_callbacks.h
src/lib/dns/masterload.cc
src/lib/dns/masterload.h
src/lib/dns/rrcollator.cc
src/lib/dns/rrcollator.h
src/lib/dns/rrset_collection.cc
src/lib/dns/tests/master_loader_callbacks_test.cc
src/lib/dns/tests/master_loader_unittest.cc
src/lib/dns/tests/masterload_unittest.cc
src/lib/dns/tests/rdata_unittest.cc
src/lib/dns/tests/rrcollator_unittest.cc
src/lib/dns/tests/zone_checker_unittest.cc
src/lib/dns/zone_checker.cc
src/lib/dns/zone_checker.h
src/lib/http/client.cc
src/lib/http/connection.cc
src/lib/http/connection.h
src/lib/http/http_acceptor.h
src/lib/http/http_message_parser_base.cc
src/lib/http/http_message_parser_base.h
src/lib/http/listener_impl.cc
src/lib/http/request_parser.cc
src/lib/http/response_parser.cc
src/lib/http/tests/server_client_unittests.cc
src/lib/process/d_controller.cc
src/lib/process/daemon.cc
src/lib/process/io_service_signal.cc
src/lib/process/io_service_signal.h
src/lib/process/tests/io_service_signal_unittests.cc
src/lib/process/testutils/d_test_stubs.cc
src/lib/util/process_spawn.cc
src/lib/util/signal_set.h
src/lib/util/state_model.cc
src/lib/util/state_model.h
src/lib/util/tests/signal_set_unittest.cc
src/lib/util/tests/state_model_unittest.cc
src/lib/util/tests/watched_thread_unittest.cc
src/lib/util/watched_thread.cc
src/lib/util/watched_thread.h

index 134bde56590dac6f7696f3411e88f81ec429718a..092d102b7646a847c20e3066a29c97171c649f9a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 #include <agent/ca_process.h>
 #include <agent/ca_command_mgr.h>
 #include <agent/parser_context.h>
-#include <boost/bind.hpp>
+#include <functional>
 
 using namespace isc::process;
+using namespace std::placeholders;
 
 namespace isc {
 namespace agent {
@@ -52,31 +53,31 @@ CtrlAgentController::parseFile(const std::string& name) {
 void
 CtrlAgentController::registerCommands() {
     CtrlAgentCommandMgr::instance().registerCommand(BUILD_REPORT_COMMAND,
-        boost::bind(&DControllerBase::buildReportHandler, this, _1, _2));
+        std::bind(&DControllerBase::buildReportHandler, this, _1, _2));
 
     CtrlAgentCommandMgr::instance().registerCommand(CONFIG_GET_COMMAND,
-        boost::bind(&DControllerBase::configGetHandler, this, _1, _2));
+        std::bind(&DControllerBase::configGetHandler, this, _1, _2));
 
     CtrlAgentCommandMgr::instance().registerCommand(CONFIG_RELOAD_COMMAND,
-        boost::bind(&DControllerBase::configReloadHandler, this, _1, _2));
+        std::bind(&DControllerBase::configReloadHandler, this, _1, _2));
 
     CtrlAgentCommandMgr::instance().registerCommand(CONFIG_SET_COMMAND,
-        boost::bind(&DControllerBase::configSetHandler, this, _1, _2));
+        std::bind(&DControllerBase::configSetHandler, this, _1, _2));
 
     CtrlAgentCommandMgr::instance().registerCommand(CONFIG_TEST_COMMAND,
-        boost::bind(&DControllerBase::configTestHandler, this, _1, _2));
+        std::bind(&DControllerBase::configTestHandler, this, _1, _2));
 
     CtrlAgentCommandMgr::instance().registerCommand(CONFIG_WRITE_COMMAND,
-        boost::bind(&DControllerBase::configWriteHandler, this, _1, _2));
+        std::bind(&DControllerBase::configWriteHandler, this, _1, _2));
 
     CtrlAgentCommandMgr::instance().registerCommand(SHUT_DOWN_COMMAND,
-        boost::bind(&DControllerBase::shutdownHandler, this, _1, _2));
+        std::bind(&DControllerBase::shutdownHandler, this, _1, _2));
 
     CtrlAgentCommandMgr::instance().registerCommand(STATUS_GET_COMMAND,
-        boost::bind(&DControllerBase::statusGetHandler, this, _1, _2));
+        std::bind(&DControllerBase::statusGetHandler, this, _1, _2));
 
     CtrlAgentCommandMgr::instance().registerCommand(VERSION_GET_COMMAND,
-        boost::bind(&DControllerBase::versionGetHandler, this, _1, _2));
+        std::bind(&DControllerBase::versionGetHandler, this, _1, _2));
 }
 
 void
index d81ba078ef4c7b5b05bb9c197b9cd5476988755d..842e1f0462347676e8b6d1224d9f0d99f4225211 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 #include <cc/command_interpreter.h>
 #include <cc/data.h>
 #include <process/testutils/d_test_stubs.h>
-#include <boost/bind.hpp>
 #include <boost/pointer_cast.hpp>
 #include <gtest/gtest.h>
 #include <testutils/sandbox.h>
 #include <cstdlib>
+#include <functional>
 #include <vector>
 #include <thread>
 
@@ -228,7 +228,7 @@ public:
         // to this we need to run the server side socket at the same time as the
         // client. Running IO service in a thread guarantees that the server
         //responds as soon as it receives the control command.
-        std::thread th(boost::bind(&IOService::run, getIOService().get()));
+        std::thread th(std::bind(&IOService::run, getIOService().get()));
 
 
         // Wait for the IO service in thread to actually run.
@@ -384,7 +384,7 @@ TEST_F(CtrlAgentCommandMgrTest, forwardListCommands) {
     // to this we need to run the server side socket at the same time.
     // Running IO service in a thread guarantees that the server responds
     // as soon as it receives the control command.
-    std::thread th(boost::bind(&IOService::run, getIOService().get()));
+    std::thread th(std::bind(&IOService::run, getIOService().get()));
 
     // Wait for the IO service in thread to actually run.
     server_socket_->waitForRunning();
index c1ebaf65c793baae8766f625a5e5e849b96f82b4..37e06f66edf8485eecc75922143a0d1d6f86e628 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -10,9 +10,9 @@
 #include <asiolink/interval_timer.h>
 #include <asiolink/io_service.h>
 #include <process/testutils/d_test_stubs.h>
-#include <boost/bind.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <gtest/gtest.h>
+#include <functional>
 
 using namespace boost::posix_time;
 using namespace isc;
@@ -68,7 +68,7 @@ TEST_F(CtrlAgentProcessTest, shutdown) {
     // Use an asiolink IntervalTimer and callback to generate the
     // shutdown invocation. (Note IntervalTimer setup is in milliseconds).
     IntervalTimer timer(*getIoService());
-    timer.setup(boost::bind(&CtrlAgentProcessTest::genShutdownCallback, this),
+    timer.setup(std::bind(&CtrlAgentProcessTest::genShutdownCallback, this),
                 200);
 
     // Record start time, and invoke run().
index 7013d8b02256e2043b00d8abb47231f5dc6d4f3e..73a67697516e275a84fa12d3289d1d10b654a9f6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 #include <http/post_request_json.h>
 #include <http/response_json.h>
 #include <gtest/gtest.h>
-#include <boost/bind.hpp>
 #include <boost/pointer_cast.hpp>
+#include <functional>
 
 using namespace isc::agent;
 using namespace isc::config;
 using namespace isc::data;
 using namespace isc::http;
+using namespace std::placeholders;
 
 namespace {
 
@@ -37,9 +38,9 @@ public:
         // Deregisters commands.
         CtrlAgentCommandMgr::instance().deregisterAll();
         CtrlAgentCommandMgr::instance().
-            registerCommand("foo", boost::bind(&CtrlAgentResponseCreatorTest::
-                                               fooCommandHandler,
-                                               this, _1, _2));
+            registerCommand("foo", std::bind(&CtrlAgentResponseCreatorTest::
+                                             fooCommandHandler,
+                                             this, _1, _2));
 
         // Make sure that the request has been initialized properly.
         if (!request_) {
index 30bfbf39b21407870d113e36077d56f7be60781d..c77fe0fa9608c862daa7451eac5cb113fb8bd1c5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -15,6 +15,7 @@
 
 using namespace isc::config;
 using namespace isc::process;
+using namespace std::placeholders;
 
 namespace isc {
 namespace d2 {
@@ -53,31 +54,31 @@ D2Controller::registerCommands() {
     // These are the commands always supported by the D2 server.
     // Please keep the list in alphabetic order.
     CommandMgr::instance().registerCommand(BUILD_REPORT_COMMAND,
-        boost::bind(&D2Controller::buildReportHandler, this, _1, _2));
+        std::bind(&D2Controller::buildReportHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand(CONFIG_GET_COMMAND,
-        boost::bind(&D2Controller::configGetHandler, this, _1, _2));
+        std::bind(&D2Controller::configGetHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand(CONFIG_RELOAD_COMMAND,
-        boost::bind(&D2Controller::configReloadHandler, this, _1, _2));
+        std::bind(&D2Controller::configReloadHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand(CONFIG_SET_COMMAND,
-        boost::bind(&D2Controller::configSetHandler, this, _1, _2));
+        std::bind(&D2Controller::configSetHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand(CONFIG_TEST_COMMAND,
-        boost::bind(&D2Controller::configTestHandler, this, _1, _2));
+        std::bind(&D2Controller::configTestHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand(CONFIG_WRITE_COMMAND,
-        boost::bind(&D2Controller::configWriteHandler, this, _1, _2));
+        std::bind(&D2Controller::configWriteHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand(SHUT_DOWN_COMMAND,
-        boost::bind(&D2Controller::shutdownHandler, this, _1, _2));
+        std::bind(&D2Controller::shutdownHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand(STATUS_GET_COMMAND,
-        boost::bind(&DControllerBase::statusGetHandler, this, _1, _2));
+        std::bind(&DControllerBase::statusGetHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand(VERSION_GET_COMMAND,
-        boost::bind(&D2Controller::versionGetHandler, this, _1, _2));
+        std::bind(&D2Controller::versionGetHandler, this, _1, _2));
 }
 
 void
index bee7c7f0f4a7bc0fbf46abde2addf907b0532938..19846ba14fcc7f7f2de250594ceb558aeaaee59a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -212,7 +212,7 @@ D2Process::configure(isc::data::ConstElementPtr config_set, bool check_only) {
 
     isc::data::ConstElementPtr answer;
     answer = getCfgMgr()->simpleParseConfig(config_set, check_only,
-                boost::bind(&D2Process::reconfigureCommandChannel, this));
+                std::bind(&D2Process::reconfigureCommandChannel, this));
     if (check_only) {
         return (answer);
     }
index 8d083921503001f45e6d3bc0020602c9b9e9469a..b4692a8614ca1d4c5d1e9e795a429f40f785fea4 100644 (file)
 #include <d2/d2_cfg_mgr.h>
 #include <d2/nc_add.h>
 
-#include <boost/function.hpp>
-#include <boost/bind.hpp>
-
 #include <util/buffer.h>
 #include <dns/rdataclass.h>
 
+#include <functional>
+
 namespace isc {
 namespace d2 {
 
@@ -80,30 +79,30 @@ NameAddTransaction::defineStates() {
 
     // Define NameAddTransaction states.
     defineState(READY_ST, "READY_ST",
-             boost::bind(&NameAddTransaction::readyHandler, this));
+             std::bind(&NameAddTransaction::readyHandler, this));
 
     defineState(SELECTING_FWD_SERVER_ST, "SELECTING_FWD_SERVER_ST",
-             boost::bind(&NameAddTransaction::selectingFwdServerHandler, this));
+             std::bind(&NameAddTransaction::selectingFwdServerHandler, this));
 
     defineState(SELECTING_REV_SERVER_ST, "SELECTING_REV_SERVER_ST",
-             boost::bind(&NameAddTransaction::selectingRevServerHandler, this));
+             std::bind(&NameAddTransaction::selectingRevServerHandler, this));
 
     defineState(ADDING_FWD_ADDRS_ST, "ADDING_FWD_ADDRS_ST",
-             boost::bind(&NameAddTransaction::addingFwdAddrsHandler, this));
+             std::bind(&NameAddTransaction::addingFwdAddrsHandler, this));
 
     defineState(REPLACING_FWD_ADDRS_ST, "REPLACING_FWD_ADDRS_ST",
-             boost::bind(&NameAddTransaction::replacingFwdAddrsHandler, this));
+             std::bind(&NameAddTransaction::replacingFwdAddrsHandler, this));
 
     defineState(REPLACING_REV_PTRS_ST, "REPLACING_REV_PTRS_ST",
-             boost::bind(&NameAddTransaction::replacingRevPtrsHandler, this));
+             std::bind(&NameAddTransaction::replacingRevPtrsHandler, this));
 
     defineState(PROCESS_TRANS_OK_ST, "PROCESS_TRANS_OK_ST",
-             boost::bind(&NameAddTransaction::processAddOkHandler, this));
+             std::bind(&NameAddTransaction::processAddOkHandler, this));
 
     defineState(PROCESS_TRANS_FAILED_ST, "PROCESS_TRANS_FAILED_ST",
-             boost::bind(&NameAddTransaction::processAddFailedHandler, this));
-
+             std::bind(&NameAddTransaction::processAddFailedHandler, this));
 }
+
 void
 NameAddTransaction::verifyStates() {
     // Call superclass implementation first to verify its states. These are
index c3a62d50f310d6fc88f361b254350479c5bb2137..cd0b14bb59dc0a1be3eea51dcfcc92fa3b312446 100644 (file)
@@ -10,8 +10,7 @@
 #include <d2/d2_cfg_mgr.h>
 #include <d2/nc_remove.h>
 
-#include <boost/function.hpp>
-#include <boost/bind.hpp>
+#include <functional>
 
 namespace isc {
 namespace d2 {
@@ -77,35 +76,35 @@ NameRemoveTransaction::defineStates() {
 
     // Define NameRemoveTransaction states.
     defineState(READY_ST, "READY_ST",
-                boost::bind(&NameRemoveTransaction::readyHandler, this));
+                std::bind(&NameRemoveTransaction::readyHandler, this));
 
     defineState(SELECTING_FWD_SERVER_ST, "SELECTING_FWD_SERVER_ST",
-                boost::bind(&NameRemoveTransaction::selectingFwdServerHandler,
-                            this));
+                std::bind(&NameRemoveTransaction::selectingFwdServerHandler,
+                          this));
 
     defineState(SELECTING_REV_SERVER_ST, "SELECTING_REV_SERVER_ST",
-                boost::bind(&NameRemoveTransaction::selectingRevServerHandler,
-                            this));
+                std::bind(&NameRemoveTransaction::selectingRevServerHandler,
+                          this));
 
     defineState(REMOVING_FWD_ADDRS_ST, "REMOVING_FWD_ADDRS_ST",
-                boost::bind(&NameRemoveTransaction::removingFwdAddrsHandler,
-                            this));
+                std::bind(&NameRemoveTransaction::removingFwdAddrsHandler,
+                          this));
 
     defineState(REMOVING_FWD_RRS_ST, "REMOVING_FWD_RRS_ST",
-                boost::bind(&NameRemoveTransaction::removingFwdRRsHandler,
-                            this));
+                std::bind(&NameRemoveTransaction::removingFwdRRsHandler,
+                          this));
 
     defineState(REMOVING_REV_PTRS_ST, "REMOVING_REV_PTRS_ST",
-                boost::bind(&NameRemoveTransaction::removingRevPtrsHandler,
-                            this));
+                std::bind(&NameRemoveTransaction::removingRevPtrsHandler,
+                          this));
 
     defineState(PROCESS_TRANS_OK_ST, "PROCESS_TRANS_OK_ST",
-                boost::bind(&NameRemoveTransaction::processRemoveOkHandler,
-                            this));
+                std::bind(&NameRemoveTransaction::processRemoveOkHandler,
+                          this));
 
     defineState(PROCESS_TRANS_FAILED_ST, "PROCESS_TRANS_FAILED_ST",
-                boost::bind(&NameRemoveTransaction::processRemoveFailedHandler,
-                            this));
+                std::bind(&NameRemoveTransaction::processRemoveFailedHandler,
+                          this));
 }
 
 void
index cfa1a8130030ae49b5468903f0b09ee039c2de6b..497cdfe569d7966a16b4386da38db5f563435068 100644 (file)
@@ -26,6 +26,7 @@
 #include <unistd.h>
 
 using namespace std;
+using namespace std::placeholders;
 using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::config;
@@ -1159,8 +1160,8 @@ TEST_F(CtrlChannelD2Test, longCommand) {
 
     ASSERT_NO_THROW(
         CommandMgr::instance().registerCommand("foo",
-            boost::bind(&CtrlChannelD2Test::longCommandHandler,
-                        command.str(), _1, _2));
+            std::bind(&CtrlChannelD2Test::longCommandHandler,
+                      command.str(), _1, _2));
     );
 
     createUnixChannelServer();
@@ -1218,7 +1219,7 @@ TEST_F(CtrlChannelD2Test, longResponse) {
     // of a desired size
     ASSERT_NO_THROW(
         CommandMgr::instance().registerCommand("foo",
-            boost::bind(&CtrlChannelD2Test::longResponseHandler, _1, _2));
+            std::bind(&CtrlChannelD2Test::longResponseHandler, _1, _2));
     );
 
     createUnixChannelServer();
index 0486212d3fd5cb72fd7b68cde6309602f65afda3..ff7d067d8b74a8b53cf8187abde138c861927613 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 #include <process/testutils/d_test_stubs.h>
 #include <d2/tests/nc_test_utils.h>
 
-#include <boost/bind.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <gtest/gtest.h>
 
+#include <functional>
 #include <sstream>
 
 using namespace std;
@@ -549,7 +549,7 @@ TEST_F(D2ProcessTest, normalShutdown) {
     // Use an asiolink IntervalTimer and callback to generate the
     // shutdown invocation. (Note IntervalTimer setup is in milliseconds).
     isc::asiolink::IntervalTimer timer(*getIoService());
-    timer.setup(boost::bind(&D2ProcessTest::genShutdownCallback, this),
+    timer.setup(std::bind(&D2ProcessTest::genShutdownCallback, this),
                 2 * 1000);
 
     // Record start time, and invoke run().
@@ -574,7 +574,7 @@ TEST_F(D2ProcessTest, fatalErrorShutdown) {
     // Use an asiolink IntervalTimer and callback to generate the
     // the exception.  (Note IntervalTimer setup is in milliseconds).
     isc::asiolink::IntervalTimer timer(*getIoService());
-    timer.setup(boost::bind(&D2ProcessTest::genFatalErrorCallback, this),
+    timer.setup(std::bind(&D2ProcessTest::genFatalErrorCallback, this),
                 2 * 1000);
 
     // Record start time, and invoke run().
index e12a95d0fef6f6163045995e7f0878aa17d6f945..5d1cd4ba0c943f5568d849ce3382ac21c3ce1f60 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 #include <dhcp_ddns/ncr_udp.h>
 #include <util/time_utilities.h>
 
-#include <boost/function.hpp>
-#include <boost/bind.hpp>
 #include <gtest/gtest.h>
 #include <gtest/gtest.h>
 #include <algorithm>
+#include <functional>
 #include <vector>
 
 using namespace std;
@@ -224,8 +223,8 @@ public:
                                               FMT_JSON, *this, 100, true));
 
         // Set the test timeout to break any running tasks if they hang.
-        test_timer_.setup(boost::bind(&QueueMgrUDPTest::testTimeoutHandler,
-                                      this),
+        test_timer_.setup(std::bind(&QueueMgrUDPTest::testTimeoutHandler,
+                                    this),
                           TEST_TIMEOUT);
     }
 
index 373d472ba998e3d3d9b9aaadec1c8ce96e5a4a6f..dc339e0f22d2459942c074c44e1a8e7e25d0b6a8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 #include <dns/messagerenderer.h>
 #include <boost/asio/ip/udp.hpp>
 #include <boost/asio/socket_base.hpp>
-#include <boost/bind.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <gtest/gtest.h>
 #include <nc_test_utils.h>
+#include <functional>
 
 using namespace std;
+using namespace std::placeholders;
 using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::asiodns;
@@ -83,7 +84,7 @@ public:
         dns_client_.reset(new DNSClient(response_, this));
 
         // Set the test timeout to break any running tasks if they hang.
-        test_timer_.setup(boost::bind(&DNSClientTest::testTimeoutHandler, this),
+        test_timer_.setup(std::bind(&DNSClientTest::testTimeoutHandler, this),
                           TEST_TIMEOUT);
     }
 
@@ -371,9 +372,9 @@ public:
         udp_socket.async_receive_from(boost::asio::buffer(receive_buffer_,
                                                    sizeof(receive_buffer_)),
                                       remote,
-                                      boost::bind(&DNSClientTest::udpReceiveHandler,
-                                                  this, &udp_socket, &remote, _2,
-                                                  corrupt_response));
+                                      std::bind(&DNSClientTest::udpReceiveHandler,
+                                                this, &udp_socket, &remote, _2,
+                                                corrupt_response));
 
         // The socket is now ready to receive the data. Let's post some request
         // message then. Set timeout to some reasonable value to make sure that
@@ -431,10 +432,10 @@ public:
         udp_socket.async_receive_from(boost::asio::buffer(receive_buffer_,
                                                    sizeof(receive_buffer_)),
                                       remote,
-                                      boost::bind(&DNSClientTest::
-                                                  TSIGReceiveHandler, this,
-                                                  &udp_socket, &remote, _2,
-                                                  client_key, server_key));
+                                      std::bind(&DNSClientTest::
+                                                TSIGReceiveHandler, this,
+                                                &udp_socket, &remote, _2,
+                                                client_key, server_key));
 
         // The socket is now ready to receive the data. Let's post some request
         // message then. Set timeout to some reasonable value to make sure that
index 7b64bca8b1d8b5ea23710c168601b3fadd5d2b05..5e0c92610f30af96401c87613c156a6855a3b937 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -16,6 +16,7 @@
 #include <gtest/gtest.h>
 
 using namespace std;
+using namespace std::placeholders;
 using namespace isc;
 using namespace isc::d2;
 
@@ -96,10 +97,10 @@ FauxServer::receive (const ResponseMode& response_mode,
     server_socket_->async_receive_from(boost::asio::buffer(receive_buffer_,
                                                     sizeof(receive_buffer_)),
                                        remote_,
-                                       boost::bind(&FauxServer::requestHandler,
-                                                   this, _1, _2,
-                                                   response_mode,
-                                                   response_rcode));
+                                       std::bind(&FauxServer::requestHandler,
+                                                 this, _1, _2,
+                                                 response_mode,
+                                                 response_rcode));
 }
 
 void
@@ -226,7 +227,7 @@ TimedIO::runTimedIO(int run_time) {
     run_time_ = run_time;
     int cnt = io_service_->get_io_service().poll();
     if (cnt == 0) {
-        timer_.setup(boost::bind(&TimedIO::timesUp, this), run_time_);
+        timer_.setup(std::bind(&TimedIO::timesUp, this), run_time_);
         cnt = io_service_->get_io_service().run_one();
         timer_.cancel();
     }
index 9c4382cebac6e08c8739fd1bb43f2eb0f80675e2..03a89e7bc38f848a2b33d0bba942e8391b88864f 100644 (file)
 #include <util/buffer.h>
 #include <nc_test_utils.h>
 
-#include <boost/function.hpp>
-#include <boost/bind.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <gtest/gtest.h>
+#include <functional>
 
 using namespace std;
 using namespace isc;
@@ -194,25 +193,25 @@ public:
 
         // Define our states.
         defineState(READY_ST, "READY_ST",
-                             boost::bind(&NameChangeStub::readyHandler, this));
+                             std::bind(&NameChangeStub::readyHandler, this));
 
         defineState(SELECTING_FWD_SERVER_ST, "SELECTING_FWD_SERVER_ST",
-                             boost::bind(&NameChangeStub::dummyHandler, this));
+                             std::bind(&NameChangeStub::dummyHandler, this));
 
         defineState(SELECTING_REV_SERVER_ST, "SELECTING_REV_SERVER_ST",
-                             boost::bind(&NameChangeStub::dummyHandler, this));
+                             std::bind(&NameChangeStub::dummyHandler, this));
 
         defineState(DOING_UPDATE_ST, "DOING_UPDATE_ST",
-                             boost::bind(&NameChangeStub::doingUpdateHandler,
-                                         this));
+                             std::bind(&NameChangeStub::doingUpdateHandler,
+                                       this));
 
         defineState(PROCESS_TRANS_OK_ST, "PROCESS_TRANS_OK_ST",
-                             boost::bind(&NameChangeStub::
-                                         processTransDoneHandler, this));
+                             std::bind(&NameChangeStub::
+                                       processTransDoneHandler, this));
 
         defineState(PROCESS_TRANS_FAILED_ST, "PROCESS_TRANS_FAILED_ST",
-                             boost::bind(&NameChangeStub::
-                                         processTransDoneHandler, this));
+                             std::bind(&NameChangeStub::
+                                       processTransDoneHandler, this));
     }
 
     /// @brief Verify the event dictionary.
index adfb2cef7a6622f08ae11c5830a3eb3dfcb3971b..e7bf23fb71d7c8da914ce1e99b32d2f466ce39da 100644 (file)
@@ -37,6 +37,7 @@ using namespace isc::hooks;
 using namespace isc::stats;
 using namespace isc::util;
 using namespace std;
+using namespace std::placeholders;
 
 namespace {
 
@@ -797,7 +798,7 @@ ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) {
     // Re-open lease and host database with new parameters.
     try {
         DatabaseConnection::db_lost_callback =
-            boost::bind(&ControlledDhcpv4Srv::dbLostCallback, srv, _1);
+            std::bind(&ControlledDhcpv4Srv::dbLostCallback, srv, _1);
         CfgDbAccessPtr cfg_db = CfgMgr::instance().getStagingCfg()->getCfgDbAccess();
         cfg_db->setAppendedParameters("universe=4");
         cfg_db->createManagers();
@@ -884,9 +885,9 @@ ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) {
             boost::shared_ptr<unsigned> failure_count(new unsigned(0));
             TimerMgr::instance()->
                 registerTimer("Dhcp4CBFetchTimer",
-                              boost::bind(&ControlledDhcpv4Srv::cbFetchUpdates,
-                                          server_, CfgMgr::instance().getStagingCfg(),
-                                          failure_count),
+                              std::bind(&ControlledDhcpv4Srv::cbFetchUpdates,
+                                        server_, CfgMgr::instance().getStagingCfg(),
+                                        failure_count),
                               fetch_time,
                               asiolink::IntervalTimer::ONE_SHOT);
             TimerMgr::instance()->setup("Dhcp4CBFetchTimer");
@@ -973,80 +974,80 @@ ControlledDhcpv4Srv::ControlledDhcpv4Srv(uint16_t server_port /*= DHCP4_SERVER_P
     // These are the commands always supported by the DHCPv4 server.
     // Please keep the list in alphabetic order.
     CommandMgr::instance().registerCommand("build-report",
-        boost::bind(&ControlledDhcpv4Srv::commandBuildReportHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandBuildReportHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("config-backend-pull",
-        boost::bind(&ControlledDhcpv4Srv::commandConfigBackendPullHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandConfigBackendPullHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("config-get",
-        boost::bind(&ControlledDhcpv4Srv::commandConfigGetHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandConfigGetHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("config-reload",
-        boost::bind(&ControlledDhcpv4Srv::commandConfigReloadHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandConfigReloadHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("config-set",
-        boost::bind(&ControlledDhcpv4Srv::commandConfigSetHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandConfigSetHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("config-test",
-        boost::bind(&ControlledDhcpv4Srv::commandConfigTestHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandConfigTestHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("config-write",
-        boost::bind(&ControlledDhcpv4Srv::commandConfigWriteHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandConfigWriteHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("dhcp-enable",
-        boost::bind(&ControlledDhcpv4Srv::commandDhcpEnableHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandDhcpEnableHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("dhcp-disable",
-        boost::bind(&ControlledDhcpv4Srv::commandDhcpDisableHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandDhcpDisableHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("libreload",
-        boost::bind(&ControlledDhcpv4Srv::commandLibReloadHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandLibReloadHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("leases-reclaim",
-        boost::bind(&ControlledDhcpv4Srv::commandLeasesReclaimHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandLeasesReclaimHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("server-tag-get",
-        boost::bind(&ControlledDhcpv4Srv::commandServerTagGetHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandServerTagGetHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("shutdown",
-        boost::bind(&ControlledDhcpv4Srv::commandShutdownHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandShutdownHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("status-get",
-        boost::bind(&ControlledDhcpv4Srv::commandStatusGetHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandStatusGetHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("version-get",
-        boost::bind(&ControlledDhcpv4Srv::commandVersionGetHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandVersionGetHandler, this, _1, _2));
 
     // Register statistic related commands
     CommandMgr::instance().registerCommand("statistic-get",
-        boost::bind(&StatsMgr::statisticGetHandler, _1, _2));
+        std::bind(&StatsMgr::statisticGetHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-reset",
-        boost::bind(&StatsMgr::statisticResetHandler, _1, _2));
+        std::bind(&StatsMgr::statisticResetHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-remove",
-        boost::bind(&StatsMgr::statisticRemoveHandler, _1, _2));
+        std::bind(&StatsMgr::statisticRemoveHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-get-all",
-        boost::bind(&StatsMgr::statisticGetAllHandler, _1, _2));
+        std::bind(&StatsMgr::statisticGetAllHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-reset-all",
-        boost::bind(&StatsMgr::statisticResetAllHandler, _1, _2));
+        std::bind(&StatsMgr::statisticResetAllHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-remove-all",
-        boost::bind(&StatsMgr::statisticRemoveAllHandler, _1, _2));
+        std::bind(&StatsMgr::statisticRemoveAllHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-sample-age-set",
-        boost::bind(&StatsMgr::statisticSetMaxSampleAgeHandler, _1, _2));
+        std::bind(&StatsMgr::statisticSetMaxSampleAgeHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-sample-age-set-all",
-        boost::bind(&ControlledDhcpv4Srv::commandStatisticSetMaxSampleAgeAllHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandStatisticSetMaxSampleAgeAllHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-sample-count-set",
-        boost::bind(&StatsMgr::statisticSetMaxSampleCountHandler, _1, _2));
+        std::bind(&StatsMgr::statisticSetMaxSampleCountHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-sample-count-set-all",
-        boost::bind(&ControlledDhcpv4Srv::commandStatisticSetMaxSampleCountAllHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv4Srv::commandStatisticSetMaxSampleCountAllHandler, this, _1, _2));
 }
 
 void ControlledDhcpv4Srv::shutdownServer(int exit_value) {
@@ -1179,8 +1180,8 @@ ControlledDhcpv4Srv::dbReconnect(ReconnectCtlPtr db_reconnect_ctl) {
 
         if (!TimerMgr::instance()->isTimerRegistered("Dhcp4DbReconnectTimer")) {
             TimerMgr::instance()->registerTimer("Dhcp4DbReconnectTimer",
-                            boost::bind(&ControlledDhcpv4Srv::dbReconnect, this,
-                                        db_reconnect_ctl),
+                            std::bind(&ControlledDhcpv4Srv::dbReconnect, this,
+                                      db_reconnect_ctl),
                             db_reconnect_ctl->retryInterval(),
                             asiolink::IntervalTimer::ONE_SHOT);
         }
index d800f21925d41cfcac96d1c544465c31bfecedf6..983802e726b52b0866ad2f082be4d351bc9401a9 100644 (file)
 #include <dhcpsrv/memfile_lease_mgr.h>
 
 #include <boost/algorithm/string.hpp>
-#include <boost/bind.hpp>
 #include <boost/foreach.hpp>
 #include <boost/pointer_cast.hpp>
 #include <boost/shared_ptr.hpp>
 
+#include <functional>
 #include <iomanip>
 #include <set>
 #include <cstdlib>
@@ -82,6 +82,7 @@ using namespace isc::log;
 using namespace isc::stats;
 using namespace isc::util;
 using namespace std;
+using namespace std::placeholders;
 
 namespace {
 
@@ -3839,8 +3840,8 @@ Dhcpv4Srv::startD2() {
         // Updates are enabled, so lets start the sender, passing in
         // our error handler.
         // This may throw so wherever this is called needs to ready.
-        d2_mgr.startSender(boost::bind(&Dhcpv4Srv::d2ClientErrorHandler,
-                                       this, _1, _2));
+        d2_mgr.startSender(std::bind(&Dhcpv4Srv::d2ClientErrorHandler,
+                                     this, _1, _2));
     }
 }
 
index d339e66a412664dd2b48623df43c1b5730b8b1b8..dbc432fab3d282d2657e444270ae9c2a6240301a 100644 (file)
@@ -44,6 +44,7 @@
 #include <unistd.h>
 
 using namespace std;
+using namespace std::placeholders;
 using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::config;
@@ -1528,8 +1529,8 @@ TEST_F(CtrlChannelDhcpv4SrvTest, longCommand) {
 
     ASSERT_NO_THROW(
         CommandMgr::instance().registerCommand("foo",
-             boost::bind(&CtrlChannelDhcpv4SrvTest::longCommandHandler,
-                         command.str(), _1, _2));
+             std::bind(&CtrlChannelDhcpv4SrvTest::longCommandHandler,
+                       command.str(), _1, _2));
     );
 
     createUnixChannelServer();
@@ -1587,7 +1588,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, longResponse) {
     // of a desired size.
     ASSERT_NO_THROW(
         CommandMgr::instance().registerCommand("foo",
-             boost::bind(&CtrlChannelDhcpv4SrvTest::longResponseHandler, _1, _2));
+             std::bind(&CtrlChannelDhcpv4SrvTest::longResponseHandler, _1, _2));
     );
 
     createUnixChannelServer();
index 28385223ab60ef3b55bba503ed22903bda8eb53e..6519d28b776cad1474ee8cd13bbc73abf1b14560 100644 (file)
@@ -701,9 +701,9 @@ public:
 
         callout_handle.getArgument("query4", callback_qry_pkt4_);
 
-        io_service_->post(boost::bind(&HooksDhcpv4SrvTest::leases4_committed_unpark,
-                                      callout_handle.getParkingLotHandlePtr(),
-                                      callback_qry_pkt4_));
+        io_service_->post(std::bind(&HooksDhcpv4SrvTest::leases4_committed_unpark,
+                                    callout_handle.getParkingLotHandlePtr(),
+                                    callback_qry_pkt4_));
 
         callout_handle.getParkingLotHandlePtr()->reference(callback_qry_pkt4_);
         callout_handle.setStatus(CalloutHandle::NEXT_STEP_PARK);
index faf115a913617a3fde9abc9dd9e21d4fb7483dd6..4a83f8f742023dde1187d20606205553b75b75cf 100644 (file)
@@ -37,6 +37,7 @@ using namespace isc::hooks;
 using namespace isc::stats;
 using namespace isc::util;
 using namespace std;
+using namespace std::placeholders;
 
 namespace {
 
@@ -800,7 +801,7 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) {
     // Re-open lease and host database with new parameters.
     try {
         DatabaseConnection::db_lost_callback =
-            boost::bind(&ControlledDhcpv6Srv::dbLostCallback, srv, _1);
+            std::bind(&ControlledDhcpv6Srv::dbLostCallback, srv, _1);
         CfgDbAccessPtr cfg_db = CfgMgr::instance().getStagingCfg()->getCfgDbAccess();
         cfg_db->setAppendedParameters("universe=6");
         cfg_db->createManagers();
@@ -905,9 +906,9 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) {
             boost::shared_ptr<unsigned> failure_count(new unsigned(0));
             TimerMgr::instance()->
                 registerTimer("Dhcp6CBFetchTimer",
-                              boost::bind(&ControlledDhcpv6Srv::cbFetchUpdates,
-                                          server_, CfgMgr::instance().getStagingCfg(),
-                                          failure_count),
+                              std::bind(&ControlledDhcpv6Srv::cbFetchUpdates,
+                                        server_, CfgMgr::instance().getStagingCfg(),
+                                        failure_count),
                               fetch_time,
                               asiolink::IntervalTimer::ONE_SHOT);
             TimerMgr::instance()->setup("Dhcp6CBFetchTimer");
@@ -992,80 +993,80 @@ ControlledDhcpv6Srv::ControlledDhcpv6Srv(uint16_t server_port,
     // These are the commands always supported by the DHCPv6 server.
     // Please keep the list in alphabetic order.
     CommandMgr::instance().registerCommand("build-report",
-        boost::bind(&ControlledDhcpv6Srv::commandBuildReportHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandBuildReportHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("config-backend-pull",
-        boost::bind(&ControlledDhcpv6Srv::commandConfigBackendPullHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandConfigBackendPullHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("config-get",
-        boost::bind(&ControlledDhcpv6Srv::commandConfigGetHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandConfigGetHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("config-reload",
-        boost::bind(&ControlledDhcpv6Srv::commandConfigReloadHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandConfigReloadHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("config-test",
-        boost::bind(&ControlledDhcpv6Srv::commandConfigTestHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandConfigTestHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("config-write",
-        boost::bind(&ControlledDhcpv6Srv::commandConfigWriteHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandConfigWriteHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("dhcp-disable",
-        boost::bind(&ControlledDhcpv6Srv::commandDhcpDisableHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandDhcpDisableHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("dhcp-enable",
-        boost::bind(&ControlledDhcpv6Srv::commandDhcpEnableHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandDhcpEnableHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("leases-reclaim",
-        boost::bind(&ControlledDhcpv6Srv::commandLeasesReclaimHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandLeasesReclaimHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("server-tag-get",
-        boost::bind(&ControlledDhcpv6Srv::commandServerTagGetHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandServerTagGetHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("libreload",
-        boost::bind(&ControlledDhcpv6Srv::commandLibReloadHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandLibReloadHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("config-set",
-        boost::bind(&ControlledDhcpv6Srv::commandConfigSetHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandConfigSetHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("shutdown",
-        boost::bind(&ControlledDhcpv6Srv::commandShutdownHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandShutdownHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("status-get",
-        boost::bind(&ControlledDhcpv6Srv::commandStatusGetHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandStatusGetHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("version-get",
-        boost::bind(&ControlledDhcpv6Srv::commandVersionGetHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandVersionGetHandler, this, _1, _2));
 
     // Register statistic related commands
     CommandMgr::instance().registerCommand("statistic-get",
-        boost::bind(&StatsMgr::statisticGetHandler, _1, _2));
+        std::bind(&StatsMgr::statisticGetHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-get-all",
-        boost::bind(&StatsMgr::statisticGetAllHandler, _1, _2));
+        std::bind(&StatsMgr::statisticGetAllHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-reset",
-        boost::bind(&StatsMgr::statisticResetHandler, _1, _2));
+        std::bind(&StatsMgr::statisticResetHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-reset-all",
-        boost::bind(&StatsMgr::statisticResetAllHandler, _1, _2));
+        std::bind(&StatsMgr::statisticResetAllHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-remove",
-        boost::bind(&StatsMgr::statisticRemoveHandler, _1, _2));
+        std::bind(&StatsMgr::statisticRemoveHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-remove-all",
-        boost::bind(&StatsMgr::statisticRemoveAllHandler, _1, _2));
+        std::bind(&StatsMgr::statisticRemoveAllHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-sample-age-set",
-        boost::bind(&StatsMgr::statisticSetMaxSampleAgeHandler, _1, _2));
+        std::bind(&StatsMgr::statisticSetMaxSampleAgeHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-sample-age-set-all",
-        boost::bind(&ControlledDhcpv6Srv::commandStatisticSetMaxSampleAgeAllHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandStatisticSetMaxSampleAgeAllHandler, this, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-sample-count-set",
-        boost::bind(&StatsMgr::statisticSetMaxSampleCountHandler, _1, _2));
+        std::bind(&StatsMgr::statisticSetMaxSampleCountHandler, _1, _2));
 
     CommandMgr::instance().registerCommand("statistic-sample-count-set-all",
-        boost::bind(&ControlledDhcpv6Srv::commandStatisticSetMaxSampleCountAllHandler, this, _1, _2));
+        std::bind(&ControlledDhcpv6Srv::commandStatisticSetMaxSampleCountAllHandler, this, _1, _2));
 }
 
 void ControlledDhcpv6Srv::shutdownServer(int exit_value) {
@@ -1198,8 +1199,8 @@ ControlledDhcpv6Srv::dbReconnect(ReconnectCtlPtr db_reconnect_ctl) {
 
         if (!TimerMgr::instance()->isTimerRegistered("Dhcp6DbReconnectTimer")) {
             TimerMgr::instance()->registerTimer("Dhcp6DbReconnectTimer",
-                            boost::bind(&ControlledDhcpv6Srv::dbReconnect, this,
-                                        db_reconnect_ctl),
+                            std::bind(&ControlledDhcpv6Srv::dbReconnect, this,
+                                      db_reconnect_ctl),
                             db_reconnect_ctl->retryInterval(),
                             asiolink::IntervalTimer::ONE_SHOT);
         }
index 306ae95e3628c50e47b23dcd0475f9ddb36aa957..9c44466c9cd8349dc93bc057f953ee414f9f12cb 100644 (file)
@@ -66,7 +66,6 @@
 #endif
 #include <dhcpsrv/memfile_lease_mgr.h>
 
-#include <boost/bind.hpp>
 #include <boost/foreach.hpp>
 #include <boost/tokenizer.hpp>
 #include <boost/algorithm/string/erase.hpp>
@@ -74,6 +73,7 @@
 #include <boost/algorithm/string/split.hpp>
 
 #include <algorithm>
+#include <functional>
 #include <stdlib.h>
 #include <time.h>
 #include <iomanip>
@@ -91,6 +91,7 @@ using namespace isc::log;
 using namespace isc::stats;
 using namespace isc::util;
 using namespace std;
+using namespace std::placeholders;
 
 namespace {
 
@@ -3989,8 +3990,8 @@ Dhcpv6Srv::startD2() {
         // Updates are enabled, so lets start the sender, passing in
         // our error handler.
         // This may throw so wherever this is called needs to ready.
-        d2_mgr.startSender(boost::bind(&Dhcpv6Srv::d2ClientErrorHandler,
-                                       this, _1, _2));
+        d2_mgr.startSender(std::bind(&Dhcpv6Srv::d2ClientErrorHandler,
+                                     this, _1, _2));
     }
 }
 
index 5ae9b04ba2f15358a983a452e793f5e0cd156253..dd5a5b413a6280e189e7bbb1bc1deeb3bf6add8f 100644 (file)
@@ -41,6 +41,7 @@
 #include <unistd.h>
 
 using namespace std;
+using namespace std::placeholders;
 using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::config;
@@ -1556,8 +1557,8 @@ TEST_F(CtrlChannelDhcpv6SrvTest, longCommand) {
 
     ASSERT_NO_THROW(
         CommandMgr::instance().registerCommand("foo",
-             boost::bind(&CtrlChannelDhcpv6SrvTest::longCommandHandler,
-                         command.str(), _1, _2));
+             std::bind(&CtrlChannelDhcpv6SrvTest::longCommandHandler,
+                       command.str(), _1, _2));
     );
 
     createUnixChannelServer();
@@ -1615,7 +1616,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, longResponse) {
     // of a desired size.
     ASSERT_NO_THROW(
         CommandMgr::instance().registerCommand("foo",
-             boost::bind(&CtrlChannelDhcpv6SrvTest::longResponseHandler, _1, _2));
+             std::bind(&CtrlChannelDhcpv6SrvTest::longResponseHandler, _1, _2));
     );
 
     createUnixChannelServer();
index 14730a7b01e83db25b0645122ac451ab81b4158f..50e95fd214da444a494e446f85a1e51459ba88c5 100644 (file)
@@ -820,9 +820,9 @@ public:
 
         callout_handle.getArgument("query6", callback_qry_pkt6_);
 
-        io_service_->post(boost::bind(&HooksDhcpv6SrvTest::leases6_committed_unpark,
-                                      callout_handle.getParkingLotHandlePtr(),
-                                      callback_qry_pkt6_));
+        io_service_->post(std::bind(&HooksDhcpv6SrvTest::leases6_committed_unpark,
+                                    callout_handle.getParkingLotHandlePtr(),
+                                    callback_qry_pkt6_));
 
         callout_handle.getParkingLotHandlePtr()->reference(callback_qry_pkt6_);
         callout_handle.setStatus(CalloutHandle::NEXT_STEP_PARK);
index 49b6b2da03d6498a43fe51492cec4a1d95d2f866..c3ff65a9fc99701db426113fdf937a41450050f8 100644 (file)
@@ -14,9 +14,8 @@
 #include <dhcp6/tests/dhcp6_test_utils.h>
 #include <dhcp6/tests/dhcp6_client.h>
 #include <boost/algorithm/string/join.hpp>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
 #include <boost/lexical_cast.hpp>
+#include <functional>
 #include <list>
 #include <sstream>
 
@@ -724,8 +723,8 @@ public:
         : Dhcpv6SrvTest(),
           iface_mgr_test_config_(true),
           client_(),
-          do_solicit_(boost::bind(&Dhcp6Client::doSolicit, &client_, true)),
-          do_solicit_request_(boost::bind(&Dhcp6Client::doSARR, &client_)) {
+          do_solicit_(std::bind(&Dhcp6Client::doSolicit, &client_, true)),
+          do_solicit_request_(std::bind(&Dhcp6Client::doSARR, &client_)) {
     }
 
     /// @brief Checks that specified option contains a desired address.
@@ -888,7 +887,7 @@ public:
     /// @param h4 Hint 4.
     /// @param h5 Hint 5.
     /// @param h6 Hint 6.
-    void testMultipleIAs(const boost::function<void ()>& client_operation,
+    void testMultipleIAs(const std::function<void ()>& client_operation,
                          const Reservation& r1 = Reservation::UNSPEC(),
                          const Reservation& r2 = Reservation::UNSPEC(),
                          const Reservation& r3 = Reservation::UNSPEC(),
@@ -984,10 +983,10 @@ public:
     Dhcp6Client client_;
 
     /// @brief Pointer to the Dhcp6Client::doSolicit method.
-    boost::function<void() > do_solicit_;
+    std::function<void() > do_solicit_;
 
     /// @brief Pointer to the Dhcp6Client::doSARR method.
-    boost::function<void() > do_solicit_request_;
+    std::function<void() > do_solicit_request_;
 };
 
 void
@@ -1096,7 +1095,7 @@ HostTest::testLeaseForIA(const Hint& h) {
 }
 
 void
-HostTest::testMultipleIAs(const boost::function<void ()>& client_operation,
+HostTest::testMultipleIAs(const std::function<void ()>& client_operation,
                           const Reservation& r1, const Reservation& r2,
                           const Reservation& r3, const Reservation& r4,
                           const Reservation& r5, const Reservation& r6,
index 956f6725111824a9b707ffa17635c9586fca049a..c16b7e72339e0ef964eff985e78804e32de72a60 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -10,9 +10,9 @@
 #include <asiolink/interval_timer.h>
 #include <asiolink/io_service.h>
 #include <process/testutils/d_test_stubs.h>
-#include <boost/bind.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <gtest/gtest.h>
+#include <functional>
 
 using namespace boost::posix_time;
 using namespace isc;
@@ -66,7 +66,7 @@ TEST_F(NetconfProcessTest, shutdown) {
     // Use an asiolink IntervalTimer and callback to generate the
     // shutdown invocation. (Note IntervalTimer setup is in milliseconds).
     IntervalTimer timer(*getIoService());
-    timer.setup(boost::bind(&NetconfProcessTest::genShutdownCallback, this),
+    timer.setup(std::bind(&NetconfProcessTest::genShutdownCallback, this),
                 200);
 
     // Record start time, and invoke run().
index 65a8987f10bda39218d17936526ea6f390b3a95f..61deba5eb1087dd54799936ebb3c1b02f55e2df8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -9,7 +9,7 @@
 
 #include <dhcp/iface_mgr.h>
 
-#include <boost/bind.hpp>
+#include <functional>
 
 using namespace std;
 using namespace isc::dhcp;
@@ -27,7 +27,7 @@ Receiver::start() {
         run_flag_.clear();
         isc_throw(isc::Unexpected, "run_flag_ should be false.");
     }
-    recv_thread_.reset(new std::thread(boost::bind(&Receiver::run, this)));
+    recv_thread_.reset(new std::thread(std::bind(&Receiver::run, this)));
 }
 
 void
index d495adc98371b429965692a261ab0f731b44abf4..76eb2a13316fd59bad478c1b66778cc76d595b1c 100644 (file)
@@ -21,9 +21,9 @@
 #include <util/boost_time_utils.h>
 #include <util/multi_threading_mgr.h>
 
-#include <boost/bind.hpp>
 #include <boost/pointer_cast.hpp>
 
+#include <functional>
 #include <sstream>
 #include <utility>
 
@@ -112,13 +112,13 @@ CommunicationState::setPartnerScopes(ConstElementPtr new_scopes) {
 
 void
 CommunicationState::startHeartbeat(const long interval,
-                                   const boost::function<void()>& heartbeat_impl) {
+                                   const std::function<void()>& heartbeat_impl) {
     startHeartbeatInternal(interval, heartbeat_impl);
 }
 
 void
 CommunicationState::startHeartbeatInternal(const long interval,
-                                           const boost::function<void()>& heartbeat_impl) {
+                                           const std::function<void()>& heartbeat_impl) {
     bool settings_modified = false;
 
     // If we're setting the heartbeat for the first time, it should
index 5549a20c247a7c0bca4037272266a035264522ed..b78d192b62c5584ed2e31249def4d8b77a88d5a9 100644 (file)
@@ -15,7 +15,6 @@
 #include <dhcp/pkt.h>
 
 #include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/function.hpp>
 #include <boost/multi_index_container.hpp>
 #include <boost/multi_index/composite_key.hpp>
 #include <boost/multi_index/hashed_index.hpp>
@@ -25,6 +24,7 @@
 #include <boost/scoped_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 
+#include <functional>
 #include <map>
 #include <mutex>
 #include <set>
@@ -129,7 +129,7 @@ public:
     /// @param heartbeat_impl pointer to the heartbeat implementation
     /// function.
     void startHeartbeat(const long interval,
-                        const boost::function<void()>& heartbeat_impl);
+                        const std::function<void()>& heartbeat_impl);
 
 protected:
 
@@ -139,7 +139,7 @@ protected:
     /// @param heartbeat_impl pointer to the heartbeat implementation
     /// function.
     void startHeartbeatInternal(const long interval = 0,
-                                const boost::function<void()>& heartbeat_impl = 0);
+                                const std::function<void()>& heartbeat_impl = 0);
 
 public:
 
@@ -394,7 +394,7 @@ protected:
     boost::posix_time::ptime poke_time_;
 
     /// @brief Pointer to the function providing heartbeat implementation.
-    boost::function<void()> heartbeat_impl_;
+    std::function<void()> heartbeat_impl_;
 
     /// @brief Last known state of the partner server.
     ///
index 63cb3e9c6424a0ebbe1c77421d14e599909b024e..4f21e4a8641cd93c4e7d27d94040d44aa60dd1a4 100644 (file)
@@ -22,9 +22,9 @@
 #include <util/multi_threading_mgr.h>
 #include <util/stopwatch.h>
 #include <boost/pointer_cast.hpp>
-#include <boost/bind.hpp>
 #include <boost/make_shared.hpp>
 #include <boost/weak_ptr.hpp>
+#include <functional>
 #include <sstream>
 
 using namespace isc::asiolink;
@@ -35,6 +35,7 @@ using namespace isc::hooks;
 using namespace isc::http;
 using namespace isc::log;
 using namespace isc::util;
+using namespace std::placeholders;
 
 namespace isc {
 namespace ha {
@@ -99,47 +100,47 @@ HAService::defineStates() {
     StateModel::defineStates();
 
     defineState(HA_BACKUP_ST, stateToString(HA_BACKUP_ST),
-                boost::bind(&HAService::backupStateHandler, this),
+                std::bind(&HAService::backupStateHandler, this),
                 config_->getStateMachineConfig()->getStateConfig(HA_BACKUP_ST)->getPausing());
 
     defineState(HA_HOT_STANDBY_ST, stateToString(HA_HOT_STANDBY_ST),
-                boost::bind(&HAService::normalStateHandler, this),
+                std::bind(&HAService::normalStateHandler, this),
                 config_->getStateMachineConfig()->getStateConfig(HA_HOT_STANDBY_ST)->getPausing());
 
     defineState(HA_LOAD_BALANCING_ST, stateToString(HA_LOAD_BALANCING_ST),
-                boost::bind(&HAService::normalStateHandler, this),
+                std::bind(&HAService::normalStateHandler, this),
                 config_->getStateMachineConfig()->getStateConfig(HA_LOAD_BALANCING_ST)->getPausing());
 
     defineState(HA_IN_MAINTENANCE_ST, stateToString(HA_IN_MAINTENANCE_ST),
-                boost::bind(&HAService::inMaintenanceStateHandler, this),
+                std::bind(&HAService::inMaintenanceStateHandler, this),
                 config_->getStateMachineConfig()->getStateConfig(HA_IN_MAINTENANCE_ST)->getPausing());
 
     defineState(HA_PARTNER_DOWN_ST, stateToString(HA_PARTNER_DOWN_ST),
-                boost::bind(&HAService::partnerDownStateHandler, this),
+                std::bind(&HAService::partnerDownStateHandler, this),
                 config_->getStateMachineConfig()->getStateConfig(HA_PARTNER_DOWN_ST)->getPausing());
 
     defineState(HA_PARTNER_IN_MAINTENANCE_ST, stateToString(HA_PARTNER_IN_MAINTENANCE_ST),
-                boost::bind(&HAService::partnerInMaintenanceStateHandler, this),
+                std::bind(&HAService::partnerInMaintenanceStateHandler, this),
                 config_->getStateMachineConfig()->getStateConfig(HA_PARTNER_IN_MAINTENANCE_ST)->getPausing());
 
     defineState(HA_PASSIVE_BACKUP_ST, stateToString(HA_PASSIVE_BACKUP_ST),
-                boost::bind(&HAService::passiveBackupStateHandler, this),
+                std::bind(&HAService::passiveBackupStateHandler, this),
                 config_->getStateMachineConfig()->getStateConfig(HA_PASSIVE_BACKUP_ST)->getPausing());
 
     defineState(HA_READY_ST, stateToString(HA_READY_ST),
-                boost::bind(&HAService::readyStateHandler, this),
+                std::bind(&HAService::readyStateHandler, this),
                 config_->getStateMachineConfig()->getStateConfig(HA_READY_ST)->getPausing());
 
     defineState(HA_SYNCING_ST, stateToString(HA_SYNCING_ST),
-                boost::bind(&HAService::syncingStateHandler, this),
+                std::bind(&HAService::syncingStateHandler, this),
                 config_->getStateMachineConfig()->getStateConfig(HA_SYNCING_ST)->getPausing());
 
     defineState(HA_TERMINATED_ST, stateToString(HA_TERMINATED_ST),
-                boost::bind(&HAService::terminatedStateHandler, this),
+                std::bind(&HAService::terminatedStateHandler, this),
                 config_->getStateMachineConfig()->getStateConfig(HA_TERMINATED_ST)->getPausing());
 
     defineState(HA_WAITING_ST, stateToString(HA_WAITING_ST),
-                boost::bind(&HAService::waitingStateHandler, this),
+                std::bind(&HAService::waitingStateHandler, this),
                 config_->getStateMachineConfig()->getStateConfig(HA_WAITING_ST)->getPausing());
 }
 
@@ -1092,8 +1093,8 @@ HAService::asyncSendLeaseUpdate(const QueryPtrType& query,
             }
         },
         HttpClient::RequestTimeout(TIMEOUT_DEFAULT_HTTP_CLIENT_REQUEST),
-        boost::bind(&HAService::clientConnectHandler, this, _1, _2),
-        boost::bind(&HAService::clientCloseHandler, this, _1)
+        std::bind(&HAService::clientConnectHandler, this, _1, _2),
+        std::bind(&HAService::clientCloseHandler, this, _1)
     );
 
     // The number of pending requests is the number of requests for which we
@@ -1372,8 +1373,8 @@ HAService::asyncSendHeartbeat() {
             runModel(HA_HEARTBEAT_COMPLETE_EVT);
         },
         HttpClient::RequestTimeout(TIMEOUT_DEFAULT_HTTP_CLIENT_REQUEST),
-        boost::bind(&HAService::clientConnectHandler, this, _1, _2),
-        boost::bind(&HAService::clientCloseHandler, this, _1)
+        std::bind(&HAService::clientConnectHandler, this, _1, _2),
+        std::bind(&HAService::clientCloseHandler, this, _1)
     );
 }
 
@@ -1388,8 +1389,8 @@ void
 HAService::startHeartbeat() {
     if (config_->getHeartbeatDelay() > 0) {
         communication_state_->startHeartbeat(config_->getHeartbeatDelay(),
-                                             boost::bind(&HAService::asyncSendHeartbeat,
-                                                         this));
+                                             std::bind(&HAService::asyncSendHeartbeat,
+                                                       this));
     }
 }
 
@@ -1463,8 +1464,8 @@ HAService::asyncDisableDHCPService(HttpClient& http_client,
              }
         },
         HttpClient::RequestTimeout(TIMEOUT_DEFAULT_HTTP_CLIENT_REQUEST),
-        boost::bind(&HAService::clientConnectHandler, this, _1, _2),
-        boost::bind(&HAService::clientCloseHandler, this, _1)
+        std::bind(&HAService::clientConnectHandler, this, _1, _2),
+        std::bind(&HAService::clientCloseHandler, this, _1)
     );
 }
 
@@ -1535,8 +1536,8 @@ HAService::asyncEnableDHCPService(HttpClient& http_client,
              }
         },
         HttpClient::RequestTimeout(TIMEOUT_DEFAULT_HTTP_CLIENT_REQUEST),
-        boost::bind(&HAService::clientConnectHandler, this, _1, _2),
-        boost::bind(&HAService::clientCloseHandler, this, _1)
+        std::bind(&HAService::clientConnectHandler, this, _1, _2),
+        std::bind(&HAService::clientCloseHandler, this, _1)
     );
 }
 
@@ -1776,8 +1777,8 @@ HAService::asyncSyncLeasesInternal(http::HttpClient& http_client,
             }
         },
         HttpClient::RequestTimeout(config_->getSyncTimeout()),
-        boost::bind(&HAService::clientConnectHandler, this, _1, _2),
-        boost::bind(&HAService::clientCloseHandler, this, _1)
+        std::bind(&HAService::clientConnectHandler, this, _1, _2),
+        std::bind(&HAService::clientCloseHandler, this, _1)
     );
 
 }
@@ -2011,8 +2012,8 @@ HAService::processMaintenanceStart() {
              captured_error_message = error_message;
         },
         HttpClient::RequestTimeout(TIMEOUT_DEFAULT_HTTP_CLIENT_REQUEST),
-        boost::bind(&HAService::clientConnectHandler, this, _1, _2),
-        boost::bind(&HAService::clientCloseHandler, this, _1)
+        std::bind(&HAService::clientConnectHandler, this, _1, _2),
+        std::bind(&HAService::clientCloseHandler, this, _1)
     );
 
     // Run the IO service until it is stopped by any of the callbacks. This
@@ -2119,8 +2120,8 @@ HAService::processMaintenanceCancel() {
              }
         },
         HttpClient::RequestTimeout(TIMEOUT_DEFAULT_HTTP_CLIENT_REQUEST),
-        boost::bind(&HAService::clientConnectHandler, this, _1, _2),
-        boost::bind(&HAService::clientCloseHandler, this, _1)
+        std::bind(&HAService::clientConnectHandler, this, _1, _2),
+        std::bind(&HAService::clientCloseHandler, this, _1)
     );
 
     // Run the IO service until it is stopped by any of the callbacks. This
@@ -2203,7 +2204,7 @@ HAService::clientConnectHandler(const boost::system::error_code& ec, int tcp_nat
         // We are registerin the socket only to interrupt main-thread
         // select().
         IfaceMgr::instance().addExternalSocket(tcp_native_fd,
-            boost::bind(&HAService::socketReadyHandler, this, _1)
+            std::bind(&HAService::socketReadyHandler, this, _1)
         );
     }
 
index 8fccd838d3d80368b2f1c46d39385c5f3729d42e..64342f01f31bb6245bda99f7096872803a61ae23 100644 (file)
 #include <http/date_time.h>
 #include <util/multi_threading_mgr.h>
 
-
 #include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
 #include <gtest/gtest.h>
+#include <functional>
 
 using namespace isc;
 using namespace isc::asiolink;
@@ -59,8 +57,8 @@ public:
     /// @brief Returns test heartbeat implementation.
     ///
     /// @return Pointer to heartbeat implementation function under test.
-    boost::function<void()> getHeartbeatImpl() {
-        return (boost::bind(&CommunicationStateTest::heartbeatImpl, this));
+    std::function<void()> getHeartbeatImpl() {
+        return (std::bind(&CommunicationStateTest::heartbeatImpl, this));
     }
 
     /// @brief Test heartbeat implementation.
index 78f86011a04fe5f72e29acdb32e8d5dfb9cdf2d2..bfe2ab18c04a6b4aa0d1d25b4e4963b067a81552 100644 (file)
@@ -20,7 +20,7 @@
 #include <hooks/hooks.h>
 #include <hooks/hooks_manager.h>
 #include <util/range_utilities.h>
-#include <boost/bind.hpp>
+#include <functional>
 #include <utility>
 #include <vector>
 
@@ -72,7 +72,7 @@ void
 HATest::runIOService(long ms) {
     io_service_->get_io_service().reset();
     IntervalTimer timer(*io_service_);
-    timer.setup(boost::bind(&IOService::stop, io_service_), ms,
+    timer.setup(std::bind(&IOService::stop, io_service_), ms,
                 IntervalTimer::ONE_SHOT);
     io_service_->run();
     timer.cancel();
@@ -83,7 +83,7 @@ HATest::runIOService(long ms, std::function<bool()> stop_condition) {
     io_service_->get_io_service().reset();
     IntervalTimer timer(*io_service_);
     bool timeout = false;
-    timer.setup(boost::bind(&HATest::stopIOServiceHandler, this, boost::ref(timeout)),
+    timer.setup(std::bind(&HATest::stopIOServiceHandler, this, std::ref(timeout)),
                 ms, IntervalTimer::ONE_SHOT);
 
     while (!stop_condition() && !timeout) {
@@ -101,10 +101,10 @@ HATest::runIOServiceInThread() {
     std::mutex mutex;
     std::condition_variable condvar;
 
-    io_service_->post(boost::bind(&HATest::signalServiceRunning, this, boost::ref(running),
-                                  boost::ref(mutex), boost::ref(condvar)));
+    io_service_->post(std::bind(&HATest::signalServiceRunning, this, std::ref(running),
+                                  std::ref(mutex), std::ref(condvar)));
     boost::shared_ptr<std::thread>
-        th(new std::thread(boost::bind(&IOService::run, io_service_.get())));
+        th(new std::thread(std::bind(&IOService::run, io_service_.get())));
 
     std::unique_lock<std::mutex> lock(mutex);
     while (!running) {
index 802392199378df9495bf1cc6bc657bc573dd78c3..c8142083ccff6e7311382741a4afdabb54377ed9 100644 (file)
@@ -24,6 +24,7 @@
 #include <set>
 
 using namespace std;
+using namespace std::placeholders;
 using namespace isc;
 using namespace isc::hooks;
 using namespace isc::config;
@@ -657,8 +658,8 @@ public:
         D2ClientConfigPtr cfg(new D2ClientConfig());
         ASSERT_NO_THROW(cfg->enableUpdates(true));
         ASSERT_NO_THROW(CfgMgr::instance().setD2ClientConfig(cfg));
-        d2_mgr_.startSender(boost::bind(&LeaseCmdsTest::d2ErrorHandler, this,
-                                        _1, _2));
+        d2_mgr_.startSender(std::bind(&LeaseCmdsTest::d2ErrorHandler, this,
+                                      _1, _2));
     }
 
     /// @brief Disables DHCP-DDNS updates.
index 4a3b8a31900ba35a4a9180a5cdcb58dab99f1a2e..d5405c518bcf5c0a28254c2700fcee703ec57e53 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 #include <util/buffer.h>
 #include <util/random/qid_gen.h>
 
-#include <boost/bind.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <boost/date_time/posix_time/posix_time_types.hpp>
 
+#include <functional>
 #include <unistd.h>             // for some IPC/network system calls
 #include <netinet/in.h>
 #include <stdint.h>
@@ -252,7 +252,7 @@ IOFetch::operator()(boost::system::error_code ec, size_t length) {
                 // first two bytes of the packet).
                 data_->msgbuf->writeUint16At(data_->qid, 0);
 
-            } 
+            }
         }
 
         // If we timeout, we stop, which will can cancel outstanding I/Os and
@@ -260,7 +260,7 @@ IOFetch::operator()(boost::system::error_code ec, size_t length) {
         if (data_->timeout != -1) {
             data_->timer.expires_from_now(boost::posix_time::milliseconds(
                 data_->timeout));
-            data_->timer.async_wait(boost::bind(&IOFetch::stop, *this,
+            data_->timer.async_wait(std::bind(&IOFetch::stop, *this,
                 TIME_OUT));
         }
 
@@ -279,7 +279,7 @@ IOFetch::operator()(boost::system::error_code ec, size_t length) {
             data_->origin = ASIODNS_SEND_DATA;
             BOOST_ASIO_CORO_YIELD data_->socket->asyncSend(data_->msgbuf->getData(),
                 data_->msgbuf->getLength(), data_->remote_snd.get(), *this);
-    
+
             // Now receive the response.  Since TCP may not receive the entire
             // message in one operation, we need to loop until we have received
             // it. (This can't be done within the asyncReceive() method because
@@ -298,7 +298,7 @@ IOFetch::operator()(boost::system::error_code ec, size_t length) {
             // the expected amount of data.  Then we need to loop until we have
             // received all the data before copying it back to the user's buffer.
             // And we want to minimize the amount of copying...
-    
+
             data_->origin = ASIODNS_READ_DATA;
             data_->cumulative = 0;          // No data yet received
             data_->offset = 0;              // First data into start of buffer
index 02db1e4a38f7c295cfcb10dc2e1ec61a9b985653..12d139765b12d63c65fb8b113ea0388e5657ce1f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 #include <util/io_utilities.h>
 
 #include <gtest/gtest.h>
-#include <boost/bind.hpp>
 #include <boost/date_time/posix_time/posix_time_types.hpp>
 
 #include <algorithm>
 #include <cstdlib>
+#include <functional>
 #include <string>
 #include <iostream>
 #include <iomanip>
 #include <iterator>
 #include <vector>
 
+using namespace boost::asio::ip;
 using namespace boost::asio;
+using namespace isc::asiolink;
 using namespace isc::dns;
 using namespace isc::util;
-using namespace boost::asio::ip;
+using namespace std::placeholders;
 using namespace std;
-using namespace isc::asiolink;
 
 namespace isc {
 namespace asiodns {
@@ -241,7 +242,7 @@ public:
         // Initiate a read on the socket.
         cumulative_ = 0;
         socket->async_receive(boost::asio::buffer(receive_buffer_, sizeof(receive_buffer_)),
-            boost::bind(&IOFetchTest::tcpReceiveHandler, this, socket, _1, _2));
+            std::bind(&IOFetchTest::tcpReceiveHandler, this, socket, _1, _2));
     }
 
     /// \brief Completion handler for receiving TCP data
@@ -278,7 +279,7 @@ public:
         if (!complete) {
             socket->async_receive(boost::asio::buffer((receive_buffer_ + cumulative_),
                 (sizeof(receive_buffer_) - cumulative_)),
-                boost::bind(&IOFetchTest::tcpReceiveHandler, this, socket, _1, _2));
+                std::bind(&IOFetchTest::tcpReceiveHandler, this, socket, _1, _2));
             return;
         }
 
@@ -336,7 +337,7 @@ public:
                                     // Pointer to data to send
         size_t amount = 16;         // Amount of data to send
         if (send_cumulative_ < (2 * amount)) {
-            
+
             // First or second time through, send at most 16 bytes
             amount = min(amount, (send_buffer_.size() - send_cumulative_));
 
@@ -366,8 +367,8 @@ public:
         // ... and send it.  The amount sent is also passed as the first
         // argument of the send callback, as a check.
         socket->async_send(boost::asio::buffer(send_ptr, amount),
-                           boost::bind(&IOFetchTest::tcpSendHandler, this,
-                                       amount, socket, _1, _2));
+                           std::bind(&IOFetchTest::tcpSendHandler, this,
+                                     amount, socket, _1, _2));
     }
 
     /// \brief Completion Handler for Sending TCP data
@@ -409,8 +410,8 @@ public:
             // socket over which data should be sent as an argument to that
             // function.
             timer_.expires_from_now(boost::posix_time::milliseconds(SEND_INTERVAL));
-            timer_.async_wait(boost::bind(&IOFetchTest::tcpSendData, this,
-                                          socket));
+            timer_.async_wait(std::bind(&IOFetchTest::tcpSendData, this,
+                                        socket));
         }
     }
 
@@ -475,10 +476,10 @@ public:
         // Post the query
         service_.get_io_service().post(fetch);
 
-        // Post query_.stop() (yes, the boost::bind thing is just
+        // Post query_.stop() (yes, the std::bind thing is just
         // query_.stop()).
         service_.get_io_service().post(
-            boost::bind(&IOFetch::stop, fetch, IOFetch::STOPPED));
+            std::bind(&IOFetch::stop, fetch, IOFetch::STOPPED));
 
         // Run both of them.  run() returns when everything in the I/O service
         // queue has completed.
@@ -549,7 +550,7 @@ public:
         tcp::acceptor acceptor(service_.get_io_service(),
                                tcp::endpoint(tcp::v4(), TEST_PORT));
         acceptor.async_accept(socket,
-            boost::bind(&IOFetchTest::tcpAcceptHandler, this, &socket, _1));
+            std::bind(&IOFetchTest::tcpAcceptHandler, this, &socket, _1));
 
         // Post the TCP fetch object to send the query and receive the response.
         service_.get_io_service().post(tcp_fetch_);
@@ -583,9 +584,9 @@ public:
         socket.async_receive_from(boost::asio::buffer(receive_buffer_,
                                                sizeof(receive_buffer_)),
                                   remote,
-                                  boost::bind(&IOFetchTest::udpReceiveHandler,
-                                              this, &remote, &socket,
-                                              _1, _2, bad_qid, second_send));
+                                  std::bind(&IOFetchTest::udpReceiveHandler,
+                                            this, &remote, &socket,
+                                            _1, _2, bad_qid, second_send));
         service_.get_io_service().post(udp_fetch_);
         if (debug_) {
             cout << "udpSendReceive: async_receive_from posted,"
index 5a3061e6886b8130176b76ea8329b7f3d1582e72..b74901969ea2a9e902c8aaf6cf7a4ed1d74f0c02 100644 (file)
@@ -9,7 +9,6 @@
 #include <asiolink/interval_timer.h>
 #include <asiolink/io_service.h>
 
-#include <boost/bind.hpp>
 #include <boost/enable_shared_from_this.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/shared_ptr.hpp>
@@ -17,6 +16,7 @@
 #include <exceptions/exceptions.h>
 
 #include <atomic>
+#include <functional>
 #include <mutex>
 
 using namespace std;
@@ -118,7 +118,7 @@ IntervalTimerImpl::setup(const IntervalTimer::Callback& cbfunc,
                                  "equal to 0");
     }
     // Call back function should not be empty.
-    if (cbfunc.empty()) {
+    if (!cbfunc) {
         isc_throw(isc::InvalidParameter, "Callback function is empty");
     }
 
@@ -140,9 +140,9 @@ IntervalTimerImpl::update() {
         timer_.expires_from_now(boost::posix_time::millisec(long(interval_)));
         // Reset timer.
         // Pass a function bound with a shared_ptr to this.
-        timer_.async_wait(boost::bind(&IntervalTimerImpl::callback,
-                                      shared_from_this(),
-                                      boost::asio::placeholders::error));
+        timer_.async_wait(std::bind(&IntervalTimerImpl::callback,
+                                    shared_from_this(),
+                                    std::placeholders::_1)); //error
     } catch (const boost::system::system_error& e) {
         isc_throw(isc::Unexpected, "Failed to update timer: " << e.what());
     } catch (const boost::bad_weak_ptr&) {
index a942d8e525c9cecc861126239328146323518100..5dc8b71ab3447f160eeefe36d5233149b1522361 100644 (file)
@@ -7,8 +7,8 @@
 #ifndef ASIOLINK_INTERVAL_TIMER_H
 #define ASIOLINK_INTERVAL_TIMER_H 1
 
-#include <boost/function.hpp>
 #include <boost/shared_ptr.hpp>
+#include <functional>
 
 #include <asiolink/io_service.h>
 
@@ -52,7 +52,7 @@ class IntervalTimerImpl;
 class IntervalTimer {
 public:
     /// \name The type of timer callback function
-    typedef boost::function<void()> Callback;
+    typedef std::function<void()> Callback;
 
     /// \brief Defines possible timer modes used to setup a timer.
     /// - REPEATING - Timer will reschedule itself after each expiration
index 4aebddc9b360d4666a14cec557d8d18073dc640d..cbc3ccca3821a49f1b96c13e28264041fd7910b5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -17,19 +17,19 @@ namespace isc {
 namespace asiolink {
 
 namespace {
-// A trivial wrapper for boost::function.  SunStudio doesn't seem to be capable
-// of handling a boost::function object if directly passed to
+// A trivial wrapper for std::function.  SunStudio doesn't seem to be capable
+// of handling a std::function object if directly passed to
 // io_service::post().
 class CallbackWrapper {
 public:
-    CallbackWrapper(const boost::function<void()>& callback) :
+    CallbackWrapper(const std::function<void()>& callback) :
         callback_(callback)
     {}
     void operator()() {
         callback_();
     }
 private:
-    boost::function<void()> callback_;
+    std::function<void()> callback_;
 };
 }
 
@@ -90,7 +90,7 @@ public:
     /// It will eventually be removed once the wrapper interface is
     /// generalized.
     boost::asio::io_service& get_io_service() { return io_service_; };
-    void post(const boost::function<void ()>& callback) {
+    void post(const std::function<void ()>& callback) {
         const CallbackWrapper wrapper(callback);
         io_service_.post(wrapper);
     }
@@ -138,7 +138,7 @@ IOService::get_io_service() {
 }
 
 void
-IOService::post(const boost::function<void ()>& callback) {
+IOService::post(const std::function<void ()>& callback) {
     return (io_impl_->post(callback));
 }
 
index 025c33e72714c89eaedf703567f1495a3a0ed0b4..acfb97361ceb9340c751210c8f171750f95524b8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -7,7 +7,9 @@
 #ifndef ASIOLINK_IO_SERVICE_H
 #define ASIOLINK_IO_SERVICE_H 1
 
-#include <boost/function.hpp>
+#include <boost/version.hpp>
+#include <boost/shared_ptr.hpp>
+#include <functional>
 
 namespace boost {
 namespace asio {
@@ -90,7 +92,7 @@ public:
     ///
     /// It may be used to implement "background" work, for example (doing stuff
     /// by small bits that are called from time to time).
-    void post(const boost::function<void ()>& callback);
+    void post(const std::function<void ()>& callback);
 
 private:
     IOServiceImpl* io_impl_;
index 882169d4d7bdbe573e7a4d5e817f77b6c57df37d..05fc5ac479ce2b03381655a02a88ed833a70fb0e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -9,7 +9,7 @@
 #include <asiolink/io_service.h>
 
 #include <gtest/gtest.h>
-#include <boost/bind.hpp>
+#include <functional>
 #include <vector>
 
 using namespace isc::asiolink;
@@ -26,9 +26,9 @@ TEST(IOService, post) {
     std::vector<int> called;
     IOService service;
     // Post two events
-    service.post(boost::bind(&postedEvent, &called, 1));
-    service.post(boost::bind(&postedEvent, &called, 2));
-    service.post(boost::bind(&postedEvent, &called, 3));
+    service.post(std::bind(&postedEvent, &called, 1));
+    service.post(std::bind(&postedEvent, &called, 2));
+    service.post(std::bind(&postedEvent, &called, 3));
     // They have not yet been called
     EXPECT_TRUE(called.empty());
     // Process two events
index a88a07a9716ebb2f9d8ec7ec83e0aacb01520fcd..8229bbcdb7c56dee08ed6f008f307ac525ef1603 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 #include <asiolink/io_service.h>
 #include <asiolink/tcp_acceptor.h>
 #include <asiolink/tcp_endpoint.h>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/shared_ptr.hpp>
 #include <gtest/gtest.h>
+#include <functional>
 #include <list>
 #include <netinet/in.h>
 #include <string>
@@ -83,7 +82,8 @@ public:
             endpoint(boost::asio::ip::address::from_string(SERVER_ADDRESS),
                      SERVER_PORT);
         socket_.async_connect(endpoint,
-                              boost::bind(&TCPClient::connectHandler, this,_1));
+                              std::bind(&TCPClient::connectHandler, this,
+                                        std::placeholders::_1));
     }
 
     /// @brief Callback function for connect().
@@ -128,7 +128,7 @@ typedef boost::shared_ptr<TCPClient> TCPClientPtr;
 
 /// @brief A signature of the function implementing callback for the
 /// TCPAcceptor.
-typedef boost::function<void(const boost::system::error_code&)> TCPAcceptorCallback;
+typedef std::function<void(const boost::system::error_code&)> TCPAcceptorCallback;
 
 /// @brief TCPAcceptor using TCPAcceptorCallback.
 typedef TCPAcceptor<TCPAcceptorCallback> TestTCPAcceptor;
@@ -205,8 +205,8 @@ public:
           endpoint_(asio_endpoint_), test_timer_(io_service_), connections_(),
           clients_(), connections_num_(0), aborted_connections_num_(0),
           max_connections_(1) {
-        test_timer_.setup(boost::bind(&TCPAcceptorTest::timeoutHandler, this),
-                                      TEST_TIMEOUT, IntervalTimer::ONE_SHOT);
+        test_timer_.setup(std::bind(&TCPAcceptorTest::timeoutHandler, this),
+                                    TEST_TIMEOUT, IntervalTimer::ONE_SHOT);
     }
 
     /// @brief Destructor.
@@ -250,8 +250,8 @@ public:
     /// accepting new connections. The instance of the Acceptor object is
     /// retained in the connections_ list.
     void accept() {
-        TCPAcceptorCallback cb = boost::bind(&TCPAcceptorTest::acceptHandler,
-                                             this, _1);
+        TCPAcceptorCallback cb = std::bind(&TCPAcceptorTest::acceptHandler,
+                                           this, std::placeholders::_1);
         AcceptorPtr conn(new Acceptor(io_service_, acceptor_, cb));
         connections_.push_back(conn);
         connections_.back()->accept();
index 11d462246a121a939872a6193441c1e7a8b606c1..d22b9802a1ae50671b96275dbef8fde34336fd22 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -8,7 +8,6 @@
 
 #include <asiolink/asio_wrapper.h>
 #include <asiolink/testutils/test_server_unix_socket.h>
-#include <boost/bind.hpp>
 #include <boost/enable_shared_from_this.hpp>
 #include <boost/shared_ptr.hpp>
 #include <functional>
@@ -55,9 +54,9 @@ public:
     /// @brief Starts asynchronous read from the socket.
     void start() {
        socket_->async_read_some(boost::asio::buffer(&raw_buf_[0], raw_buf_.size()),
-           boost::bind(&Connection::readHandler, shared_from_this(),
-                       boost::asio::placeholders::error,
-                       boost::asio::placeholders::bytes_transferred));
+           std::bind(&Connection::readHandler, shared_from_this(),
+                     std::placeholders::_1,   // error
+                     std::placeholders::_2)); // bytes_transferred
     }
 
     /// @brief Closes the socket.
@@ -253,7 +252,7 @@ TestServerUnixSocket::generateCustomResponse(const uint64_t response_size) {
 
 void
 TestServerUnixSocket::startTimer(const long test_timeout) {
-    test_timer_.setup(boost::bind(&TestServerUnixSocket::timeoutHandler, this),
+    test_timer_.setup(std::bind(&TestServerUnixSocket::timeoutHandler, this),
                       test_timeout, IntervalTimer::ONE_SHOT);
 }
 
@@ -275,8 +274,8 @@ TestServerUnixSocket::bindServerSocket(const bool use_thread) {
     // when the thread has already started and the IO service is running. The
     // main thread can move forward when it receives this signal from the handler.
     if (use_thread) {
-        io_service_.post(boost::bind(&TestServerUnixSocket::signalRunning,
-                                     this));
+        io_service_.post(std::bind(&TestServerUnixSocket::signalRunning,
+                                   this));
     }
 }
 
@@ -293,8 +292,8 @@ TestServerUnixSocket::acceptHandler(const boost::system::error_code& ec) {
 void
 TestServerUnixSocket::accept() {
     server_acceptor_.async_accept(*(connection_pool_->getSocket()),
-        boost::bind(&TestServerUnixSocket::acceptHandler, this,
-                    boost::asio::placeholders::error));
+        std::bind(&TestServerUnixSocket::acceptHandler, this,
+                  std::placeholders::_1)); // error
 }
 
 void
index d5aec7575aabc7c2146f51cd3e7e51fccfad2d76..c272ee7ce492329bdececa9f3e888f56db6fc630 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -43,7 +43,7 @@ class ConnectionPool;
 /// using @ref TestServerUnixSocket::getResponseNum.
 ///
 /// This class uses @c shared_from_this() to pass its instance to the
-/// @c boost::bind function, thus the caller must store shared pointer
+/// @c std::bind function, thus the caller must store shared pointer
 /// to this object.
 class TestServerUnixSocket {
 public:
index d32684f0679a9fb579b43eb7d6affb9263cd8025..f59e68a553afec3a81b5f46c6e894a090eddd231 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -8,10 +8,11 @@
 
 #include <asiolink/asio_wrapper.h>
 #include <asiolink/unix_domain_socket.h>
-#include <boost/bind.hpp>
 #include <boost/enable_shared_from_this.hpp>
+#include <functional>
 #include <iostream>
 using namespace boost::asio::local;
+using namespace std::placeholders;
 
 namespace isc {
 namespace asiolink {
@@ -164,8 +165,9 @@ public:
 void
 UnixDomainSocketImpl::asyncConnect(const stream_protocol::endpoint& endpoint,
                                    const UnixDomainSocket::ConnectHandler& handler) {
-    auto local_handler = boost::bind(&UnixDomainSocketImpl::connectHandler, shared_from_this(),
-                                     handler, _1);
+    auto local_handler = std::bind(&UnixDomainSocketImpl::connectHandler,
+                                   shared_from_this(),
+                                   handler, _1);
     socket_.async_connect(endpoint, local_handler);
 }
 
@@ -193,8 +195,9 @@ UnixDomainSocketImpl::asyncSend(const void* data, const size_t length,
 void
 UnixDomainSocketImpl::doSend(const boost::asio::const_buffers_1& buffer,
                              const UnixDomainSocket::Handler& handler) {
-    auto local_handler = boost::bind(&UnixDomainSocketImpl::sendHandler, shared_from_this(),
-                                     handler, buffer, _1, _2);
+    auto local_handler = std::bind(&UnixDomainSocketImpl::sendHandler,
+                                   shared_from_this(),
+                                   handler, buffer, _1, _2);
     socket_.async_send(buffer, local_handler);
 }
 
@@ -225,8 +228,9 @@ UnixDomainSocketImpl::asyncReceive(void* data, const size_t length,
 void
 UnixDomainSocketImpl::doReceive(const boost::asio::mutable_buffers_1& buffer,
                                 const UnixDomainSocket::Handler& handler) {
-    auto local_handler = boost::bind(&UnixDomainSocketImpl::receiveHandler, shared_from_this(),
-                                     handler, buffer, _1, _2);
+    auto local_handler = std::bind(&UnixDomainSocketImpl::receiveHandler,
+                                   shared_from_this(),
+                                   handler, buffer, _1, _2);
     socket_.async_receive(buffer, 0, local_handler);
 }
 
index a092e7b38d279613b933c3fe485a704c7413e5bc..d1f2e8ef1b65797fbdc43ff5bd78787d9170ac1c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -8,7 +8,7 @@
 
 #include <cc/data.h>
 #include <cc/json_feed.h>
-#include <boost/bind.hpp>
+#include <functional>
 
 using namespace isc::data;
 using namespace isc::util;
@@ -135,17 +135,17 @@ JSONFeed::defineStates() {
     StateModel::defineStates();
 
     defineState(RECEIVE_START_ST, "RECEIVE_START_ST",
-                boost::bind(&JSONFeed::receiveStartHandler, this));
+                std::bind(&JSONFeed::receiveStartHandler, this));
     defineState(WHITESPACE_BEFORE_JSON_ST, "WHITESPACE_BEFORE_JSON_ST",
-                boost::bind(&JSONFeed::whiteSpaceBeforeJSONHandler, this));
+                std::bind(&JSONFeed::whiteSpaceBeforeJSONHandler, this));
     defineState(INNER_JSON_ST, "INNER_JSON_ST",
-                boost::bind(&JSONFeed::innerJSONHandler, this));
+                std::bind(&JSONFeed::innerJSONHandler, this));
     defineState(STRING_JSON_ST, "STRING_JSON_ST",
-                boost::bind(&JSONFeed::stringJSONHandler, this));
+                std::bind(&JSONFeed::stringJSONHandler, this));
     defineState(ESCAPE_JSON_ST, "ESCAPE_JSON_ST",
-                boost::bind(&JSONFeed::escapeJSONHandler, this));
+                std::bind(&JSONFeed::escapeJSONHandler, this));
     defineState(JSON_END_ST, "JSON_END_ST",
-                boost::bind(&JSONFeed::endJSONHandler, this));
+                std::bind(&JSONFeed::endJSONHandler, this));
 }
 
 void
index 17d058a8049b336ded2b74db2f6169c416152d6c..324c2397280334a71017986aa983fee77c031d6b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 #include <config/config_log.h>
 #include <hooks/callout_handle.h>
 #include <hooks/hooks_manager.h>
-#include <boost/bind.hpp>
+#include <functional>
 
 using namespace isc::data;
 using namespace isc::hooks;
+using namespace std::placeholders;
 
 namespace {
 
@@ -40,8 +41,8 @@ namespace isc {
 namespace config {
 
 BaseCommandMgr::BaseCommandMgr() {
-    registerCommand("list-commands", boost::bind(&BaseCommandMgr::listCommandsHandler,
-                                                 this, _1, _2));
+    registerCommand("list-commands", std::bind(&BaseCommandMgr::listCommandsHandler,
+                                               this, _1, _2));
 }
 
 void
@@ -107,7 +108,7 @@ BaseCommandMgr::deregisterAll() {
     // code, just in tests.
     handlers_.clear();
     registerCommand("list-commands",
-        boost::bind(&BaseCommandMgr::listCommandsHandler, this, _1, _2));
+        std::bind(&BaseCommandMgr::listCommandsHandler, this, _1, _2));
 }
 
 isc::data::ConstElementPtr
index dd4ee153da432a883a42b45347d7bc8567a41381..88a30996301cfa7ab8cfd06cb6dc5961785c2cec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -9,7 +9,7 @@
 
 #include <cc/data.h>
 #include <exceptions/exceptions.h>
-#include <boost/function.hpp>
+#include <functional>
 #include <map>
 #include <string>
 
@@ -79,7 +79,7 @@ public:
     /// @param name name of the commands
     /// @param params parameters specific to the command
     /// @return response (created with createAnswer())
-    typedef boost::function<isc::data::ConstElementPtr (const std::string& name,
+    typedef std::function<isc::data::ConstElementPtr (const std::string& name,
         const isc::data::ConstElementPtr& params)> CommandHandler;
 
     /// @brief Defines extended command handler type.
@@ -92,7 +92,7 @@ public:
     /// @param params parameters specific to the command
     /// @param original original control command.
     /// @return response (created with createAnswer())
-    typedef boost::function<isc::data::ConstElementPtr (const std::string& name,
+    typedef std::function<isc::data::ConstElementPtr (const std::string& name,
         const isc::data::ConstElementPtr& params,
         const isc::data::ConstElementPtr& original)> ExtendedCommandHandler;
 
index a22442295ef773bb8f7cc3be78d98466cf8a60c7..6217c1aae131234d53208a3be709e4969a064935 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -11,9 +11,9 @@
 #include <asiolink/unix_domain_socket.h>
 #include <cc/json_feed.h>
 #include <config/client_connection.h>
-#include <boost/bind.hpp>
 #include <boost/enable_shared_from_this.hpp>
 #include <array>
+#include <functional>
 
 using namespace isc::asiolink;
 
@@ -123,8 +123,8 @@ ClientConnectionImpl::ClientConnectionImpl(IOService& io_service)
 void
 ClientConnectionImpl::scheduleTimer(ClientConnection::Handler handler) {
     if (timeout_ > 0) {
-        timer_.setup(boost::bind(&ClientConnectionImpl::timeoutCallback,
-                                 this, handler),
+        timer_.setup(std::bind(&ClientConnectionImpl::timeoutCallback,
+                               this, handler),
                      timeout_, IntervalTimer::ONE_SHOT);
     }
 }
index 945b198c245f3b2aae12da88735bafdf9d4c62cc..34f76103bc4904cb23a62efefe7cea430d259f33 100644 (file)
@@ -20,9 +20,9 @@
 #include <config/config_log.h>
 #include <config/timeouts.h>
 #include <util/watch_socket.h>
-#include <boost/bind.hpp>
 #include <boost/enable_shared_from_this.hpp>
 #include <array>
+#include <functional>
 #include <unistd.h>
 #include <sys/file.h>
 
@@ -30,6 +30,7 @@ using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::config;
 using namespace isc::data;
+using namespace std::placeholders;
 
 namespace {
 
@@ -94,7 +95,7 @@ public:
 
     /// @brief This method schedules timer or reschedules existing timer.
     void scheduleTimer() {
-        timeout_timer_.setup(boost::bind(&Connection::timeoutHandler, this),
+        timeout_timer_.setup(std::bind(&Connection::timeoutHandler, this),
                              timeout_, IntervalTimer::ONE_SHOT);
     }
 
@@ -137,8 +138,8 @@ public:
     /// process received data.
     void doReceive() {
         socket_->asyncReceive(&buf_[0], sizeof(buf_),
-                              boost::bind(&Connection::receiveHandler,
-                                          shared_from_this(), _1, _2));
+                              std::bind(&Connection::receiveHandler,
+                                        shared_from_this(), _1, _2));
     }
 
     /// @brief Starts asynchronous send over the unix domain socket.
@@ -151,7 +152,7 @@ public:
     void doSend() {
         size_t chunk_size = (response_.size() < BUF_SIZE) ? response_.size() : BUF_SIZE;
         socket_->asyncSend(&response_[0], chunk_size,
-           boost::bind(&Connection::sendHandler, shared_from_this(), _1, _2));
+           std::bind(&Connection::sendHandler, shared_from_this(), _1, _2));
 
         // Asynchronous send has been scheduled and we need to indicate this
         // to break the synchronous select(). The handler should clear this
index 4c093532ebe6ee55bb594d1481286c3482ad7c70..990dc08c6dc061236ca10c96e1840d4e15ff004c 100644 (file)
@@ -9,9 +9,9 @@
 
 #include <cc/data.h>
 #include <boost/noncopyable.hpp>
-#include <boost/function.hpp>
 #include <boost/shared_ptr.hpp>
 #include <exceptions/exceptions.h>
+#include <functional>
 #include <map>
 #include <string>
 
@@ -220,7 +220,7 @@ public:
     bool configuredReadOnly() const;
 
     /// @brief Defines a callback prototype for propogating events upward
-    typedef boost::function<bool (ReconnectCtlPtr db_retry)> DbLostCallback;
+    typedef std::function<bool (ReconnectCtlPtr db_retry)> DbLostCallback;
 
     /// @brief Invokes the connection's lost connectivity callback
     ///
index 68bc500998f1039912fc4fc09af3e7bc1621052a..2d5db619d887ff0190a1cd2d5c27b1bab7d22b04 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -12,7 +12,7 @@
 #include <exceptions/exceptions.h>
 #include <gtest/gtest.h>
 
-#include <boost/bind.hpp>
+#include <functional>
 
 using namespace isc::data;
 using namespace isc::db;
@@ -84,6 +84,7 @@ TEST_F(DatabaseConnectionCallbackTest, NoDbLostCallback) {
 TEST_F(DatabaseConnectionCallbackTest, dbLostCallback) {
     /// Create a Database configuration that includes the reconnect
     /// control parameters.
+    using namespace std::placeholders;
     DatabaseConnection::ParameterMap pmap;
     pmap[std::string("type")] = std::string("test");
     pmap[std::string("max-reconnect-tries")] = std::string("3");
@@ -91,7 +92,7 @@ TEST_F(DatabaseConnectionCallbackTest, dbLostCallback) {
 
     /// Install the callback.
     DatabaseConnection::db_lost_callback =
-        boost::bind(&DatabaseConnectionCallbackTest::dbLostCallback, this, _1);
+        std::bind(&DatabaseConnectionCallbackTest::dbLostCallback, this, _1);
     /// Create the connection..
     DatabaseConnection datasrc(pmap);
 
index d9c6cc7523522ed3e4ae92145c9931f3ab842c2a..99f4370398912fdb81411cdda8994e212b83a804 100644 (file)
 #include <util/multi_threading_mgr.h>
 
 #include <boost/scoped_ptr.hpp>
-#include <boost/bind.hpp>
 
 #include <cstring>
 #include <errno.h>
 #include <fstream>
+#include <functional>
 #include <limits>
 #include <sstream>
 
@@ -749,7 +749,7 @@ IfaceMgr::startDHCPReceiver(const uint16_t family) {
         }
 
         dhcp_receiver_.reset(new WatchedThread());
-        dhcp_receiver_->start(boost::bind(&IfaceMgr::receiveDHCP4Packets, this));
+        dhcp_receiver_->start(std::bind(&IfaceMgr::receiveDHCP4Packets, this));
         break;
     case AF_INET6:
         // If the queue doesn't exist, packet queing has been configured
@@ -759,7 +759,7 @@ IfaceMgr::startDHCPReceiver(const uint16_t family) {
         }
 
         dhcp_receiver_.reset(new WatchedThread());
-        dhcp_receiver_->start(boost::bind(&IfaceMgr::receiveDHCP6Packets, this));
+        dhcp_receiver_->start(std::bind(&IfaceMgr::receiveDHCP6Packets, this));
         break;
     default:
         isc_throw (BadValue, "startDHCPReceiver: invalid family: " << family);
index 5c6a47df947eb33b3d5b9cceb1d3b5d895013070..4e72f474633dcdfdcce2fbb63250b24118dc9469 100644 (file)
@@ -20,7 +20,6 @@
 #include <util/watch_socket.h>
 #include <util/watched_thread.h>
 
-#include <boost/function.hpp>
 #include <boost/multi_index/hashed_index.hpp>
 #include <boost/multi_index/mem_fun.hpp>
 #include <boost/multi_index/sequenced_index.hpp>
@@ -29,6 +28,7 @@
 #include <boost/scoped_array.hpp>
 #include <boost/shared_ptr.hpp>
 
+#include <functional>
 #include <list>
 #include <vector>
 #include <mutex>
@@ -621,7 +621,7 @@ typedef boost::shared_ptr<IfaceMgr> IfaceMgrPtr;
 ///
 /// @param errmsg An error message.
 typedef
-boost::function<void(const std::string& errmsg)> IfaceMgrErrorMsgCallback;
+std::function<void(const std::string& errmsg)> IfaceMgrErrorMsgCallback;
 
 /// @brief Handles network interfaces, transmission and reception.
 ///
@@ -633,7 +633,7 @@ class IfaceMgr : public boost::noncopyable {
 public:
     /// Defines callback used when data is received over external sockets.
     /// @param fd socket descriptor of the ready socket
-    typedef boost::function<void (int fd)> SocketCallback;
+    typedef std::function<void (int fd)> SocketCallback;
 
     /// Keeps callback information for external sockets.
     struct SocketCallbackInfo {
index 22fa697e1cd45e24fca02a84868a4f5f0e82bf97..dcd6bcbae2495442d1b4fa31c72ee676e0b7ea3a 100644 (file)
 #include <dhcp/tests/packet_queue_testutils.h>
 #include <testutils/gtest_utils.h>
 
-#include <boost/bind.hpp>
 #include <boost/foreach.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <gtest/gtest.h>
 
 #include <fcntl.h>
 #include <fstream>
+#include <functional>
 #include <iostream>
 #include <sstream>
 
@@ -31,6 +31,7 @@
 #include <unistd.h>
 
 using namespace std;
+using namespace std::placeholders;
 using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::dhcp;
@@ -1853,7 +1854,7 @@ TEST_F(IfaceMgrTest, openSockets4IfaceDown) {
     // should be called when the IfaceMgr fails to open socket on an interface
     // on which the server is configured to listen.
     isc::dhcp::IfaceMgrErrorMsgCallback error_handler =
-        boost::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, _1);
+        std::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, _1);
 
     ASSERT_NO_THROW(IfaceMgr::instance().openSockets4(DHCP4_SERVER_PORT, true,
                                                       error_handler));
@@ -1956,7 +1957,7 @@ TEST_F(IfaceMgrTest, openSocket4ErrorHandler) {
     // Install an error handler before trying to open sockets. This handler
     // should be called when the IfaceMgr fails to open socket on eth0.
     isc::dhcp::IfaceMgrErrorMsgCallback error_handler =
-        boost::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, _1);
+        std::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, _1);
     // The openSockets4 should detect that there is another socket already
     // open and bound to the same address and port. An attempt to open
     // another socket and bind to this address and port should fail.
@@ -2296,7 +2297,7 @@ TEST_F(IfaceMgrTest, openSockets6IfaceDown) {
     // Install an error handler before trying to open sockets. This handler
     // should be called when the IfaceMgr fails to open socket on eth0.
     isc::dhcp::IfaceMgrErrorMsgCallback error_handler =
-        boost::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, _1);
+        std::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, _1);
 
     // Simulate opening sockets using the dummy packet filter.
     bool success = false;
@@ -2423,7 +2424,7 @@ TEST_F(IfaceMgrTest, openSocket6ErrorHandler) {
     // Install an error handler before trying to open sockets. This handler
     // should be called when the IfaceMgr fails to open socket on eth0.
     isc::dhcp::IfaceMgrErrorMsgCallback error_handler =
-        boost::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, _1);
+        std::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, _1);
     // The openSockets6 should detect that a socket has been already
     // opened on eth0 and an attempt to open another socket and bind to
     // the same address and port should fail.
index b47ca1c2af6229c64fc2be9cda7db83378db5a22..b0ee2ac5e8ddd60d7718c4f50af318006117460a 100644 (file)
@@ -9,7 +9,7 @@
 #include <dhcp_ddns/dhcp_ddns_log.h>
 #include <dhcp_ddns/ncr_udp.h>
 
-#include <boost/bind.hpp>
+#include <functional>
 
 namespace isc {
 namespace dhcp_ddns {
@@ -19,7 +19,7 @@ UDPCallback::UDPCallback (RawBufferPtr& buffer, const size_t buf_size,
                           UDPEndpointPtr& data_source,
                           const UDPCompletionHandler& handler)
     : handler_(handler), data_(new Data(buffer, buf_size, data_source)) {
-    if (handler.empty()) {
+    if (!handler) {
         isc_throw(NcrUDPError, "UDPCallback - handler can't be null");
     }
 
@@ -70,11 +70,12 @@ NameChangeUDPListener(const isc::asiolink::IOAddress& ip_address,
     // Instantiate the receive callback.  This gets passed into each receive.
     // Note that the callback constructor is passed an instance method
     // pointer to our completion handler method, receiveCompletionHandler.
+    using namespace std::placeholders;
     RawBufferPtr buffer(new uint8_t[RECV_BUF_MAX]);
     UDPEndpointPtr data_source(new asiolink::UDPEndpoint());
     recv_callback_.reset(new
                          UDPCallback(buffer, RECV_BUF_MAX, data_source,
-                                     boost::bind(&NameChangeUDPListener::
+                                     std::bind(&NameChangeUDPListener::
                                      receiveCompletionHandler, this, _1, _2)));
 }
 
@@ -205,10 +206,11 @@ NameChangeUDPSender(const isc::asiolink::IOAddress& ip_address,
     // Instantiate the send callback.  This gets passed into each send.
     // Note that the callback constructor is passed the an instance method
     // pointer to our completion handler, sendCompletionHandler.
+    using namespace std::placeholders;
     RawBufferPtr buffer(new uint8_t[SEND_BUF_MAX]);
     UDPEndpointPtr data_source(new asiolink::UDPEndpoint());
     send_callback_.reset(new UDPCallback(buffer, SEND_BUF_MAX, data_source,
-                                         boost::bind(&NameChangeUDPSender::
+                                         std::bind(&NameChangeUDPSender::
                                          sendCompletionHandler, this,
                                          _1, _2)));
 }
index 155b0480ecc9b7c4b8c7252b6c3d5db1028b8fbc..01284aff7e256bab3da96628081fc2f62c368bb1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -127,7 +127,7 @@ public:
 
 class UDPCallback;
 /// @brief Defines a function pointer for NameChangeRequest completion handlers.
-typedef boost::function<void(const bool, const UDPCallback*)>
+typedef std::function<void(const bool, const UDPCallback*)>
           UDPCompletionHandler;
 
 /// @brief Defines a dynamically allocated shared array.
index 29b207bc68bcce49221b9e28f0b28a32e44431f8..f910d5eada1d20b62010f6433059049e3c928d83 100644 (file)
@@ -16,9 +16,8 @@
 #include <test_utils.h>
 
 #include <boost/asio/ip/udp.hpp>
-#include <boost/function.hpp>
-#include <boost/bind.hpp>
 
+#include <functional>
 #include <algorithm>
 
 #include <sys/select.h>
@@ -173,8 +172,8 @@ public:
                                               FMT_JSON, *this, true));
 
         // Set the test timeout to break any running tasks if they hang.
-        test_timer_.setup(boost::bind(&NameChangeUDPListenerTest::
-                                      testTimeoutHandler, this),
+        test_timer_.setup(std::bind(&NameChangeUDPListenerTest::
+                                    testTimeoutHandler, this),
                           TEST_TIMEOUT);
     }
 
@@ -978,8 +977,8 @@ public:
                                      FMT_JSON, *this, 100, true));
 
         // Set the test timeout to break any running tasks if they hang.
-        test_timer_.setup(boost::bind(&NameChangeUDPTest::testTimeoutHandler,
-                                      this),
+        test_timer_.setup(std::bind(&NameChangeUDPTest::testTimeoutHandler,
+                                    this),
                           TEST_TIMEOUT);
         // Disble multi-threading
         MultiThreadingMgr::instance().setMode(false);
index 9962d101252b047c1fe76fa3a272529f90b567ae..e1c3e69aea1642865725b459769bd1016e560359 100644 (file)
@@ -43,7 +43,6 @@
 #include <utility>
 #include <vector>
 
-
 using namespace isc::asiolink;
 using namespace isc::dhcp;
 using namespace isc::dhcp_ddns;
@@ -51,6 +50,7 @@ using namespace isc::hooks;
 using namespace isc::stats;
 using namespace isc::util;
 using namespace isc::data;
+using namespace std::placeholders;
 
 namespace {
 
@@ -2596,8 +2596,8 @@ AllocEngine::reclaimExpiredLease(const Lease6Ptr& lease,
             // expired-reclaimed state or simply remove it.
             LeaseMgr& lease_mgr = LeaseMgrFactory::instance();
             reclaimLeaseInDatabase<Lease6Ptr>(lease, remove_lease,
-                                              boost::bind(&LeaseMgr::updateLease6,
-                                                          &lease_mgr, _1));
+                                              std::bind(&LeaseMgr::updateLease6,
+                                                        &lease_mgr, _1));
         }
     }
 
@@ -2692,8 +2692,8 @@ AllocEngine::reclaimExpiredLease(const Lease4Ptr& lease,
             // expired-reclaimed state or simply remove it.
             LeaseMgr& lease_mgr = LeaseMgrFactory::instance();
             reclaimLeaseInDatabase<Lease4Ptr>(lease, remove_lease,
-                                              boost::bind(&LeaseMgr::updateLease4,
-                                                          &lease_mgr, _1));
+                                              std::bind(&LeaseMgr::updateLease4,
+                                                        &lease_mgr, _1));
         }
     }
 
@@ -2849,7 +2849,7 @@ AllocEngine::reclaimDeclined(const Lease6Ptr& lease) {
 template<typename LeasePtrType>
 void AllocEngine::reclaimLeaseInDatabase(const LeasePtrType& lease,
                                          const bool remove_lease,
-                                         const boost::function<void (const LeasePtrType&)>&
+                                         const std::function<void (const LeasePtrType&)>&
                                          lease_update_fun) const {
 
     LeaseMgr& lease_mgr = LeaseMgrFactory::instance();
@@ -2858,7 +2858,7 @@ void AllocEngine::reclaimLeaseInDatabase(const LeasePtrType& lease,
     // expired-reclaimed state or simply remove it.
     if (remove_lease) {
         lease_mgr.deleteLease(lease);
-    } else if (!lease_update_fun.empty()) {
+    } else if (lease_update_fun) {
         // Clear FQDN information as we have already sent the
         // name change request to remove the DNS record.
         lease->hostname_.clear();
index 54816a5a94b352e3f8ecfda81d10b9440c9e3bd4..43f6ca4b68f4952a3a379e69ce43073ee8a8420a 100644 (file)
 #include <util/multi_threading_mgr.h>
 #include <util/readwrite_mutex.h>
 
-#include <boost/function.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/noncopyable.hpp>
 
+#include <functional>
 #include <list>
 #include <map>
 #include <mutex>
@@ -1268,7 +1268,7 @@ private:
     template<typename LeasePtrType>
     void reclaimLeaseInDatabase(const LeasePtrType& lease,
                                 const bool remove_lease,
-                                const boost::function<void (const LeasePtrType&)>&
+                                const std::function<void (const LeasePtrType&)>&
                                 lease_update_fun) const;
 
     /// @anchor reclaimDeclinedLease4
index de13d485c7f98315c7c194321ca27bf76e362106..76d1b4514bd68ddefbbadade115cc6c52ef885cd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015,2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -10,8 +10,8 @@
 #include <asiolink/interval_timer.h>
 #include <cc/cfg_to_element.h>
 #include <dhcpsrv/timer_mgr.h>
-#include <boost/bind.hpp>
 #include <boost/shared_ptr.hpp>
+#include <functional>
 #include <stdint.h>
 #include <string>
 
@@ -303,11 +303,11 @@ CfgExpiration::setupTimers(void (Instance::*reclaim_fun)(const size_t,
             1000 * getReclaimTimerWaitTime();
         // Register timer for leases' reclamation routine.
         timer_mgr_->registerTimer(RECLAIM_EXPIRED_TIMER_NAME,
-                                  boost::bind(reclaim_fun, instance_ptr,
-                                              getMaxReclaimLeases(),
-                                              getMaxReclaimTime(),
-                                              flush_timer_disabled,
-                                              getUnwarnedReclaimCycles()),
+                                  std::bind(reclaim_fun, instance_ptr,
+                                            getMaxReclaimLeases(),
+                                            getMaxReclaimTime(),
+                                            flush_timer_disabled,
+                                            getUnwarnedReclaimCycles()),
                                   reclaim_interval,
                                   asiolink::IntervalTimer::ONE_SHOT);
         timer_mgr_->setup(RECLAIM_EXPIRED_TIMER_NAME);
@@ -323,8 +323,8 @@ CfgExpiration::setupTimers(void (Instance::*reclaim_fun)(const size_t,
             1000 * getFlushReclaimedTimerWaitTime();
         // Register and setup the timer.
         timer_mgr_->registerTimer(FLUSH_RECLAIMED_TIMER_NAME,
-                                  boost::bind(delete_fun, instance_ptr,
-                                              getHoldReclaimedTime()),
+                                  std::bind(delete_fun, instance_ptr,
+                                            getHoldReclaimedTime()),
                                   flush_interval,
                                   asiolink::IntervalTimer::ONE_SHOT);
         timer_mgr_->setup(FLUSH_RECLAIMED_TIMER_NAME);
index ea137ca04162446341dd9ca090fcfeb1a196c970..68a2f0e8682b9e05fb65b6f1ccda9195f8760d8b 100644 (file)
@@ -9,11 +9,12 @@
 #include <dhcpsrv/dhcpsrv_log.h>
 #include <dhcpsrv/cfg_iface.h>
 #include <util/strutil.h>
-#include <boost/bind.hpp>
 #include <algorithm>
+#include <functional>
 
 using namespace isc::asiolink;
 using namespace isc::data;
+using namespace std::placeholders;
 
 namespace isc {
 namespace dhcp {
@@ -151,7 +152,7 @@ CfgIface::openSockets(const uint16_t family, const uint16_t port,
     // for some specific interface. This callback will simply log a
     // warning message.
     IfaceMgrErrorMsgCallback error_callback =
-        boost::bind(&CfgIface::socketOpenErrorHandler, _1);
+        std::bind(&CfgIface::socketOpenErrorHandler, _1);
     bool sopen;
     if (family == AF_INET) {
         // Use broadcast only if we're using raw sockets. For the UDP sockets,
index b365c78b1bd70d0281c8f7f5e3a5ebff69669d3f..667147130965e5f711ee473f3972c635b06386d3 100644 (file)
@@ -11,8 +11,7 @@
 #include <dhcpsrv/d2_client_mgr.h>
 #include <dhcpsrv/dhcpsrv_log.h>
 
-#include <boost/bind.hpp>
-
+#include <functional>
 #include <string>
 
 using namespace std;
@@ -259,8 +258,8 @@ D2ClientMgr::startSender(D2ClientErrorHandler error_handler,
     // IO error handling in the sender may alter its select-fd.
     registered_select_fd_ = name_change_sender_->getSelectFd();
     IfaceMgr::instance().addExternalSocket(registered_select_fd_,
-                                           boost::bind(&D2ClientMgr::runReadyIO,
-                                                       this));
+                                           std::bind(&D2ClientMgr::runReadyIO,
+                                                     this));
 }
 
 bool
index 273c8bdbd602e1edddcb561b5f0b836da6ecef83..4500e2b3191f0fa3f79599e139de23f30b43cf9e 100644 (file)
@@ -40,8 +40,8 @@ namespace dhcp {
 /// @note Handlers are expected not to throw. In the event a handler does
 /// throw invoking code logs the exception and then swallows it.
 typedef
-boost::function<void(const dhcp_ddns::NameChangeSender::Result result,
-                     dhcp_ddns::NameChangeRequestPtr& ncr)> D2ClientErrorHandler;
+std::function<void(const dhcp_ddns::NameChangeSender::Result result,
+                   dhcp_ddns::NameChangeRequestPtr& ncr)> D2ClientErrorHandler;
 
 /// @brief D2ClientMgr isolates Kea from the details of being a D2 client.
 ///
@@ -375,7 +375,7 @@ public:
     ///
     /// Serves as callback registered for the sender's select-fd with IfaceMgr.
     /// It instructs the sender to execute the next ready IO handler.
-    /// It provides an instance method that can be bound via boost::bind, as
+    /// It provides an instance method that can be bound via std::bind, as
     /// NameChangeSender is abstract.
     void runReadyIO();
 
index 113f5f944dfddd0a10742166d53284b04717d496..b39ad954e49d97759ef4d488904dfb90b6678d2e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -11,8 +11,8 @@
 #include <dhcpsrv/base_host_data_source.h>
 #include <exceptions/exceptions.h>
 #include <boost/scoped_ptr.hpp>
-#include <boost/function.hpp>
 
+#include <functional>
 #include <string>
 #include <vector>
 #include <map>
@@ -79,7 +79,7 @@ public:
     ///
     /// A factory takes a parameter map and returns a pointer to a host
     /// data source. In case of failure it must throw and not return NULL.
-    typedef boost::function<HostDataSourcePtr (const db::DatabaseConnection::ParameterMap&)> Factory;
+    typedef std::function<HostDataSourcePtr (const db::DatabaseConnection::ParameterMap&)> Factory;
 
     /// @brief Register a host data source factory
     ///
index 7272baa00ae27d808a010102afde169ce1fd5755..801d4fe82fe92df9ecd49b70610b0a79148012cb 100644 (file)
@@ -1864,7 +1864,7 @@ Memfile_LeaseMgr::lfcSetup(bool conversion_needed) {
     }
 
     if (lfc_interval > 0 || conversion_needed) {
-        lfc_setup_.reset(new LFCSetup(boost::bind(&Memfile_LeaseMgr::lfcCallback, this)));
+        lfc_setup_.reset(new LFCSetup(std::bind(&Memfile_LeaseMgr::lfcCallback, this)));
         lfc_setup_->setup(lfc_interval, lease_file4_, lease_file6_, conversion_needed);
     }
 }
index 16dbe2ba0bcee512a0553f7efb32730a742d7f97..a86a3465b5a4d0c8df3c900d514943092c4f31dd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -9,8 +9,8 @@
 #include <exceptions/exceptions.h>
 #include <dhcpsrv/network_state.h>
 #include <dhcpsrv/timer_mgr.h>
-#include <boost/bind.hpp>
 #include <boost/enable_shared_from_this.hpp>
+#include <functional>
 #include <string>
 
 namespace {
@@ -65,8 +65,8 @@ public:
     void createTimer(const unsigned int seconds) {
         destroyTimer();
         timer_mgr_->registerTimer(NETWORK_STATE_TIMER_NAME,
-                                  boost::bind(&NetworkStateImpl::enableAll,
-                                              shared_from_this()),
+                                  std::bind(&NetworkStateImpl::enableAll,
+                                            shared_from_this()),
                                   seconds * 1000,
                                   asiolink::IntervalTimer::ONE_SHOT);
         timer_mgr_->setup(NETWORK_STATE_TIMER_NAME);
index bcb5526b951100f930e624bf2756c7cfe86115eb..c3b4828afcfddf49a04b3479d20edfbbf8dd47dc 100644 (file)
@@ -13,9 +13,8 @@
 #include <hooks/hooks_manager.h>
 #include <stats/stats_mgr.h>
 #include <gtest/gtest.h>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
 #include <boost/static_assert.hpp>
+#include <functional>
 #include <iomanip>
 #include <sstream>
 #include <time.h>
@@ -23,6 +22,7 @@
 #include <vector>
 
 using namespace std;
+using namespace std::placeholders;
 using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::dhcp;
@@ -160,9 +160,9 @@ class ExpirationAllocEngineTest : public ::testing::Test {
 public:
 
     /// @brief Type definition for the lease algorithm.
-    typedef boost::function<bool (const LeasePtrType)> LeaseAlgorithmFun;
+    typedef std::function<bool (const LeasePtrType)> LeaseAlgorithmFun;
     /// @brief type definition for the lease index algorithm.
-    typedef boost::function<bool (const size_t)> IndexAlgorithmFun;
+    typedef std::function<bool (const size_t)> IndexAlgorithmFun;
 
     /// @brief Constructor.
     ///
@@ -232,7 +232,7 @@ public:
         D2ClientConfigPtr cfg(new D2ClientConfig());
         cfg->enableUpdates(true);
         mgr.setD2ClientConfig(cfg);
-        mgr.startSender(boost::bind(&ExpirationAllocEngineTest::d2ErrorHandler, _1, _2));
+        mgr.startSender(std::bind(&ExpirationAllocEngineTest::d2ErrorHandler, _1, _2));
     }
 
     /// @brief No-op error handler for the D2 client.
index 53468cd99aef764600d767f75ad65360bf7491b4..7567802a89a6b9d215660e3286c324deeed5cda3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015,2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -11,9 +11,9 @@
 #include <dhcpsrv/timer_mgr.h>
 #include <exceptions/exceptions.h>
 #include <testutils/test_to_element.h>
-#include <boost/function.hpp>
 #include <boost/shared_ptr.hpp>
 #include <gtest/gtest.h>
+#include <functional>
 #include <stdint.h>
 
 using namespace isc;
@@ -23,13 +23,13 @@ using namespace isc::dhcp;
 namespace {
 
 /// @brief Type definition of the @c CfgExpiration modified function.
-typedef boost::function<void(CfgExpiration*, const int64_t)> ModifierFun;
+typedef std::function<void(CfgExpiration*, const int64_t)> ModifierFun;
 /// @brief Type definition of the @c CfgExpiration accessor function
 /// returning uint16_t value.
-typedef boost::function<uint16_t(CfgExpiration*)> AccessorFunUint16;
+typedef std::function<uint16_t(CfgExpiration*)> AccessorFunUint16;
 /// @brief Type definition of the @c CfgExpiration accessor function
 /// returning uint32_t value.
-typedef boost::function<uint32_t(CfgExpiration*)> AccessorFunUint32;
+typedef std::function<uint32_t(CfgExpiration*)> AccessorFunUint32;
 
 /// @brief Tests the accessor and modifier function for a particular
 /// configuration parameter held in @c CfgExpiration.
@@ -50,7 +50,7 @@ typedef boost::function<uint32_t(CfgExpiration*)> AccessorFunUint32;
 template<typename ReturnType>
 void
 testAccessModify(const int64_t limit, const ModifierFun& modifier,
-                 const boost::function<ReturnType(CfgExpiration*)>& accessor) {
+                 const std::function<ReturnType(CfgExpiration*)>& accessor) {
     CfgExpiration cfg;
 
     // Setting the value to maximum allowed + 1 should result in
index 28139d14c4095e676a2ae710904f48c953908e64..47b96f5797595c07ae5637c218b4c12abcc999c4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 #include <dhcpsrv/d2_client_mgr.h>
 #include <exceptions/exceptions.h>
 
-#include <boost/function.hpp>
-#include <boost/bind.hpp>
 #include <gtest/gtest.h>
 
+#include <functional>
 #include <sys/select.h>
 
 using namespace std;
+using namespace std::placeholders;
 using namespace isc::dhcp;
 using namespace isc;
 
@@ -165,7 +165,7 @@ public:
 
     /// @brief Returns D2ClientErroHandler bound to this::error_handler_.
     D2ClientErrorHandler getErrorHandler() {
-        return (boost::bind(&D2ClientMgrTest::error_handler, this, _1, _2));
+        return (std::bind(&D2ClientMgrTest::error_handler, this, _1, _2));
     }
 
     /// @brief Constructs a NameChangeRequest message from a fixed JSON string.
index 8818bd53b093e6f22ae1e1ce158ae6cf5ac5245a..e3c9d010f6bf7a0ddf23ecc4632375e4ed18e5ba 100644 (file)
@@ -15,9 +15,8 @@
 #include <dhcp/option_int.h>
 #include <dhcpsrv/dhcp4o6_ipc.h>
 #include <dhcpsrv/testutils/dhcp4o6_test_ipc.h>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
 #include <gtest/gtest.h>
+#include <functional>
 #include <sstream>
 #include <string>
 
@@ -35,7 +34,7 @@ const uint16_t TEST_PORT = 12345;
 const uint16_t TEST_ITERATIONS = 10;
 
 /// @brief Type definition for the function creating DHCP message.
-typedef boost::function<Pkt6Ptr(uint16_t, uint16_t)> CreateMsgFun;
+typedef std::function<Pkt6Ptr(uint16_t, uint16_t)> CreateMsgFun;
 
 /// @brief Define short name for test IPC class.
 typedef Dhcp4o6TestIpc TestIpc;
index d5228e07b304329c82689785bd6c81a4e6add68c..fc2db6f4c11c79f4f72dad607ea73a11058cdc83 100644 (file)
@@ -26,6 +26,7 @@
 #include <sstream>
 
 using namespace std;
+using namespace std::placeholders;
 using namespace isc::asiolink;
 using namespace isc::data;
 using namespace isc::db;
@@ -3284,7 +3285,7 @@ LeaseMgrDbLostCallbackTest::TearDown() {
 void
 LeaseMgrDbLostCallbackTest::testNoCallbackOnOpenFailure() {
     DatabaseConnection::db_lost_callback =
-        boost::bind(&LeaseMgrDbLostCallbackTest::db_lost_callback, this, _1);
+        std::bind(&LeaseMgrDbLostCallbackTest::db_lost_callback, this, _1);
 
     callback_called_ = false;
     ASSERT_THROW(LeaseMgrFactory::create(invalidConnectString()),
@@ -3297,7 +3298,7 @@ void
 LeaseMgrDbLostCallbackTest::testDbLostCallback() {
     // Set the connectivity lost callback.
     DatabaseConnection::db_lost_callback =
-        boost::bind(&LeaseMgrDbLostCallbackTest::db_lost_callback, this, _1);
+        std::bind(&LeaseMgrDbLostCallbackTest::db_lost_callback, this, _1);
 
     // Connect to the lease backend.
     ASSERT_NO_THROW(LeaseMgrFactory::create(validConnectString()));
index 6798af604f272b054a28fa3ec6122014737e7838..bcb67ac1447e4222b542248884383e9cfa382e9d 100644 (file)
@@ -33,6 +33,7 @@ using namespace isc::db;
 using namespace isc::dhcp;
 using namespace isc::dhcp::test;
 using namespace isc::asiolink;
+using namespace std::placeholders;
 
 namespace {
 
@@ -1131,7 +1132,7 @@ HostMgrDbLostCallbackTest::testDbLostCallback() {
 
     // Set the connectivity lost callback.
     DatabaseConnection::db_lost_callback =
-        boost::bind(&HostMgrDbLostCallbackTest::db_lost_callback, this, _1);
+        std::bind(&HostMgrDbLostCallbackTest::db_lost_callback, this, _1);
 
     // Find the most recently opened socket. Our SQL client's socket should
     // be the next one.
index b44aba1a305dfd1f8506a42956a52c2c01ad4205..06f956e6e01b9b8fc362ad054911f7f31848807d 100644 (file)
 #include <dhcpsrv/d2_client_mgr.h>
 #include <dhcpsrv/lease.h>
 
-#include <ctime>
-#include <boost/bind.hpp>
 #include <gtest/gtest.h>
-
+#include <ctime>
+#include <functional>
 #include <stdint.h>
 #include <string>
 
@@ -24,6 +23,7 @@ using namespace isc;
 using namespace isc::asiolink;
 using namespace isc::dhcp;
 using namespace isc::dhcp_ddns;
+using namespace std::placeholders;
 
 namespace {
 
@@ -81,8 +81,8 @@ public:
         D2ClientConfigPtr cfg(new D2ClientConfig());
         ASSERT_NO_THROW(cfg->enableUpdates(true));
         ASSERT_NO_THROW(CfgMgr::instance().setD2ClientConfig(cfg));
-        d2_mgr_.startSender(boost::bind(&NCRGeneratorTest::d2ErrorHandler, this,
-                                        _1, _2));
+        d2_mgr_.startSender(std::bind(&NCRGeneratorTest::d2ErrorHandler, this,
+                                      _1, _2));
     }
 
     /// @brief Disables DHCP-DDNS updates.
index 30933adc7ea945c1e6af5642d50830f498599978..879ead17d1bf2363c7a28504fe43d83a0539759e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -9,8 +9,8 @@
 #include <asiolink/io_service.h>
 #include <dhcpsrv/network_state.h>
 #include <dhcpsrv/timer_mgr.h>
-#include <boost/bind.hpp>
 #include <gtest/gtest.h>
+#include <functional>
 
 using namespace isc;
 using namespace isc::asiolink;
@@ -51,7 +51,9 @@ public:
     ///
     /// @param timeout_ms Timeout for running IO service in milliseconds.
     void runIOService(const long timeout_ms) {
-        test_timer_.setup(boost::bind(&NetworkStateTest::testTimerCallback, this), timeout_ms,
+        test_timer_.setup(std::bind(&NetworkStateTest::testTimerCallback,
+                                    this),
+                          timeout_ms,
                           IntervalTimer::ONE_SHOT);
         io_service_->run();
     }
index b6e6e940171c95a5b1b2f67c5b1392beca1f0265..bdcc27684d6dbf098059372634687a3b61a2946c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -11,9 +11,9 @@
 #include <dhcpsrv/timer_mgr.h>
 #include <exceptions/exceptions.h>
 
-#include <boost/bind.hpp>
 #include <gtest/gtest.h>
 
+#include <functional>
 #include <sstream>
 #include <unistd.h>
 
@@ -73,10 +73,10 @@ public:
     ///
     /// This is just a wrapped to make it a bit more convenient
     /// in the test.
-    boost::function<void ()> makeCallback(const std::string& timer_name);
+    std::function<void ()> makeCallback(const std::string& timer_name);
 
     /// @brief Create a callback which generates exception.
-    boost::function<void ()> makeCallbackWithException();
+    std::function<void ()> makeCallbackWithException();
 
     /// @brief Callback for timeout.
     ///
@@ -154,14 +154,14 @@ TimerMgrTest::timerCallbackWithException() {
     isc_throw(Exception, "timerCallbackWithException");
 }
 
-boost::function<void ()>
+std::function<void ()>
 TimerMgrTest::makeCallback(const std::string& timer_name) {
-    return (boost::bind(&TimerMgrTest::timerCallback, this, timer_name));
+    return (std::bind(&TimerMgrTest::timerCallback, this, timer_name));
 }
 
-boost::function<void ()>
+std::function<void ()>
 TimerMgrTest::makeCallbackWithException() {
-    return (boost::bind(&TimerMgrTest::timerCallbackWithException, this));
+    return (std::bind(&TimerMgrTest::timerCallbackWithException, this));
 }
 
 // This test checks that certain errors are returned when invalid
index 36a37efb4867eb114e70b18d3b20bb528daa72f9..a50a5c2e7c5f9bd525588d4aa705ded954abe161 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -7,7 +7,7 @@
 #include <config.h>
 #include <dhcp/iface_mgr.h>
 #include <dhcpsrv/testutils/dhcp4o6_test_ipc.h>
-#include <boost/bind.hpp>
+#include <functional>
 
 namespace isc {
 namespace dhcp {
@@ -27,7 +27,7 @@ Dhcp4o6TestIpc::open() {
     if (socket_fd_ != -1) {
         IfaceMgr& iface_mgr = IfaceMgr::instance();
         iface_mgr.addExternalSocket(socket_fd_,
-                boost::bind(&Dhcp4o6TestIpc::receiveHandler, this));
+                std::bind(&Dhcp4o6TestIpc::receiveHandler, this));
     }
 }
 
index 899116bf8b699a754389b8c9f5e3acc13968d382..c3eed89f8730337d22ee869836fe4d49cb005161 100644 (file)
@@ -11,8 +11,7 @@
 #include <dhcpsrv/timer_mgr.h>
 #include <exceptions/exceptions.h>
 
-#include <boost/bind.hpp>
-
+#include <functional>
 #include <utility>
 
 using namespace isc;
@@ -263,8 +262,8 @@ TimerMgrImpl::setup(const std::string& timer_name) {
    // Schedule the execution of the timer using the parameters supplied
    // during the registration.
    const TimerInfoPtr& timer_info = timer_info_it->second;
-   IntervalTimer::Callback cb = boost::bind(&TimerMgrImpl::timerCallback, this,
-                                            timer_name);
+   IntervalTimer::Callback cb = std::bind(&TimerMgrImpl::timerCallback, this,
+                                          timer_name);
    timer_info->interval_timer_.setup(cb, timer_info->interval_,
                                      timer_info->scheduling_mode_);
 }
index b664f3d350f41db7cb22577a8d615e586174d408..568fdea507bd77787d6742de5e75f186bb5a40ba 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -1019,7 +1019,7 @@ MasterLoader::MasterLoader(const char* master_file,
                            const AddRRCallback& add_callback,
                            Options options)
 {
-    if (add_callback.empty()) {
+    if (!add_callback) {
         isc_throw(isc::InvalidParameter, "Empty add RR callback");
     }
     impl_ = new MasterLoaderImpl(master_file, zone_origin,
@@ -1033,7 +1033,7 @@ MasterLoader::MasterLoader(std::istream& stream,
                            const AddRRCallback& add_callback,
                            Options options)
 {
-    if (add_callback.empty()) {
+    if (!add_callback) {
         isc_throw(isc::InvalidParameter, "Empty add RR callback");
     }
     unique_ptr<MasterLoaderImpl>
index 1b531790286194398be5ad17cacc9e804305d785..b5637414e5d03967fc27a894e0506080a4dc5760 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -9,9 +9,9 @@
 
 #include <exceptions/exceptions.h>
 
-#include <string>
-#include <boost/function.hpp>
 #include <boost/shared_ptr.hpp>
+#include <functional>
+#include <string>
 
 namespace isc {
 namespace dns {
@@ -35,9 +35,9 @@ typedef boost::shared_ptr<Rdata> RdataPtr;
 /// \param rrtype Type of the RR.
 /// \param rrttl Time to live of the RR.
 /// \param rdata The actual carried data of the RR.
-typedef boost::function<void(const Name& name, const RRClass& rrclass,
-                             const RRType& rrtype, const RRTTL& rrttl,
-                             const rdata::RdataPtr& rdata)>
+typedef std::function<void(const Name& name, const RRClass& rrclass,
+                           const RRType& rrtype, const RRTTL& rrttl,
+                           const rdata::RdataPtr& rdata)>
     AddRRCallback;
 
 /// \brief Set of issue callbacks for a loader.
@@ -58,9 +58,9 @@ public:
     /// \param source_line Position of the problem, counted in lines from the
     ///     beginning of the source.
     /// \param reason Human readable description of what happened.
-    typedef boost::function<void(const std::string& source_name,
-                                 size_t source_line,
-                                 const std::string& reason)> IssueCallback;
+    typedef std::function<void(const std::string& source_name,
+                               size_t source_line,
+                               const std::string& reason)> IssueCallback;
 
     /// \brief Constructor
     ///
@@ -74,7 +74,7 @@ public:
         error_(error),
         warning_(warning)
     {
-        if (error_.empty() || warning_.empty()) {
+        if (!error_ || !warning) {
             isc_throw(isc::InvalidParameter,
                       "Empty function passed as callback");
         }
index bbb95972728f69889a8f91d20e96f10610548b10..ef32ea2daeb5f7457598bb537a724a62351c03c1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2010-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -6,18 +6,6 @@
 
 #include <config.h>
 
-#include <istream>
-#include <fstream>
-#include <sstream>
-#include <string>
-#include <cctype>
-#include <cerrno>
-
-#include <boost/bind.hpp>
-#include <boost/scoped_ptr.hpp>
-
-#include <exceptions/exceptions.h>
-
 #include <dns/masterload.h>
 #include <dns/master_loader.h>
 #include <dns/name.h>
 #include <dns/rrttl.h>
 #include <dns/rrtype.h>
 #include <dns/rrcollator.h>
+#include <exceptions/exceptions.h>
+
+#include <boost/scoped_ptr.hpp>
+
+#include <functional>
+#include <istream>
+#include <fstream>
+#include <sstream>
+#include <string>
+#include <cctype>
+#include <cerrno>
 
 using namespace std;
-using namespace boost;
 using namespace isc::dns::rdata;
 
 namespace isc {
@@ -64,8 +62,8 @@ void
 loadHelper(InputType input, const Name& origin,
            const RRClass& zone_class, MasterLoadCallback callback)
 {
-    RRCollator rr_collator(boost::bind(callbackWrapper, _1,
-                                       callback, &origin));
+    RRCollator rr_collator(std::bind(callbackWrapper, std::placeholders::_1,
+                                     callback, &origin));
     MasterLoader loader(input, origin, zone_class,
                         MasterLoaderCallbacks::getNullCallbacks(),
                         rr_collator.getCallback());
index 30b0fa1d42b96394da4816eca3bd40fd92f09b9c..3762d54e47ea1eb4d72264fc785feb71a49e114f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2010-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -7,13 +7,11 @@
 #ifndef MASTERLOAD_H
 #define MASTERLOAD_H 1
 
-#include <iosfwd>
-
-#include <boost/function.hpp>
-
+#include <dns/rrset.h>
 #include <exceptions/exceptions.h>
 
-#include <dns/rrset.h>
+#include <functional>
+#include <iosfwd>
 
 namespace isc {
 namespace dns {
@@ -32,7 +30,7 @@ public:
 ///
 /// This represents a functor object or a function that takes one parameter
 /// of type \c RRsetPtr and returns nothing.
-typedef boost::function<void(RRsetPtr)> MasterLoadCallback;
+typedef std::function<void(RRsetPtr)> MasterLoadCallback;
 
 ///
 /// \name Master zone file loader functions.
@@ -48,7 +46,7 @@ typedef boost::function<void(RRsetPtr)> MasterLoadCallback;
 /// The \c callback parameter is a functor object or a function that
 /// takes one parameter of type \c RRsetPtr and returns nothing,
 /// i.e. \c void (see below for specific examples).
-/// More precisely, it can be anything that this form of boost::function
+/// More precisely, it can be anything that this form of std::function
 /// can represent, but the caller normally doesn't have to care about
 /// that level of details.
 ///
@@ -104,7 +102,7 @@ typedef boost::function<void(RRsetPtr)> MasterLoadCallback;
 ///    masterLoad(zone_file, Name("example.com"), RRClass::IN(), zoneDumper);
 /// \endcode
 /// Or, if you want to use it with a member function of some other class,
-/// wrapping things with \c boost::bind would be handy:
+/// wrapping things with \c std::bind would be handy:
 /// \code class ZoneDumper {
 /// public:
 ///    void dump(ConstRRsetPtr rrset) const {
@@ -114,7 +112,7 @@ typedef boost::function<void(RRsetPtr)> MasterLoadCallback;
 /// ...
 ///    ZoneDumper dumper;
 ///    masterLoad(rr_stream, Name("example.com"), RRClass::IN(),
-///               boost::bind(&ZoneDumper::dump, &dumper, _1));
+///               std::bind(&ZoneDumper::dump, &dumper, _1));
 /// \endcode
 /// You can find a bit more complicated examples in the unit tests code for
 /// this function.
index e2fa0e446016efbe42e9a6e6e47152e8a61dc94b..8d90b23bc654b0bf702c0f9b4b2e325d56b06180 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -19,9 +19,8 @@
 #include <dns/rdata.h>
 #include <dns/rrset.h>
 
-#include <boost/bind.hpp>
-
 #include <algorithm>
+#include <functional>
 
 namespace isc {
 namespace dns {
@@ -88,8 +87,9 @@ RRCollator::~RRCollator() {
 
 AddRRCallback
 RRCollator::getCallback() {
-    return (boost::bind(&RRCollator::Impl::addRR, this->impl_,
-                        _1, _2, _3, _4, _5));
+    using namespace std::placeholders;
+    return (std::bind(&RRCollator::Impl::addRR, this->impl_,
+                      _1, _2, _3, _4, _5));
 }
 
 void
index 6ada41ed9e52d776da4a1e16a481cd022edb02d6..9442fd39709f4d9a9da12ff2048f300f87d76c56 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -11,7 +11,7 @@
 #include <dns/rrset.h>
 
 #include <boost/noncopyable.hpp>
-#include <boost/function.hpp>
+#include <functional>
 
 namespace isc {
 namespace dns {
@@ -51,7 +51,7 @@ public:
     /// the \c RRCollator.
     ///
     /// \param rrset The collated RRset.
-    typedef boost::function<void(const RRsetPtr& rrset)> AddRRsetCallback;
+    typedef std::function<void(const RRsetPtr& rrset)> AddRRsetCallback;
 
     /// \brief Constructor.
     ///
index 54503044b0859faf48fcd9c63be218987f8d7c86..6760e07b22b3e60a8258eb1b3c311ce1d987c6f2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -13,7 +13,7 @@
 
 #include <exceptions/exceptions.h>
 
-#include <boost/bind.hpp>
+#include <functional>
 
 using namespace isc;
 
@@ -45,10 +45,11 @@ void
 RRsetCollection::constructHelper(T source, const isc::dns::Name& origin,
                                  const isc::dns::RRClass& rrclass)
 {
-    RRCollator collator(boost::bind(&RRsetCollection::addRRset, this, _1));
+    using namespace std::placeholders;
+    RRCollator collator(std::bind(&RRsetCollection::addRRset, this, _1));
     MasterLoaderCallbacks callbacks
-        (boost::bind(&RRsetCollection::loaderCallback, this, _1, _2, _3),
-         boost::bind(&RRsetCollection::loaderCallback, this, _1, _2, _3));
+        (std::bind(&RRsetCollection::loaderCallback, this, _1, _2, _3),
+         std::bind(&RRsetCollection::loaderCallback, this, _1, _2, _3));
     MasterLoader loader(source, origin, rrclass, callbacks,
                         collator.getCallback(),
                         MasterLoader::DEFAULT);
index e66f92857baa56dac80e2da890ca7a74bada4fc4..977e19b7257a0ad4acf234ff6a79032d352ae827 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 #include <exceptions/exceptions.h>
 
 #include <gtest/gtest.h>
-#include <boost/bind.hpp>
+#include <functional>
 
 namespace {
 
 using std::string;
 using namespace isc::dns;
+  using namespace std::placeholders;
 
 class MasterLoaderCallbacksTest : public ::testing::Test {
 protected:
@@ -29,10 +30,10 @@ protected:
         issue_called_(false),
         rrset_(new RRset(Name("example.org"), RRClass::IN(), RRType::A(),
                          RRTTL(3600))),
-        error_(boost::bind(&MasterLoaderCallbacksTest::checkCallback, this,
-                           true, _1, _2, _3)),
-        warning_(boost::bind(&MasterLoaderCallbacksTest::checkCallback, this,
-                             false, _1, _2, _3)),
+        error_(std::bind(&MasterLoaderCallbacksTest::checkCallback, this,
+                         true, _1, _2, _3)),
+        warning_(std::bind(&MasterLoaderCallbacksTest::checkCallback, this,
+                           false, _1, _2, _3)),
         callbacks_(error_, warning_)
     {}
 
index 6a7f95a1c9bf715faeace55c3384aefc15dd3fd2..57f6e0ca834baa89b723335706dd5a859f31ec7e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 
 #include <gtest/gtest.h>
 
-#include <boost/bind.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/scoped_ptr.hpp>
 
+#include <functional>
 #include <string>
 #include <vector>
 #include <list>
 #include <sstream>
 
 using namespace isc::dns;
+using namespace std::placeholders;
 using std::vector;
 using std::string;
 using std::list;
@@ -38,10 +39,10 @@ namespace {
 class MasterLoaderTest : public ::testing::Test {
 public:
     MasterLoaderTest() :
-        callbacks_(boost::bind(&MasterLoaderTest::callback, this,
-                               &errors_, _1, _2, _3),
-                   boost::bind(&MasterLoaderTest::callback, this,
-                               &warnings_, _1, _2, _3))
+        callbacks_(std::bind(&MasterLoaderTest::callback, this,
+                             &errors_, _1, _2, _3),
+                   std::bind(&MasterLoaderTest::callback, this,
+                             &warnings_, _1, _2, _3))
     {}
 
     void TearDown() {
@@ -71,8 +72,8 @@ public:
                    const RRClass& rrclass, const MasterLoader::Options options)
     {
         loader_.reset(new MasterLoader(file, origin, rrclass, callbacks_,
-                                       boost::bind(&MasterLoaderTest::addRRset,
-                                                   this, _1, _2, _3, _4, _5),
+                                       std::bind(&MasterLoaderTest::addRRset,
+                                                 this, _1, _2, _3, _4, _5),
                                        options));
     }
 
@@ -80,8 +81,8 @@ public:
                    const RRClass& rrclass, const MasterLoader::Options options)
     {
         loader_.reset(new MasterLoader(stream, origin, rrclass, callbacks_,
-                                       boost::bind(&MasterLoaderTest::addRRset,
-                                                   this, _1, _2, _3, _4, _5),
+                                       std::bind(&MasterLoaderTest::addRRset,
+                                                 this, _1, _2, _3, _4, _5),
                                        options));
     }
 
index 90c6a275917b372e118fb55581f09e3580a6ea8e..52fc989e619c11a46003cabdeffdf74099bb8fc9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2010-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -13,8 +13,6 @@
 #include <string>
 #include <vector>
 
-#include <boost/bind.hpp>
-
 #include <gtest/gtest.h>
 
 #include <dns/masterload.h>
@@ -24,6 +22,7 @@
 #include <dns/rrset.h>
 
 using namespace std;
+using namespace std::placeholders;
 using namespace isc::dns;
 
 namespace {
@@ -95,7 +94,7 @@ TEST_F(MasterLoadTest, loadWithFunctionCallback) {
     // object)
     rr_stream << txt_rr << a_rr1 << soa_rr;
     masterLoad(rr_stream, origin, zclass,
-               boost::bind(&testCallback, _1, &results));
+               std::bind(&testCallback, _1, &results));
     ASSERT_EQ(3, results.size());
     EXPECT_EQ(txt_rr, results[0]->toText());
     EXPECT_EQ(a_rr1, results[1]->toText());
@@ -104,10 +103,10 @@ TEST_F(MasterLoadTest, loadWithFunctionCallback) {
 
 TEST_F(MasterLoadTest, loadWithMemFunctionCallback) {
     // The same test as loadRRs but using a class member function (with a
-    // help of Boost.bind)
+    // help of std.bind)
     rr_stream << txt_rr << a_rr1 << soa_rr;
     masterLoad(rr_stream, origin, zclass,
-               boost::bind(&MasterLoadTest::rrsetCallback, this, _1));
+               std::bind(&MasterLoadTest::rrsetCallback, this, _1));
     ASSERT_EQ(3, results.size());
     EXPECT_EQ(txt_rr, results[0]->toText());
     EXPECT_EQ(a_rr1, results[1]->toText());
index 83d980505fc816a842e3e0d8a10fba3fddc24d8b..e774ddea81fccdb1febc87575f5be3152b58d443 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2010-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -6,6 +6,7 @@
 
 #include <config.h>
 
+#include <functional>
 #include <vector>
 #include <string>
 #include <sstream>
 
 #include <util/unittests/wiredata.h>
 
-#include <boost/bind.hpp>
 #include <boost/lexical_cast.hpp>
 
 using namespace std;
+using namespace std::placeholders;
 using namespace isc::dns;
 using namespace isc::util;
 using namespace isc::dns::rdata;
@@ -135,10 +136,10 @@ TEST_F(RdataTest, createRdataWithLexer) {
 
     CreateRdataCallback callback;
     MasterLoaderCallbacks callbacks(
-        boost::bind(&CreateRdataCallback::callback, &callback,
-                    CreateRdataCallback::ERROR, _1, _2, _3),
-        boost::bind(&CreateRdataCallback::callback, &callback,
-                    CreateRdataCallback::WARN,  _1, _2, _3));
+        std::bind(&CreateRdataCallback::callback, &callback,
+                  CreateRdataCallback::ERROR, _1, _2, _3),
+        std::bind(&CreateRdataCallback::callback, &callback,
+                  CreateRdataCallback::WARN,  _1, _2, _3));
 
     size_t line = 0;
 
index 3bd1696b6177a1ae69c4220d11fda3ef8da7f791..bb3618f4d51b53d47615bd31c2baecc52845fa09 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 
 #include <gtest/gtest.h>
 
-#include <boost/bind.hpp>
-
+#include <functional>
 #include <sstream>
 #include <vector>
 
 using std::vector;
 using namespace isc::dns;
 using namespace isc::dns::rdata;
+using namespace std::placeholders;
 
 namespace {
 
@@ -46,7 +46,7 @@ protected:
     RRCollatorTest() :
         origin_("example.com"), rrclass_(RRClass::IN()), rrttl_(3600),
         throw_from_callback_(false),
-        collator_(boost::bind(addRRset, _1, &rrsets_, &throw_from_callback_)),
+        collator_(std::bind(addRRset, _1, &rrsets_, &throw_from_callback_)),
         rr_callback_(collator_.getCallback()),
         a_rdata1_(createRdata(RRType::A(), rrclass_, "192.0.2.1")),
         a_rdata2_(createRdata(RRType::A(), rrclass_, "192.0.2.2")),
index 3a9809f5aa465b0e92ae70701145a68a8558fb52..d2f5a41344ce0ba4a1f4c43d62ff9ff44b05bf05 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2015,2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 
 #include <gtest/gtest.h>
 
-#include <boost/bind.hpp>
 #include <boost/scoped_ptr.hpp>
 
 #include <algorithm>
+#include <functional>
 #include <string>
 #include <sstream>
 #include <vector>
@@ -31,6 +31,7 @@
 using isc::Unexpected;
 using namespace isc::dns;
 using namespace isc::dns::rdata;
+using namespace std::placeholders;
 
 namespace {
 
@@ -46,8 +47,8 @@ protected:
         zname_("example.com"), zclass_(RRClass::IN()),
         soa_(new RRset(zname_, zclass_, RRType::SOA(), RRTTL(60))),
         ns_(new RRset(zname_, zclass_, RRType::NS(), RRTTL(60))),
-        callbacks_(boost::bind(&ZoneCheckerTest::callback, this, _1, true),
-                   boost::bind(&ZoneCheckerTest::callback, this, _1, false))
+        callbacks_(std::bind(&ZoneCheckerTest::callback, this, _1, true),
+                   std::bind(&ZoneCheckerTest::callback, this, _1, false))
     {
         std::stringstream ss;
         ss << "example.com. 60 IN SOA " << soa_txt << "\n";
@@ -58,7 +59,7 @@ protected:
     }
 
 public:
-    // This one is passed to boost::bind.  Some compilers seem to require
+    // This one is passed to std::bind.  Some compilers seem to require
     // it be public.
     void callback(const std::string& reason, bool is_error) {
         if (is_error) {
@@ -132,7 +133,7 @@ TEST_F(ZoneCheckerTest, checkSOA) {
     // If null callback is specified, checkZone() only returns the final
     // result.
     ZoneCheckerCallbacks noerror_callbacks(
-        0, boost::bind(&ZoneCheckerTest::callback, this, _1, false));
+        0, std::bind(&ZoneCheckerTest::callback, this, _1, false));
     EXPECT_FALSE(checkZone(zname_, zclass_, *rrsets_, noerror_callbacks));
     checkIssues();
 
@@ -196,7 +197,7 @@ TEST_F(ZoneCheckerTest, checkNSData) {
     // Same check, but disabling warning callback.  Same result, but without
     // the warning.
     ZoneCheckerCallbacks nowarn_callbacks(
-        boost::bind(&ZoneCheckerTest::callback, this, _1, true), 0);
+        std::bind(&ZoneCheckerTest::callback, this, _1, true), 0);
     EXPECT_TRUE(checkZone(zname_, zclass_, *rrsets_, nowarn_callbacks));
     checkIssues();
 
index 3447a00d9babd8f394aed637c53e23db3989035c..7fe81726a8349184f90ff58e3627deeaf746b3a2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -15,9 +15,9 @@
 #include <dns/rrset.h>
 #include <dns/rrset_collection_base.h>
 
-#include <boost/bind.hpp>
 #include <boost/lexical_cast.hpp>
 
+#include <functional>
 #include <string>
 
 using boost::lexical_cast;
@@ -175,10 +175,11 @@ bool
 checkZone(const Name& zone_name, const RRClass& zone_class,
           const RRsetCollectionBase& zone_rrsets,
           const ZoneCheckerCallbacks& callbacks) {
+    using namespace std::placeholders;
     bool had_error = false;
     ZoneCheckerCallbacks my_callbacks(
-        boost::bind(errorWrapper, _1, &callbacks, &had_error),
-        boost::bind(&ZoneCheckerCallbacks::warn, &callbacks, _1));
+        std::bind(errorWrapper, _1, &callbacks, &had_error),
+        std::bind(&ZoneCheckerCallbacks::warn, &callbacks, _1));
 
     checkSOA(zone_name, zone_class, zone_rrsets, my_callbacks);
     checkNS(zone_name, zone_class, zone_rrsets, my_callbacks);
index f0a057d1be49d071a82f80c61bca4870d86f6e93..be36a32417f917cf0b724b1a3d5e686409e05738 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -9,8 +9,7 @@
 
 #include <dns/dns_fwd.h>
 
-#include <boost/function.hpp>
-
+#include <functional>
 #include <string>
 
 namespace isc {
@@ -24,7 +23,7 @@ public:
     /// \brief Functor type of the callback on some issue (error or warning).
     ///
     /// Its parameter indicates the reason for the corresponding issue.
-    typedef boost::function<void(const std::string& reason)> IssueCallback;
+    typedef std::function<void(const std::string& reason)> IssueCallback;
 
     /// \brief Constructor.
     ///
@@ -52,7 +51,7 @@ public:
     ///
     /// \param reason Textual representation of the reason for the error.
     void error(const std::string& reason) const {
-        if (!error_callback_.empty()) {
+        if (error_callback_) {
             error_callback_(reason);
         }
     }
@@ -64,7 +63,7 @@ public:
     ///
     /// \param reason Textual representation of the reason for the issue.
     void warn(const std::string& reason) const {
-        if (!warn_callback_.empty())
+        if (warn_callback_)
             warn_callback_(reason);
     }
 
index 3f0af351f0fb71f48c871d16aab13aa960ddaf60..bf1acc59e7ae4197862a1c3ae010a0f64aa2bc2e 100644 (file)
 #include <util/multi_threading_mgr.h>
 #include <util/unlock_guard.h>
 
-#include <boost/bind.hpp>
 #include <boost/enable_shared_from_this.hpp>
 #include <boost/weak_ptr.hpp>
 
 #include <atomic>
 #include <array>
+#include <functional>
 #include <iostream>
 #include <map>
 #include <mutex>
@@ -41,7 +41,7 @@ namespace {
 constexpr size_t MAX_LOGGED_MESSAGE_SIZE = 1024;
 
 /// @brief TCP socket callback function type.
-typedef boost::function<void(boost::system::error_code ec, size_t length)>
+typedef std::function<void(boost::system::error_code ec, size_t length)>
 SocketCallbackFunction;
 
 /// @brief Socket callback class required by the TCPSocket API.
@@ -831,8 +831,9 @@ Connection::doTransactionInternal(const HttpRequestPtr& request,
         /// over for names.
         TCPEndpoint endpoint(url_.getStrippedHostname(),
                              static_cast<unsigned short>(url_.getPort()));
-        SocketCallback socket_cb(boost::bind(&Connection::connectCallback, shared_from_this(),
-                                             connect_callback, current_transid_, _1));
+        SocketCallback socket_cb(std::bind(&Connection::connectCallback, shared_from_this(),
+                                           connect_callback, current_transid_,
+                                           std::placeholders::_1));
 
         // Establish new connection or use existing connection.
         socket_.open(&endpoint, socket_cb);
@@ -991,15 +992,18 @@ Connection::terminateInternal(const boost::system::error_code& ec,
 void
 Connection::scheduleTimer(const long request_timeout) {
     if (request_timeout > 0) {
-        timer_.setup(boost::bind(&Connection::timerCallback, this), request_timeout,
+        timer_.setup(std::bind(&Connection::timerCallback, this), request_timeout,
                      IntervalTimer::ONE_SHOT);
     }
 }
 
 void
 Connection::doSend(const uint64_t transid) {
-    SocketCallback socket_cb(boost::bind(&Connection::sendCallback, shared_from_this(),
-                                         transid, _1, _2));
+    SocketCallback socket_cb(std::bind(&Connection::sendCallback,
+                                       shared_from_this(),
+                                       transid,
+                                       std::placeholders::_1,
+                                       std::placeholders::_2));
     try {
         socket_.asyncSend(&buf_[0], buf_.size(), socket_cb);
 
@@ -1011,8 +1015,11 @@ Connection::doSend(const uint64_t transid) {
 void
 Connection::doReceive(const uint64_t transid) {
     TCPEndpoint endpoint;
-    SocketCallback socket_cb(boost::bind(&Connection::receiveCallback, shared_from_this(),
-                                         transid, _1, _2));
+    SocketCallback socket_cb(std::bind(&Connection::receiveCallback,
+                                       shared_from_this(),
+                                       transid,
+                                       std::placeholders::_1,
+                                       std::placeholders::_2));
 
     try {
         socket_.asyncReceive(static_cast<void*>(input_buf_.data()), input_buf_.size(), 0,
index d3d117a049cc32e90ceb21c3bd7ecbf8ab285d97..f2dbfd8f3e57411967dd09b0dd8546050c29411e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -11,8 +11,8 @@
 #include <http/connection_pool.h>
 #include <http/http_log.h>
 #include <http/http_messages.h>
-#include <boost/bind.hpp>
 #include <boost/make_shared.hpp>
+#include <functional>
 
 using namespace isc::asiolink;
 
@@ -105,9 +105,9 @@ HttpConnection::asyncAccept() {
     // Create instance of the callback. It is safe to pass the local instance
     // of the callback, because the underlying boost functions make copies
     // as needed.
-    HttpAcceptorCallback cb = boost::bind(&HttpConnection::acceptorCallback,
-                                          shared_from_this(),
-                                          boost::asio::placeholders::error);
+    HttpAcceptorCallback cb = std::bind(&HttpConnection::acceptorCallback,
+                                        shared_from_this(),
+                                        std::placeholders::_1); // error
     try {
         acceptor_.asyncAccept(socket_, cb);
 
@@ -129,13 +129,13 @@ HttpConnection::doRead(TransactionPtr transaction) {
         }
 
         // Create instance of the callback. It is safe to pass the local instance
-        // of the callback, because the underlying boost functions make copies
+        // of the callback, because the underlying std functions make copies
         // as needed.
-        SocketCallback cb(boost::bind(&HttpConnection::socketReadCallback,
-                                      shared_from_this(),
-                                      transaction,
-                                      boost::asio::placeholders::error,
-                                      boost::asio::placeholders::bytes_transferred));
+        SocketCallback cb(std::bind(&HttpConnection::socketReadCallback,
+                                    shared_from_this(),
+                                    transaction,
+                                    std::placeholders::_1,   // error
+                                    std::placeholders::_2)); //bytes_transferred
         socket_.asyncReceive(static_cast<void*>(transaction->getInputBufData()),
                              transaction->getInputBufSize(),
                              0, &endpoint, cb);
@@ -150,13 +150,13 @@ HttpConnection::doWrite(HttpConnection::TransactionPtr transaction) {
     try {
         if (transaction->outputDataAvail()) {
             // Create instance of the callback. It is safe to pass the local instance
-            // of the callback, because the underlying boost functions make copies
+            // of the callback, because the underlying std functions make copies
             // as needed.
-            SocketCallback cb(boost::bind(&HttpConnection::socketWriteCallback,
-                                          shared_from_this(),
-                                          transaction,
-                                          boost::asio::placeholders::error,
-                                          boost::asio::placeholders::bytes_transferred));
+            SocketCallback cb(std::bind(&HttpConnection::socketWriteCallback,
+                                        shared_from_this(),
+                                        transaction,
+                                        std::placeholders::_1,   // error
+                                        std::placeholders::_2)); // bytes_transferred
             socket_.asyncSend(transaction->getOutputBufData(),
                               transaction->getOutputBufSize(),
                               cb);
@@ -359,15 +359,15 @@ HttpConnection::setupRequestTimer(TransactionPtr transaction) {
     // because IntervalTimer already passes shared pointer to the
     // IntervalTimerImpl to make sure that the callback remains
     // valid.
-    request_timer_.setup(boost::bind(&HttpConnection::requestTimeoutCallback,
-                                     this, transaction),
+    request_timer_.setup(std::bind(&HttpConnection::requestTimeoutCallback,
+                                   this, transaction),
                          request_timeout_, IntervalTimer::ONE_SHOT);
 }
 
 void
 HttpConnection::setupIdleTimer() {
-    request_timer_.setup(boost::bind(&HttpConnection::idleTimeoutCallback,
-                                     this),
+    request_timer_.setup(std::bind(&HttpConnection::idleTimeoutCallback,
+                                   this),
                          idle_timeout_, IntervalTimer::ONE_SHOT);
 }
 
index 3c3c3ffad8a114fc6f14bb8e7f81b243f806cd79..a24f32303ae158cac2bda35cb3d379ce7f1c4017 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 #include <http/http_acceptor.h>
 #include <http/request_parser.h>
 #include <http/response_creator_factory.h>
-#include <boost/function.hpp>
 #include <boost/enable_shared_from_this.hpp>
 #include <boost/system/error_code.hpp>
 #include <boost/shared_ptr.hpp>
 #include <array>
+#include <functional>
 #include <string>
 
 namespace isc {
@@ -45,7 +45,7 @@ private:
 
     /// @brief Type of the function implementing a callback invoked by the
     /// @c SocketCallback functor.
-    typedef boost::function<void(boost::system::error_code ec, size_t length)>
+    typedef std::function<void(boost::system::error_code ec, size_t length)>
     SocketCallbackFunction;
 
     /// @brief Functor associated with the socket object.
index 4d52f7b181f192a0582422a3326cb8e2a9d30999..9ef70123b497ab6296ba5a8d7dcdac96bc566db1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -8,14 +8,14 @@
 #define HTTP_ACCEPTOR_H
 
 #include <asiolink/tcp_acceptor.h>
-#include <boost/function.hpp>
 #include <boost/system/system_error.hpp>
+#include <functional>
 
 namespace isc {
 namespace http {
 
 /// @brief Type of the callback for the TCP acceptor used in this library.
-typedef boost::function<void(const boost::system::error_code&)>
+typedef std::function<void(const boost::system::error_code&)>
 HttpAcceptorCallback;
 
 /// @brief Type of the TCP acceptor used in this library.
index f3b12b076792e5f3ed7d004a5a372d60cae502f1..c44d28fda2907228e37bca140634182fecdab56c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -7,7 +7,7 @@
 #include <config.h>
 
 #include <http/http_message_parser_base.h>
-#include <boost/bind.hpp>
+#include <functional>
 #include <sstream>
 
 using namespace isc::util;
@@ -126,15 +126,15 @@ HttpMessageParserBase::defineStates() {
     StateModel::defineStates();
 
     defineState(HTTP_PARSE_OK_ST, "HTTP_PARSE_OK_ST",
-                boost::bind(&HttpMessageParserBase::parseEndedHandler, this));
+                std::bind(&HttpMessageParserBase::parseEndedHandler, this));
 
     defineState(HTTP_PARSE_FAILED_ST, "HTTP_PARSE_FAILED_ST",
-                boost::bind(&HttpMessageParserBase::parseEndedHandler, this));
+                std::bind(&HttpMessageParserBase::parseEndedHandler, this));
 }
 
 void
 HttpMessageParserBase::stateWithReadHandler(const std::string& handler_name,
-                                            boost::function<void(const char c)>
+                                            std::function<void(const char c)>
                                             after_read_logic) {
     std::string bytes;
     getNextFromBuffer(bytes);
@@ -153,7 +153,7 @@ HttpMessageParserBase::stateWithReadHandler(const std::string& handler_name,
 
 void
 HttpMessageParserBase::stateWithMultiReadHandler(const std::string& handler_name,
-                                                 boost::function<void(const std::string&)>
+                                                 std::function<void(const std::string&)>
                                                  after_read_logic) {
     std::string bytes;
     getNextFromBuffer(bytes, 0);
index cbff213bd4f335e7eeeb12caf510076bda4513f3..01f9831e2db1b6c061091dc2527aa076b092b1ca 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -10,7 +10,7 @@
 #include <exceptions/exceptions.h>
 #include <http/http_message.h>
 #include <util/state_model.h>
-#include <boost/function.hpp>
+#include <functional>
 #include <string>
 
 namespace isc {
@@ -195,7 +195,7 @@ protected:
     ///
     /// @throw HttpRequestParserError when invalid event occurred.
     void stateWithReadHandler(const std::string& handler_name,
-                              boost::function<void(const char c)>
+                              std::function<void(const char c)>
                               after_read_logic);
 
     /// @brief Generic parser handler which reads multiple bytes of data and
@@ -215,7 +215,7 @@ protected:
     ///
     /// @throw HttpRequestParserError when invalid event occurred.
     void stateWithMultiReadHandler(const std::string& handler_name,
-                                   boost::function<void(const std::string&)>
+                                   std::function<void(const std::string&)>
                                    after_read_logic);
 
     /// @brief Transition parser to failure state.
index 058e8283c09f4684813cdb5686dae5cb9382adc9..d6ab95f4bb67243a037c55926b1cac1378a7f08d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2019-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -88,7 +88,8 @@ HttpListenerImpl::accept() {
     // depends on the use case.
     HttpResponseCreatorPtr response_creator = creator_factory_->create();
     HttpAcceptorCallback acceptor_callback =
-        boost::bind(&HttpListenerImpl::acceptHandler, this, _1);
+        std::bind(&HttpListenerImpl::acceptHandler, this,
+                  std::placeholders::_1);
     HttpConnectionPtr conn = createConnection(response_creator,
                                               acceptor_callback);
     // Add this new connection to the pool.
index 3ebf824840967ae55ab4e1523315558339c1cd9e..d7748070178ad3209dfc00f6cf057fb44334d0b1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -7,7 +7,7 @@
 #include <config.h>
 
 #include <http/request_parser.h>
-#include <boost/bind.hpp>
+#include <functional>
 #include <iostream>
 
 using namespace isc::util;
@@ -61,83 +61,83 @@ HttpRequestParser::defineStates() {
 
     // Define HTTP parser specific states.
     defineState(RECEIVE_START_ST, "RECEIVE_START_ST",
-                boost::bind(&HttpRequestParser::receiveStartHandler, this));
+                std::bind(&HttpRequestParser::receiveStartHandler, this));
 
     defineState(HTTP_METHOD_ST, "HTTP_METHOD_ST",
-                boost::bind(&HttpRequestParser::httpMethodHandler, this));
+                std::bind(&HttpRequestParser::httpMethodHandler, this));
 
     defineState(HTTP_URI_ST, "HTTP_URI_ST",
-                boost::bind(&HttpRequestParser::uriHandler, this));
+                std::bind(&HttpRequestParser::uriHandler, this));
 
     defineState(HTTP_VERSION_H_ST, "HTTP_VERSION_H_ST",
-                boost::bind(&HttpRequestParser::versionHTTPHandler, this, 'H',
-                            HTTP_VERSION_T1_ST));
+                std::bind(&HttpRequestParser::versionHTTPHandler, this, 'H',
+                          HTTP_VERSION_T1_ST));
 
     defineState(HTTP_VERSION_T1_ST, "HTTP_VERSION_T1_ST",
-                boost::bind(&HttpRequestParser::versionHTTPHandler, this, 'T',
-                            HTTP_VERSION_T2_ST));
+                std::bind(&HttpRequestParser::versionHTTPHandler, this, 'T',
+                          HTTP_VERSION_T2_ST));
 
     defineState(HTTP_VERSION_T2_ST, "HTTP_VERSION_T2_ST",
-                boost::bind(&HttpRequestParser::versionHTTPHandler, this, 'T',
-                            HTTP_VERSION_P_ST));
+                std::bind(&HttpRequestParser::versionHTTPHandler, this, 'T',
+                          HTTP_VERSION_P_ST));
 
     defineState(HTTP_VERSION_P_ST, "HTTP_VERSION_P_ST",
-                boost::bind(&HttpRequestParser::versionHTTPHandler, this, 'P',
-                            HTTP_VERSION_SLASH_ST));
+                std::bind(&HttpRequestParser::versionHTTPHandler, this, 'P',
+                          HTTP_VERSION_SLASH_ST));
 
     defineState(HTTP_VERSION_SLASH_ST, "HTTP_VERSION_SLASH_ST",
-                boost::bind(&HttpRequestParser::versionHTTPHandler, this, '/',
-                            HTTP_VERSION_MAJOR_ST));
+                std::bind(&HttpRequestParser::versionHTTPHandler, this, '/',
+                          HTTP_VERSION_MAJOR_ST));
 
     defineState(HTTP_VERSION_MAJOR_START_ST, "HTTP_VERSION_MAJOR_START_ST",
-                boost::bind(&HttpRequestParser::versionNumberStartHandler, this,
-                            HTTP_VERSION_MAJOR_ST,
-                            &context_->http_version_major_));
+                std::bind(&HttpRequestParser::versionNumberStartHandler, this,
+                          HTTP_VERSION_MAJOR_ST,
+                          &context_->http_version_major_));
 
     defineState(HTTP_VERSION_MAJOR_ST, "HTTP_VERSION_MAJOR_ST",
-                boost::bind(&HttpRequestParser::versionNumberHandler, this,
-                            '.', HTTP_VERSION_MINOR_START_ST,
-                            &context_->http_version_major_));
+                std::bind(&HttpRequestParser::versionNumberHandler, this,
+                          '.', HTTP_VERSION_MINOR_START_ST,
+                          &context_->http_version_major_));
 
     defineState(HTTP_VERSION_MINOR_START_ST, "HTTP_VERSION_MINOR_START_ST",
-                boost::bind(&HttpRequestParser::versionNumberStartHandler, this,
-                            HTTP_VERSION_MINOR_ST,
-                            &context_->http_version_minor_));
+                std::bind(&HttpRequestParser::versionNumberStartHandler, this,
+                          HTTP_VERSION_MINOR_ST,
+                          &context_->http_version_minor_));
 
     defineState(HTTP_VERSION_MINOR_ST, "HTTP_VERSION_MINOR_ST",
-                boost::bind(&HttpRequestParser::versionNumberHandler, this,
-                            '\r', EXPECTING_NEW_LINE1_ST,
-                            &context_->http_version_minor_));
+                std::bind(&HttpRequestParser::versionNumberHandler, this,
+                          '\r', EXPECTING_NEW_LINE1_ST,
+                          &context_->http_version_minor_));
 
     defineState(EXPECTING_NEW_LINE1_ST, "EXPECTING_NEW_LINE1_ST",
-                boost::bind(&HttpRequestParser::expectingNewLineHandler, this,
-                            HEADER_LINE_START_ST));
+                std::bind(&HttpRequestParser::expectingNewLineHandler, this,
+                          HEADER_LINE_START_ST));
 
     defineState(HEADER_LINE_START_ST, "HEADER_LINE_START_ST",
-                boost::bind(&HttpRequestParser::headerLineStartHandler, this));
+                std::bind(&HttpRequestParser::headerLineStartHandler, this));
 
     defineState(HEADER_LWS_ST, "HEADER_LWS_ST",
-                boost::bind(&HttpRequestParser::headerLwsHandler, this));
+                std::bind(&HttpRequestParser::headerLwsHandler, this));
 
     defineState(HEADER_NAME_ST, "HEADER_NAME_ST",
-                boost::bind(&HttpRequestParser::headerNameHandler, this));
+                std::bind(&HttpRequestParser::headerNameHandler, this));
 
     defineState(SPACE_BEFORE_HEADER_VALUE_ST, "SPACE_BEFORE_HEADER_VALUE_ST",
-                boost::bind(&HttpRequestParser::spaceBeforeHeaderValueHandler, this));
+                std::bind(&HttpRequestParser::spaceBeforeHeaderValueHandler, this));
 
     defineState(HEADER_VALUE_ST, "HEADER_VALUE_ST",
-                boost::bind(&HttpRequestParser::headerValueHandler, this));
+                std::bind(&HttpRequestParser::headerValueHandler, this));
 
     defineState(EXPECTING_NEW_LINE2_ST, "EXPECTING_NEW_LINE2",
-                boost::bind(&HttpRequestParser::expectingNewLineHandler, this,
-                            HEADER_LINE_START_ST));
+                std::bind(&HttpRequestParser::expectingNewLineHandler, this,
+                          HEADER_LINE_START_ST));
 
     defineState(EXPECTING_NEW_LINE3_ST, "EXPECTING_NEW_LINE3_ST",
-                boost::bind(&HttpRequestParser::expectingNewLineHandler, this,
-                            HTTP_PARSE_OK_ST));
+                std::bind(&HttpRequestParser::expectingNewLineHandler, this,
+                          HTTP_PARSE_OK_ST));
 
     defineState(HTTP_BODY_ST, "HTTP_BODY_ST",
-                boost::bind(&HttpRequestParser::bodyHandler, this));
+                std::bind(&HttpRequestParser::bodyHandler, this));
 }
 
 void
index 78748baaa24d93a01158ffd538514c6e117c2710..b2ab797caf56a0c15aa3e15f18b9dc0c02b02264 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -7,7 +7,7 @@
 #include <config.h>
 
 #include <http/response_parser.h>
-#include <boost/bind.hpp>
+#include <functional>
 
 using namespace isc::util;
 
@@ -62,95 +62,95 @@ HttpResponseParser::defineStates() {
 
     // Define HTTP parser specific states.
     defineState(RECEIVE_START_ST, "RECEIVE_START_ST",
-                boost::bind(&HttpResponseParser::receiveStartHandler, this));
+                std::bind(&HttpResponseParser::receiveStartHandler, this));
 
     defineState(HTTP_VERSION_T1_ST, "HTTP_VERSION_T1_ST",
-                boost::bind(&HttpResponseParser::versionHTTPHandler, this, 'T',
-                            HTTP_VERSION_T2_ST));
+                std::bind(&HttpResponseParser::versionHTTPHandler, this, 'T',
+                          HTTP_VERSION_T2_ST));
 
     defineState(HTTP_VERSION_T2_ST, "HTTP_VERSION_T2_ST",
-                boost::bind(&HttpResponseParser::versionHTTPHandler, this, 'T',
-                            HTTP_VERSION_P_ST));
+                std::bind(&HttpResponseParser::versionHTTPHandler, this, 'T',
+                          HTTP_VERSION_P_ST));
 
     defineState(HTTP_VERSION_P_ST, "HTTP_VERSION_P_ST",
-                boost::bind(&HttpResponseParser::versionHTTPHandler, this, 'P',
-                            HTTP_VERSION_SLASH_ST));
+                std::bind(&HttpResponseParser::versionHTTPHandler, this, 'P',
+                          HTTP_VERSION_SLASH_ST));
 
     defineState(HTTP_VERSION_SLASH_ST, "HTTP_VERSION_SLASH_ST",
-                boost::bind(&HttpResponseParser::versionHTTPHandler, this, '/',
-                            HTTP_VERSION_MAJOR_ST));
+                std::bind(&HttpResponseParser::versionHTTPHandler, this, '/',
+                          HTTP_VERSION_MAJOR_ST));
 
     defineState(HTTP_VERSION_MAJOR_START_ST, "HTTP_VERSION_MAJOR_START_ST",
-                boost::bind(&HttpResponseParser::numberStartHandler, this,
-                            HTTP_VERSION_MAJOR_ST,
-                            "HTTP version",
-                            &context_->http_version_major_));
+                std::bind(&HttpResponseParser::numberStartHandler, this,
+                          HTTP_VERSION_MAJOR_ST,
+                          "HTTP version",
+                          &context_->http_version_major_));
 
     defineState(HTTP_VERSION_MAJOR_ST, "HTTP_VERSION_MAJOR_ST",
-                boost::bind(&HttpResponseParser::numberHandler, this,
-                            '.', HTTP_VERSION_MINOR_START_ST,
-                            "HTTP version",
-                            &context_->http_version_major_));
+                std::bind(&HttpResponseParser::numberHandler, this,
+                          '.', HTTP_VERSION_MINOR_START_ST,
+                          "HTTP version",
+                          &context_->http_version_major_));
 
     defineState(HTTP_VERSION_MINOR_START_ST, "HTTP_VERSION_MINOR_START_ST",
-                boost::bind(&HttpResponseParser::numberStartHandler, this,
-                            HTTP_VERSION_MINOR_ST,
-                            "HTTP version",
-                            &context_->http_version_minor_));
+                std::bind(&HttpResponseParser::numberStartHandler, this,
+                          HTTP_VERSION_MINOR_ST,
+                          "HTTP version",
+                          &context_->http_version_minor_));
 
     defineState(HTTP_VERSION_MINOR_ST, "HTTP_VERSION_MINOR_ST",
-                boost::bind(&HttpResponseParser::numberHandler, this,
-                            ' ', HTTP_STATUS_CODE_START_ST,
-                            "HTTP version",
-                            &context_->http_version_minor_));
+                std::bind(&HttpResponseParser::numberHandler, this,
+                          ' ', HTTP_STATUS_CODE_START_ST,
+                          "HTTP version",
+                          &context_->http_version_minor_));
 
     defineState(HTTP_STATUS_CODE_START_ST, "HTTP_STATUS_CODE_START_ST",
-                boost::bind(&HttpResponseParser::numberStartHandler, this,
-                            HTTP_STATUS_CODE_ST,
-                            "HTTP status code",
-                            &context_->status_code_));
+                std::bind(&HttpResponseParser::numberStartHandler, this,
+                          HTTP_STATUS_CODE_ST,
+                          "HTTP status code",
+                          &context_->status_code_));
 
     defineState(HTTP_STATUS_CODE_ST, "HTTP_STATUS_CODE_ST",
-                boost::bind(&HttpResponseParser::numberHandler, this,
-                            ' ', HTTP_PHRASE_START_ST,
-                            "HTTP status code",
-                            &context_->status_code_));
+                std::bind(&HttpResponseParser::numberHandler, this,
+                          ' ', HTTP_PHRASE_START_ST,
+                          "HTTP status code",
+                          &context_->status_code_));
 
     defineState(HTTP_PHRASE_START_ST, "HTTP_PHRASE_START_ST",
-                boost::bind(&HttpResponseParser::phraseStartHandler, this));
+                std::bind(&HttpResponseParser::phraseStartHandler, this));
 
     defineState(HTTP_PHRASE_ST, "HTTP_PHRASE_ST",
-                boost::bind(&HttpResponseParser::phraseHandler, this));
+                std::bind(&HttpResponseParser::phraseHandler, this));
 
     defineState(EXPECTING_NEW_LINE1_ST, "EXPECTING_NEW_LINE1_ST",
-                boost::bind(&HttpResponseParser::expectingNewLineHandler, this,
-                            HEADER_LINE_START_ST));
+                std::bind(&HttpResponseParser::expectingNewLineHandler, this,
+                          HEADER_LINE_START_ST));
 
     defineState(HEADER_LINE_START_ST, "HEADER_LINE_START_ST",
-                boost::bind(&HttpResponseParser::headerLineStartHandler, this));
+                std::bind(&HttpResponseParser::headerLineStartHandler, this));
 
     defineState(HEADER_LWS_ST, "HEADER_LWS_ST",
-                boost::bind(&HttpResponseParser::headerLwsHandler, this));
+                std::bind(&HttpResponseParser::headerLwsHandler, this));
 
     defineState(HEADER_NAME_ST, "HEADER_NAME_ST",
-                boost::bind(&HttpResponseParser::headerNameHandler, this));
+                std::bind(&HttpResponseParser::headerNameHandler, this));
 
     defineState(SPACE_BEFORE_HEADER_VALUE_ST, "SPACE_BEFORE_HEADER_VALUE_ST",
-                boost::bind(&HttpResponseParser::spaceBeforeHeaderValueHandler, this));
+                std::bind(&HttpResponseParser::spaceBeforeHeaderValueHandler, this));
 
     defineState(HEADER_VALUE_ST, "HEADER_VALUE_ST",
-                boost::bind(&HttpResponseParser::headerValueHandler, this));
+                std::bind(&HttpResponseParser::headerValueHandler, this));
 
     defineState(EXPECTING_NEW_LINE2_ST, "EXPECTING_NEW_LINE2",
-                boost::bind(&HttpResponseParser::expectingNewLineHandler, this,
-                            HEADER_LINE_START_ST));
+                std::bind(&HttpResponseParser::expectingNewLineHandler, this,
+                          HEADER_LINE_START_ST));
 
     defineState(EXPECTING_NEW_LINE3_ST, "EXPECTING_NEW_LINE3_ST",
-                boost::bind(&HttpResponseParser::expectingNewLineHandler, this,
-                            HTTP_PARSE_OK_ST));
+                std::bind(&HttpResponseParser::expectingNewLineHandler, this,
+                          HTTP_PARSE_OK_ST));
 
     defineState(HTTP_BODY_ST, "HTTP_BODY_ST",
-                boost::bind(&HttpResponseParser::bodyHandler, this));
+                std::bind(&HttpResponseParser::bodyHandler, this));
 }
 
 void
index 5ab1d5e9ec082c47af7567bee92698f4390b3313..12c7e4c6c8ce819754732f3cd85a44a00f14f2cc 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <boost/asio/buffer.hpp>
 #include <boost/asio/ip/tcp.hpp>
-#include <boost/bind.hpp>
 #include <boost/pointer_cast.hpp>
 #include <gtest/gtest.h>
 
@@ -37,6 +36,7 @@ using namespace isc::data;
 using namespace isc::http;
 using namespace isc::http::test;
 using namespace isc::util;
+namespace ph = std::placeholders;
 
 namespace {
 
@@ -593,7 +593,7 @@ public:
     HttpListenerTest()
         : io_service_(), factory_(new TestHttpResponseCreatorFactory()),
           test_timer_(io_service_), run_io_service_timer_(io_service_), clients_() {
-        test_timer_.setup(boost::bind(&HttpListenerTest::timeoutHandler, this, true),
+        test_timer_.setup(std::bind(&HttpListenerTest::timeoutHandler, this, true),
                           TEST_TIMEOUT, IntervalTimer::ONE_SHOT);
     }
 
@@ -639,8 +639,8 @@ public:
         io_service_.get_io_service().reset();
 
         if (timeout > 0) {
-            run_io_service_timer_.setup(boost::bind(&HttpListenerTest::timeoutHandler,
-                                                    this, false),
+            run_io_service_timer_.setup(std::bind(&HttpListenerTest::timeoutHandler,
+                                                  this, false),
                                         timeout, IntervalTimer::ONE_SHOT);
         }
         io_service_.run();
@@ -1686,8 +1686,8 @@ public:
             EXPECT_FALSE(ec);
         },
             HttpClient::RequestTimeout(10000),
-            boost::bind(&ExternalMonitor::connectHandler, &monitor, _1, _2),
-            boost::bind(&ExternalMonitor::closeHandler, &monitor, _1)
+            std::bind(&ExternalMonitor::connectHandler, &monitor, ph::_1, ph::_2),
+            std::bind(&ExternalMonitor::closeHandler, &monitor, ph::_1)
         ));
 
         // Initiate another request to the destination.
@@ -1703,8 +1703,8 @@ public:
             EXPECT_FALSE(ec);
         },
             HttpClient::RequestTimeout(10000),
-            boost::bind(&ExternalMonitor::connectHandler, &monitor, _1, _2),
-            boost::bind(&ExternalMonitor::closeHandler, &monitor, _1)
+            std::bind(&ExternalMonitor::connectHandler, &monitor, ph::_1, ph::_2),
+            std::bind(&ExternalMonitor::closeHandler, &monitor, ph::_1)
         ));
 
         // Actually trigger the requests. The requests should be handlded by the
@@ -1790,8 +1790,8 @@ public:
             EXPECT_FALSE(ec);
         },
             HttpClient::RequestTimeout(10000),
-            boost::bind(&ExternalMonitor::connectHandler, &monitor, _1, _2),
-            boost::bind(&ExternalMonitor::closeHandler, &monitor, _1)
+            std::bind(&ExternalMonitor::connectHandler, &monitor, ph::_1, ph::_2),
+            std::bind(&ExternalMonitor::closeHandler, &monitor, ph::_1)
         ));
 
         // Actually trigger the requests. The requests should be handlded by the
@@ -1848,8 +1848,8 @@ public:
             EXPECT_FALSE(ec);
         },
             HttpClient::RequestTimeout(10000),
-            boost::bind(&ExternalMonitor::connectHandler, &monitor, _1, _2),
-            boost::bind(&ExternalMonitor::closeHandler, &monitor, _1)
+            std::bind(&ExternalMonitor::connectHandler, &monitor, ph::_1, ph::_2),
+            std::bind(&ExternalMonitor::closeHandler, &monitor, ph::_1)
         ));
 
         // Actually trigger the requests. The requests should be handlded by the
index 2e0c28d88c94d297297db6eb98fd37285cacfbfd..ae14572ec07ca6baa040491b8dc0fd437d6f4187 100644 (file)
@@ -15,7 +15,7 @@
 #include <process/d_controller.h>
 #include <process/config_base.h>
 #include <kea_version.h>
-#include <boost/bind.hpp>
+#include <functional>
 #include <sstream>
 #include <unistd.h>
 
@@ -739,9 +739,10 @@ DControllerBase::initSignalHandling() {
 
     // Create our signal set.
     io_signal_set_.reset(new IOSignalSet(io_service_,
-                                         boost::bind(&DControllerBase::
-                                                     processSignal,
-                                                     this, _1)));
+                                         std::bind(&DControllerBase::
+                                                   processSignal,
+                                                   this,
+                                                   std::placeholders::_1)));
     // Register for the signals we wish to handle.
     io_signal_set_->add(SIGHUP);
     io_signal_set_->add(SIGINT);
index 0b562a764c0e8672fbe593fc3d533cf4e26a3383..0466706d2b0929e6a09b40aa170105c1b8c7c9cf 100644 (file)
@@ -14,8 +14,7 @@
 #include <process/config_base.h>
 #include <util/filename.h>
 
-#include <boost/bind.hpp>
-
+#include <functional>
 #include <sstream>
 #include <fstream>
 #include <errno.h>
@@ -62,8 +61,9 @@ void Daemon::shutdown() {
 }
 
 void Daemon::handleSignal() {
+    using namespace std::placeholders;
     if (signal_set_ && signal_handler_) {
-        signal_set_->handleNext(boost::bind(signal_handler_, _1));
+        signal_set_->handleNext(std::bind(signal_handler_, _1));
     }
 }
 
index 76bbd54a0268bf9e0d736cbf01b9343812cdb9d1..6c14e9de56197156c6dfb7c3e727128511582e78 100644 (file)
 #include <process/io_service_signal.h>
 #include <exceptions/exceptions.h>
 
-#include <boost/bind.hpp>
 #include <boost/enable_shared_from_this.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/asio/signal_set.hpp>
+#include <functional>
 
 using namespace isc::asiolink;
 
@@ -82,8 +82,9 @@ IOSignalSetImpl::callback(const boost::system::error_code& ec, int signum) {
 
 void
 IOSignalSetImpl::install() {
-    signal_set_.async_wait(boost::bind(&IOSignalSetImpl::callback,
-                                       shared_from_this(), _1, _2));
+    using namespace std::placeholders;
+    signal_set_.async_wait(std::bind(&IOSignalSetImpl::callback,
+                                     shared_from_this(), _1, _2));
 }
 
 void
index 22fe53b5d3067389ab0eac2b80763b7f63dad075..aa0691f054690d7c14596801008d3955304142e7 100644 (file)
@@ -15,7 +15,7 @@ namespace isc {
 namespace process {
 
 /// @brief Defines a handler function for an IOSignal.
-typedef boost::function<void(int signum)> IOSignalHandler;
+typedef std::function<void(int signum)> IOSignalHandler;
 
 class IOSignalSetImpl;
 
index 4e04a2fc4dbe8e842034be4db2eaddfa44a4e6f5..f313998a599709f4416bff442e8163b16725f585 100644 (file)
@@ -9,9 +9,9 @@
 #include <process/io_service_signal.h>
 #include <process/testutils/d_test_stubs.h>
 
-#include <boost/bind.hpp>
 #include <gtest/gtest.h>
 
+#include <functional>
 #include <queue>
 
 namespace isc {
@@ -52,8 +52,8 @@ public:
 
         io_signal_set_.reset(new IOSignalSet(
                                      io_service_,
-                                     boost::bind(&IOSignalTest::processSignal,
-                                                 this, _1)));
+                                     std::bind(&IOSignalTest::processSignal,
+                                               this, std::placeholders::_1)));
     }
 
     /// @brief Destructor.
@@ -91,8 +91,7 @@ public:
     void setTestTime(int test_time_ms) {
         // Fail safe shutdown
         test_time_ms_ = test_time_ms;
-        test_timer_.setup(boost::bind(&IOSignalTest::testTimerHandler,
-                                      this),
+        test_timer_.setup(std::bind(&IOSignalTest::testTimerHandler, this),
                           test_time_ms_, asiolink::IntervalTimer::ONE_SHOT);
     }
 
index a3108246690b8be8089c10b59d937d3c157c3ee9..300035e24f2b1ede67a6a5e7c56991049de6550f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -10,7 +10,7 @@
 #include <process/testutils/d_test_stubs.h>
 #include <process/daemon.h>
 #include <cc/command_interpreter.h>
-#include <boost/bind.hpp>
+#include <functional>
 
 using namespace boost::asio;
 
@@ -194,7 +194,7 @@ DControllerTest::scheduleTimedWrite(const std::string& config,
                                     int write_time_ms) {
     new_cfg_content_ = config;
     write_timer_.reset(new asiolink::IntervalTimer(*getIOService()));
-    write_timer_->setup(boost::bind(&DControllerTest::timedWriteCallback, this),
+    write_timer_->setup(std::bind(&DControllerTest::timedWriteCallback, this),
                         write_time_ms, asiolink::IntervalTimer::ONE_SHOT);
 }
 
index a762038bde4226587b2402dc40566b9a56f2b143..1dc871c9c909f84245081dec1f7df2d5423c5e4d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -9,7 +9,7 @@
 #include <exceptions/exceptions.h>
 #include <util/process_spawn.h>
 #include <util/signal_set.h>
-#include <boost/bind.hpp>
+#include <functional>
 #include <map>
 #include <signal.h>
 #include <stdlib.h>
@@ -152,8 +152,8 @@ ProcessSpawnImpl::ProcessSpawnImpl(const std::string& executable,
       executable_(executable), args_(new char*[args.size() + 2]) {
     // Set the handler which is invoked immediately when the signal
     // is received.
-    signals_->setOnReceiptHandler(boost::bind(&ProcessSpawnImpl::waitForProcess,
-                                              this, _1));
+    signals_->setOnReceiptHandler(std::bind(&ProcessSpawnImpl::waitForProcess,
+                                            this, std::placeholders::_1));
     // Conversion of the arguments to the C-style array we start by setting
     // all pointers within an array to NULL to indicate that they haven't
     // been allocated yet.
@@ -243,7 +243,7 @@ ProcessSpawnImpl::isRunning(const pid_t pid) const {
                   << "' hasn't been spawned and it status cannot be"
                   " returned");
     }
-    return (proc->second.running_); 
+    return (proc->second.running_);
 }
 
 bool
index c7b52153e3ca8294a6807649074a5790fcce5e39..ab63276202ab321fc9e9e4e6d7067e5985d4e360 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -8,9 +8,9 @@
 #define SIGNAL_SET_H
 
 #include <exceptions/exceptions.h>
-#include <boost/function.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/shared_ptr.hpp>
+#include <functional>
 #include <set>
 #include <list>
 #include <pthread.h>
@@ -44,14 +44,14 @@ class SignalSet;
 /// @brief Pointer to the @c isc::util::SignalSet.
 typedef boost::shared_ptr<SignalSet> SignalSetPtr;
 /// @brief Pointer to the signal handling function.
-typedef boost::function<void(int signum)> SignalHandler;
+typedef std::function<void(int signum)> SignalHandler;
 
 /// @brief Pointer to a signal handling function which returns bool result.
 ///
 /// The handler is expected to return true if the signal it was given has
 /// been processed (i.e. should not be recorded for deferred processing) or
 /// false in which case it will be recorded.
-typedef boost::function<bool(int signum)> BoolSignalHandler;
+typedef std::function<bool(int signum)> BoolSignalHandler;
 
 /// @brief Represents a collection of signals handled in a customized way.
 ///
index afc6ee9981305af51c0a9458013c83ea12752ec0..6c9a13d8a24801e2e1b679afecf1c6912e673907 100644 (file)
@@ -6,7 +6,6 @@
 
 #include <config.h>
 #include <util/state_model.h>
-#include <boost/bind.hpp>
 #include <string>
 
 namespace isc {
@@ -245,9 +244,9 @@ StateModel::verifyEvents() {
 void
 StateModel::defineStates() {
     defineState(NEW_ST, "NEW_ST",
-                boost::bind(&StateModel::nopStateHandler, this));
+                std::bind(&StateModel::nopStateHandler, this));
     defineState(END_ST, "END_ST",
-                boost::bind(&StateModel::nopStateHandler, this));
+                std::bind(&StateModel::nopStateHandler, this));
 }
 
 void
index 42f2d05e5c4077676f3d16806198df0cf3f5e403..da297da95d9258b32156bd7c5c9e518b59d81c96 100644 (file)
@@ -11,8 +11,8 @@
 
 #include <exceptions/exceptions.h>
 #include <util/labeled_value.h>
-#include <boost/function.hpp>
 #include <boost/shared_ptr.hpp>
+#include <functional>
 #include <map>
 #include <mutex>
 #include <string>
@@ -34,7 +34,7 @@ typedef LabeledValue Event;
 typedef LabeledValuePtr EventPtr;
 
 /// @brief Defines a pointer to an instance method for handling a state.
-typedef boost::function<void()> StateHandler;
+typedef std::function<void()> StateHandler;
 
 /// @brief State machine pausing modes.
 ///
@@ -73,7 +73,7 @@ public:
     ///
     /// @code
     ///     State(SOME_INT_VAL, "SOME_INT_VAL",
-    ///            boost::bind(&StateModelDerivation::someHandler, this));
+    ///            std::bind(&StateModelDerivation::someHandler, this));
     /// @endcode
     ///
     /// @throw StateModelError if label is null or blank.
@@ -472,7 +472,7 @@ protected:
     ///
     ///     // Add the states defined by the derivation.
     ///     defineState(SOME_ST, "SOME_ST",
-    ///                 boost::bind(&StateModelDerivation::someHandler, this));
+    ///                 std::bind(&StateModelDerivation::someHandler, this));
     ///     :
     /// }
     /// @endcode
index b11cf917ac1793d9dcd6f883b80bc9a0124089a6..5e02e7e1857c7ce815d486ca905f5ac97d97270d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2020 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -7,7 +7,6 @@
 #include <config.h>
 
 #include <util/signal_set.h>
-#include <boost/bind.hpp>
 #include <boost/shared_ptr.hpp>
 #include <gtest/gtest.h>
 #include <signal.h>
@@ -16,6 +15,7 @@ namespace {
 
 using namespace isc;
 using namespace isc::util;
+using namespace std::placeholders;
 
 /// @brief Test fixture class for @c isc::util::SignalSet class.
 ///
@@ -109,14 +109,14 @@ TEST_F(SignalSetTest, twoSignals) {
     // second one should be dropped.
     ASSERT_EQ(0, raise(SIGHUP));
     // Execute the first handler (for SIGHUP).
-    signal_set_->handleNext(boost::bind(&SignalSetTest::testHandler, _1));
+    signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, _1));
     // The handler should have been called once and the signal
     // handled should be SIGHUP.
     EXPECT_EQ(1, handler_calls_);
     EXPECT_EQ(SIGHUP, signum_);
     // Next signal to be handled should be SIGINT.
     EXPECT_EQ(SIGINT, signal_set_->getNext());
-    signal_set_->handleNext(boost::bind(&SignalSetTest::testHandler, _1));
+    signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, _1));
     EXPECT_EQ(2, handler_calls_);
     EXPECT_EQ(SIGINT, signum_);
     // There should be no more waiting handlers.
@@ -143,14 +143,13 @@ TEST_F(SignalSetTest, twoSignalSets) {
     // The signal set owns SIGHUP so it should be the next to handle.
     EXPECT_EQ(SIGHUP, signal_set_->getNext());
     // Handle next signal owned by the secondary signal set.
-    secondary_signal_set_->handleNext(boost::bind(&SignalSetTest::testHandler,
-                                                  _1));
+    secondary_signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, _1));
     EXPECT_EQ(1, handler_calls_);
     EXPECT_EQ(SIGINT, signum_);
     // No more signals to be handled for this signal set.
     EXPECT_EQ(-1, secondary_signal_set_->getNext());
     // Handle next signal owned by the signal set.
-    signal_set_->handleNext(boost::bind(&SignalSetTest::testHandler, _1));
+    signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, _1));
     EXPECT_EQ(2, handler_calls_);
     EXPECT_EQ(SIGHUP, signum_);
     // No more signals to be handled by this signal set.
@@ -200,8 +199,8 @@ TEST_F(SignalSetTest, duplicates) {
 /// Check that on-receipt processing works.
 TEST_F(SignalSetTest, onReceiptTests) {
     // Install an on-receipt handler.
-    SignalSet::setOnReceiptHandler(boost::bind(&SignalSetTest::onReceiptHandler,
-                                               this, _1));
+    SignalSet::setOnReceiptHandler(std::bind(&SignalSetTest::onReceiptHandler,
+                                             this, _1));
     // Create a SignalSet for SIGHUP and SIGUSR1.
     ASSERT_NO_THROW(signal_set_.reset(new SignalSet(SIGHUP, SIGUSR1)));
 
@@ -220,7 +219,7 @@ TEST_F(SignalSetTest, onReceiptTests) {
     EXPECT_EQ(SIGUSR1, signal_set_->getNext());
 
     // Verify we can process SIGUSR1 with the deferred handler.
-    signal_set_->handleNext(boost::bind(&SignalSetTest::testHandler, _1));
+    signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, _1));
     EXPECT_EQ(1, handler_calls_);
     EXPECT_EQ(SIGUSR1, signum_);
 
@@ -235,7 +234,7 @@ TEST_F(SignalSetTest, onReceiptTests) {
     EXPECT_EQ(SIGHUP, signal_set_->getNext());
 
     // Verify we can process it with deferred handler.
-    signal_set_->handleNext(boost::bind(&SignalSetTest::testHandler, _1));
+    signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, _1));
     EXPECT_EQ(2, handler_calls_);
     EXPECT_EQ(SIGHUP, signum_);
 }
index a69030c6c0ab6401bee48c189a0189912edb5176..eaaba738f40c74382cf785f872bfe5dfd691686d 100644 (file)
@@ -8,8 +8,6 @@
 
 #include <util/state_model.h>
 
-#include <boost/function.hpp>
-#include <boost/bind.hpp>
 #include <gtest/gtest.h>
 
 using namespace std;
@@ -208,23 +206,23 @@ public:
 
         // Define our states.
         defineState(DUMMY_ST, "DUMMY_ST",
-                    boost::bind(&StateModelTest::dummyHandler, this));
+                    std::bind(&StateModelTest::dummyHandler, this));
 
         defineState(READY_ST, "READY_ST",
-            boost::bind(&StateModelTest::readyHandler, this));
+                    std::bind(&StateModelTest::readyHandler, this));
 
         defineState(DO_WORK_ST, "DO_WORK_ST",
-            boost::bind(&StateModelTest::doWorkHandler, this));
+                    std::bind(&StateModelTest::doWorkHandler, this));
 
         defineState(DONE_ST, "DONE_ST",
-            boost::bind(&StateModelTest::doneWorkHandler, this));
+                    std::bind(&StateModelTest::doneWorkHandler, this));
 
         defineState(PAUSE_ALWAYS_ST, "PAUSE_ALWAYS_ST",
-            boost::bind(&StateModelTest::pauseHandler, this),
+                    std::bind(&StateModelTest::pauseHandler, this),
                     STATE_PAUSE_ALWAYS);
 
         defineState(PAUSE_ONCE_ST, "PAUSE_ONCE_ST",
-            boost::bind(&StateModelTest::pauseHandler, this),
+                    std::bind(&StateModelTest::pauseHandler, this),
                     STATE_PAUSE_ONCE);
     }
 
@@ -393,8 +391,8 @@ TEST_F(StateModelTest, stateDefinition) {
 
     // Verify that we can add a state to the dictionary.
     ASSERT_NO_THROW(defineState(READY_ST, "READY_ST",
-                                boost::bind(&StateModelTest::dummyHandler,
-                                            this)));
+                                std::bind(&StateModelTest::dummyHandler,
+                                          this)));
 
     // Verify that we can find the state by its value.
     StatePtr state;
@@ -417,7 +415,7 @@ TEST_F(StateModelTest, stateDefinition) {
 
     // Verify that we cannot add a duplicate.
     EXPECT_THROW(defineState(READY_ST, "READY_ST",
-                             boost::bind(&StateModelTest::readyHandler, this)),
+                             std::bind(&StateModelTest::readyHandler, this)),
                  StateModelError);
 
     // Verify that we can still find the state.
@@ -604,8 +602,8 @@ TEST_F(StateModelTest, statusMethods) {
     // Verify that events and states can be added before the model is started.
     EXPECT_NO_THROW(defineEvent(9998, "9998"));
     EXPECT_NO_THROW(defineState(9998, "9998",
-                                boost::bind(&StateModelTest::readyHandler,
-                                            this)));
+                                std::bind(&StateModelTest::readyHandler,
+                                          this)));
 
     // "START" the model.
     // Fake out starting the model by calling transition to move from NEW_ST
@@ -617,7 +615,7 @@ TEST_F(StateModelTest, statusMethods) {
     // Verify that events and states cannot be added after the model is started.
     EXPECT_THROW(defineEvent(9999, "9999"), StateModelError);
     EXPECT_THROW(defineState(9999, "9999",
-                             boost::bind(&StateModelTest::readyHandler, this)),
+                             std::bind(&StateModelTest::readyHandler, this)),
                  StateModelError);
 
     // The state and event combos set above, should show the model as
index caf61ccabcaa9c58672b865dc9a1154059f3324f..9ac67f219613c0801d718ee4b020befae8280c94 100644 (file)
@@ -8,11 +8,11 @@
 
 #include <util/watched_thread.h>
 
-#include <boost/bind.hpp>
 #include <gtest/gtest.h>
 
-#include <unistd.h>
 #include <atomic>
+#include <functional>
+#include <unistd.h>
 
 using namespace std;
 using namespace isc;
@@ -100,7 +100,7 @@ TEST_F(WatchedThreadTest, watchedThreadClassBasics) {
     /// our other tests as to why threads have finished are sound.
     wthread_.reset(new WatchedThread());
     ASSERT_FALSE(wthread_->isRunning());
-    wthread_->start(boost::bind(&WatchedThreadTest::worker, this, WatchedThread::TERMINATE));
+    wthread_->start(std::bind(&WatchedThreadTest::worker, this, WatchedThread::TERMINATE));
     ASSERT_TRUE(wthread_->isRunning());
 
     // Wait more long enough (we hope) for the thread to expire.
@@ -122,7 +122,7 @@ TEST_F(WatchedThreadTest, watchedThreadClassBasics) {
 
     /// Now we'll test stopping a thread.
     /// Start the WatchedThread, let it run a little and then tell it to stop.
-    wthread_->start(boost::bind(&WatchedThreadTest::worker, this, WatchedThread::TERMINATE));
+    wthread_->start(std::bind(&WatchedThreadTest::worker, this, WatchedThread::TERMINATE));
     ASSERT_TRUE(wthread_->isRunning());
 
     // No watches should be ready.
@@ -149,7 +149,7 @@ TEST_F(WatchedThreadTest, watchedThreadClassBasics) {
 
     // Next we'll test error notification.
     // Start the WatchedThread with a thread that sets an error on the second pass.
-    wthread_->start(boost::bind(&WatchedThreadTest::worker, this, WatchedThread::ERROR));
+    wthread_->start(std::bind(&WatchedThreadTest::worker, this, WatchedThread::ERROR));
     ASSERT_TRUE(wthread_->isRunning());
 
     // No watches should be ready.
@@ -180,7 +180,7 @@ TEST_F(WatchedThreadTest, watchedThreadClassBasics) {
 
     // Finally, we'll test data ready notification.
     // We'll start the WatchedThread with a thread that indicates data ready on its second pass.
-    wthread_->start(boost::bind(&WatchedThreadTest::worker, this, WatchedThread::READY));
+    wthread_->start(std::bind(&WatchedThreadTest::worker, this, WatchedThread::READY));
     ASSERT_TRUE(wthread_->isRunning());
 
     // No watches should be ready.
index 6cd86ab8b9b3f4e9bb601ee1886a788c816d9660..c01594b64e4dcbe84029e25e7fff75c704ba29cb 100644 (file)
@@ -11,7 +11,7 @@ namespace isc {
 namespace util {
 
 void
-WatchedThread::start(const boost::function<void()>& thread_main) {
+WatchedThread::start(const std::function<void()>& thread_main) {
     clearReady(ERROR);
     clearReady(READY);
     clearReady(TERMINATE);
index d0f9203adb0930dfd81ba3f0229a1f6ae0872a13..47b72642f2a3a6bcfd94582b3d0fbdcac618973e 100644 (file)
@@ -10,8 +10,8 @@
 #include <util/watch_socket.h>
 
 #include <boost/shared_ptr.hpp>
-#include <boost/function.hpp>
 
+#include <functional>
 #include <mutex>
 #include <thread>
 
@@ -80,7 +80,7 @@ public:
     /// Creates the thread, passing into it the given function to run.
     ///
     /// @param thread_main function the thread should run
-    void start(const boost::function<void()>& thread_main);
+    void start(const std::function<void()>& thread_main);
 
     /// @brief Returns true if the thread is running
     bool isRunning() {