#include <functional>
using namespace isc::process;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
namespace isc {
namespace agent {
void
CtrlAgentController::registerCommands() {
CtrlAgentCommandMgr::instance().registerCommand(BUILD_REPORT_COMMAND,
- std::bind(&DControllerBase::buildReportHandler, this, _1, _2));
+ std::bind(&DControllerBase::buildReportHandler, this, ph::_1, ph::_2));
CtrlAgentCommandMgr::instance().registerCommand(CONFIG_GET_COMMAND,
- std::bind(&DControllerBase::configGetHandler, this, _1, _2));
+ std::bind(&DControllerBase::configGetHandler, this, ph::_1, ph::_2));
CtrlAgentCommandMgr::instance().registerCommand(CONFIG_RELOAD_COMMAND,
- std::bind(&DControllerBase::configReloadHandler, this, _1, _2));
+ std::bind(&DControllerBase::configReloadHandler, this, ph::_1, ph::_2));
CtrlAgentCommandMgr::instance().registerCommand(CONFIG_SET_COMMAND,
- std::bind(&DControllerBase::configSetHandler, this, _1, _2));
+ std::bind(&DControllerBase::configSetHandler, this, ph::_1, ph::_2));
CtrlAgentCommandMgr::instance().registerCommand(CONFIG_TEST_COMMAND,
- std::bind(&DControllerBase::configTestHandler, this, _1, _2));
+ std::bind(&DControllerBase::configTestHandler, this, ph::_1, ph::_2));
CtrlAgentCommandMgr::instance().registerCommand(CONFIG_WRITE_COMMAND,
- std::bind(&DControllerBase::configWriteHandler, this, _1, _2));
+ std::bind(&DControllerBase::configWriteHandler, this, ph::_1, ph::_2));
CtrlAgentCommandMgr::instance().registerCommand(SHUT_DOWN_COMMAND,
- std::bind(&DControllerBase::shutdownHandler, this, _1, _2));
+ std::bind(&DControllerBase::shutdownHandler, this, ph::_1, ph::_2));
CtrlAgentCommandMgr::instance().registerCommand(STATUS_GET_COMMAND,
- std::bind(&DControllerBase::statusGetHandler, this, _1, _2));
+ std::bind(&DControllerBase::statusGetHandler, this, ph::_1, ph::_2));
CtrlAgentCommandMgr::instance().registerCommand(VERSION_GET_COMMAND,
- std::bind(&DControllerBase::versionGetHandler, this, _1, _2));
+ std::bind(&DControllerBase::versionGetHandler, this, ph::_1, ph::_2));
}
void
using namespace isc::config;
using namespace isc::data;
using namespace isc::http;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
namespace {
CtrlAgentCommandMgr::instance().
registerCommand("foo", std::bind(&CtrlAgentResponseCreatorTest::
fooCommandHandler,
- this, _1, _2));
+ this, ph::_1, ph::_2));
// Make sure that the request has been initialized properly.
if (!request_) {
using namespace isc::config;
using namespace isc::process;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
namespace isc {
namespace d2 {
// These are the commands always supported by the D2 server.
// Please keep the list in alphabetic order.
CommandMgr::instance().registerCommand(BUILD_REPORT_COMMAND,
- std::bind(&D2Controller::buildReportHandler, this, _1, _2));
+ std::bind(&D2Controller::buildReportHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand(CONFIG_GET_COMMAND,
- std::bind(&D2Controller::configGetHandler, this, _1, _2));
+ std::bind(&D2Controller::configGetHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand(CONFIG_RELOAD_COMMAND,
- std::bind(&D2Controller::configReloadHandler, this, _1, _2));
+ std::bind(&D2Controller::configReloadHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand(CONFIG_SET_COMMAND,
- std::bind(&D2Controller::configSetHandler, this, _1, _2));
+ std::bind(&D2Controller::configSetHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand(CONFIG_TEST_COMMAND,
- std::bind(&D2Controller::configTestHandler, this, _1, _2));
+ std::bind(&D2Controller::configTestHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand(CONFIG_WRITE_COMMAND,
- std::bind(&D2Controller::configWriteHandler, this, _1, _2));
+ std::bind(&D2Controller::configWriteHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand(SHUT_DOWN_COMMAND,
- std::bind(&D2Controller::shutdownHandler, this, _1, _2));
+ std::bind(&D2Controller::shutdownHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand(STATUS_GET_COMMAND,
- std::bind(&DControllerBase::statusGetHandler, this, _1, _2));
+ std::bind(&DControllerBase::statusGetHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand(VERSION_GET_COMMAND,
- std::bind(&D2Controller::versionGetHandler, this, _1, _2));
+ std::bind(&D2Controller::versionGetHandler, this, ph::_1, ph::_2));
}
void
#include <unistd.h>
using namespace std;
-using namespace std::placeholders;
using namespace isc;
using namespace isc::asiolink;
using namespace isc::config;
using namespace isc::dhcp::test;
using namespace isc::process;
using namespace boost::asio;
+namespace ph = std::placeholders;
namespace isc {
namespace d2 {
ASSERT_NO_THROW(
CommandMgr::instance().registerCommand("foo",
std::bind(&CtrlChannelD2Test::longCommandHandler,
- command.str(), _1, _2));
+ command.str(), ph::_1, ph::_2));
);
createUnixChannelServer();
// of a desired size
ASSERT_NO_THROW(
CommandMgr::instance().registerCommand("foo",
- std::bind(&CtrlChannelD2Test::longResponseHandler, _1, _2));
+ std::bind(&CtrlChannelD2Test::longResponseHandler, ph::_1, ph::_2));
);
createUnixChannelServer();
#include <functional>
using namespace std;
-using namespace std::placeholders;
using namespace isc;
using namespace isc::asiolink;
using namespace isc::asiodns;
using namespace boost::asio;
using namespace boost::asio::ip;
+namespace ph = std::placeholders;
+
namespace {
const char* TEST_ADDRESS = "127.0.0.1";
sizeof(receive_buffer_)),
remote,
std::bind(&DNSClientTest::udpReceiveHandler,
- this, &udp_socket, &remote, _2,
+ this, &udp_socket, &remote, ph::_2,
corrupt_response));
// The socket is now ready to receive the data. Let's post some request
remote,
std::bind(&DNSClientTest::
TSIGReceiveHandler, this,
- &udp_socket, &remote, _2,
+ &udp_socket, &remote, ph::_2,
client_key, server_key));
// The socket is now ready to receive the data. Let's post some request
#include <gtest/gtest.h>
using namespace std;
-using namespace std::placeholders;
using namespace isc;
using namespace isc::d2;
+namespace ph = std::placeholders;
namespace isc {
namespace d2 {
sizeof(receive_buffer_)),
remote_,
std::bind(&FauxServer::requestHandler,
- this, _1, _2,
+ this, ph::_1, ph::_2,
response_mode,
response_rcode));
}
using namespace isc::stats;
using namespace isc::util;
using namespace std;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
namespace {
// Re-open lease and host database with new parameters.
try {
DatabaseConnection::db_lost_callback =
- std::bind(&ControlledDhcpv4Srv::dbLostCallback, srv, _1);
+ std::bind(&ControlledDhcpv4Srv::dbLostCallback, srv, ph::_1);
CfgDbAccessPtr cfg_db = CfgMgr::instance().getStagingCfg()->getCfgDbAccess();
cfg_db->setAppendedParameters("universe=4");
cfg_db->createManagers();
// These are the commands always supported by the DHCPv4 server.
// Please keep the list in alphabetic order.
CommandMgr::instance().registerCommand("build-report",
- std::bind(&ControlledDhcpv4Srv::commandBuildReportHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandBuildReportHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("config-backend-pull",
- std::bind(&ControlledDhcpv4Srv::commandConfigBackendPullHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandConfigBackendPullHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("config-get",
- std::bind(&ControlledDhcpv4Srv::commandConfigGetHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandConfigGetHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("config-reload",
- std::bind(&ControlledDhcpv4Srv::commandConfigReloadHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandConfigReloadHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("config-set",
- std::bind(&ControlledDhcpv4Srv::commandConfigSetHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandConfigSetHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("config-test",
- std::bind(&ControlledDhcpv4Srv::commandConfigTestHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandConfigTestHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("config-write",
- std::bind(&ControlledDhcpv4Srv::commandConfigWriteHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandConfigWriteHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("dhcp-enable",
- std::bind(&ControlledDhcpv4Srv::commandDhcpEnableHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandDhcpEnableHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("dhcp-disable",
- std::bind(&ControlledDhcpv4Srv::commandDhcpDisableHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandDhcpDisableHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("libreload",
- std::bind(&ControlledDhcpv4Srv::commandLibReloadHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandLibReloadHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("leases-reclaim",
- std::bind(&ControlledDhcpv4Srv::commandLeasesReclaimHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandLeasesReclaimHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("server-tag-get",
- std::bind(&ControlledDhcpv4Srv::commandServerTagGetHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandServerTagGetHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("shutdown",
- std::bind(&ControlledDhcpv4Srv::commandShutdownHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandShutdownHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("status-get",
- std::bind(&ControlledDhcpv4Srv::commandStatusGetHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandStatusGetHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("version-get",
- std::bind(&ControlledDhcpv4Srv::commandVersionGetHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandVersionGetHandler, this, ph::_1, ph::_2));
// Register statistic related commands
CommandMgr::instance().registerCommand("statistic-get",
- std::bind(&StatsMgr::statisticGetHandler, _1, _2));
+ std::bind(&StatsMgr::statisticGetHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-reset",
- std::bind(&StatsMgr::statisticResetHandler, _1, _2));
+ std::bind(&StatsMgr::statisticResetHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-remove",
- std::bind(&StatsMgr::statisticRemoveHandler, _1, _2));
+ std::bind(&StatsMgr::statisticRemoveHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-get-all",
- std::bind(&StatsMgr::statisticGetAllHandler, _1, _2));
+ std::bind(&StatsMgr::statisticGetAllHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-reset-all",
- std::bind(&StatsMgr::statisticResetAllHandler, _1, _2));
+ std::bind(&StatsMgr::statisticResetAllHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-remove-all",
- std::bind(&StatsMgr::statisticRemoveAllHandler, _1, _2));
+ std::bind(&StatsMgr::statisticRemoveAllHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-sample-age-set",
- std::bind(&StatsMgr::statisticSetMaxSampleAgeHandler, _1, _2));
+ std::bind(&StatsMgr::statisticSetMaxSampleAgeHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-sample-age-set-all",
- std::bind(&ControlledDhcpv4Srv::commandStatisticSetMaxSampleAgeAllHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandStatisticSetMaxSampleAgeAllHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-sample-count-set",
- std::bind(&StatsMgr::statisticSetMaxSampleCountHandler, _1, _2));
+ std::bind(&StatsMgr::statisticSetMaxSampleCountHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-sample-count-set-all",
- std::bind(&ControlledDhcpv4Srv::commandStatisticSetMaxSampleCountAllHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv4Srv::commandStatisticSetMaxSampleCountAllHandler, this, ph::_1, ph::_2));
}
void ControlledDhcpv4Srv::shutdownServer(int exit_value) {
using namespace isc::stats;
using namespace isc::util;
using namespace std;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
namespace {
// our error handler.
// This may throw so wherever this is called needs to ready.
d2_mgr.startSender(std::bind(&Dhcpv4Srv::d2ClientErrorHandler,
- this, _1, _2));
+ this, ph::_1, ph::_2));
}
}
#include <unistd.h>
using namespace std;
-using namespace std::placeholders;
using namespace isc;
using namespace isc::asiolink;
using namespace isc::config;
using namespace isc::stats;
using namespace isc::test;
using namespace isc::util;
+namespace ph = std::placeholders;
namespace {
ASSERT_NO_THROW(
CommandMgr::instance().registerCommand("foo",
std::bind(&CtrlChannelDhcpv4SrvTest::longCommandHandler,
- command.str(), _1, _2));
+ command.str(), ph::_1, ph::_2));
);
createUnixChannelServer();
// of a desired size.
ASSERT_NO_THROW(
CommandMgr::instance().registerCommand("foo",
- std::bind(&CtrlChannelDhcpv4SrvTest::longResponseHandler, _1, _2));
+ std::bind(&CtrlChannelDhcpv4SrvTest::longResponseHandler, ph::_1, ph::_2));
);
createUnixChannelServer();
using namespace isc::stats;
using namespace isc::util;
using namespace std;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
namespace {
// Re-open lease and host database with new parameters.
try {
DatabaseConnection::db_lost_callback =
- std::bind(&ControlledDhcpv6Srv::dbLostCallback, srv, _1);
+ std::bind(&ControlledDhcpv6Srv::dbLostCallback, srv, ph::_1);
CfgDbAccessPtr cfg_db = CfgMgr::instance().getStagingCfg()->getCfgDbAccess();
cfg_db->setAppendedParameters("universe=6");
cfg_db->createManagers();
// These are the commands always supported by the DHCPv6 server.
// Please keep the list in alphabetic order.
CommandMgr::instance().registerCommand("build-report",
- std::bind(&ControlledDhcpv6Srv::commandBuildReportHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandBuildReportHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("config-backend-pull",
- std::bind(&ControlledDhcpv6Srv::commandConfigBackendPullHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandConfigBackendPullHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("config-get",
- std::bind(&ControlledDhcpv6Srv::commandConfigGetHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandConfigGetHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("config-reload",
- std::bind(&ControlledDhcpv6Srv::commandConfigReloadHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandConfigReloadHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("config-test",
- std::bind(&ControlledDhcpv6Srv::commandConfigTestHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandConfigTestHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("config-write",
- std::bind(&ControlledDhcpv6Srv::commandConfigWriteHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandConfigWriteHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("dhcp-disable",
- std::bind(&ControlledDhcpv6Srv::commandDhcpDisableHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandDhcpDisableHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("dhcp-enable",
- std::bind(&ControlledDhcpv6Srv::commandDhcpEnableHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandDhcpEnableHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("leases-reclaim",
- std::bind(&ControlledDhcpv6Srv::commandLeasesReclaimHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandLeasesReclaimHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("server-tag-get",
- std::bind(&ControlledDhcpv6Srv::commandServerTagGetHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandServerTagGetHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("libreload",
- std::bind(&ControlledDhcpv6Srv::commandLibReloadHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandLibReloadHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("config-set",
- std::bind(&ControlledDhcpv6Srv::commandConfigSetHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandConfigSetHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("shutdown",
- std::bind(&ControlledDhcpv6Srv::commandShutdownHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandShutdownHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("status-get",
- std::bind(&ControlledDhcpv6Srv::commandStatusGetHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandStatusGetHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("version-get",
- std::bind(&ControlledDhcpv6Srv::commandVersionGetHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandVersionGetHandler, this, ph::_1, ph::_2));
// Register statistic related commands
CommandMgr::instance().registerCommand("statistic-get",
- std::bind(&StatsMgr::statisticGetHandler, _1, _2));
+ std::bind(&StatsMgr::statisticGetHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-get-all",
- std::bind(&StatsMgr::statisticGetAllHandler, _1, _2));
+ std::bind(&StatsMgr::statisticGetAllHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-reset",
- std::bind(&StatsMgr::statisticResetHandler, _1, _2));
+ std::bind(&StatsMgr::statisticResetHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-reset-all",
- std::bind(&StatsMgr::statisticResetAllHandler, _1, _2));
+ std::bind(&StatsMgr::statisticResetAllHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-remove",
- std::bind(&StatsMgr::statisticRemoveHandler, _1, _2));
+ std::bind(&StatsMgr::statisticRemoveHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-remove-all",
- std::bind(&StatsMgr::statisticRemoveAllHandler, _1, _2));
+ std::bind(&StatsMgr::statisticRemoveAllHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-sample-age-set",
- std::bind(&StatsMgr::statisticSetMaxSampleAgeHandler, _1, _2));
+ std::bind(&StatsMgr::statisticSetMaxSampleAgeHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-sample-age-set-all",
- std::bind(&ControlledDhcpv6Srv::commandStatisticSetMaxSampleAgeAllHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandStatisticSetMaxSampleAgeAllHandler, this, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-sample-count-set",
- std::bind(&StatsMgr::statisticSetMaxSampleCountHandler, _1, _2));
+ std::bind(&StatsMgr::statisticSetMaxSampleCountHandler, ph::_1, ph::_2));
CommandMgr::instance().registerCommand("statistic-sample-count-set-all",
- std::bind(&ControlledDhcpv6Srv::commandStatisticSetMaxSampleCountAllHandler, this, _1, _2));
+ std::bind(&ControlledDhcpv6Srv::commandStatisticSetMaxSampleCountAllHandler, this, ph::_1, ph::_2));
}
void ControlledDhcpv6Srv::shutdownServer(int exit_value) {
using namespace isc::stats;
using namespace isc::util;
using namespace std;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
namespace {
// our error handler.
// This may throw so wherever this is called needs to ready.
d2_mgr.startSender(std::bind(&Dhcpv6Srv::d2ClientErrorHandler,
- this, _1, _2));
+ this, ph::_1, ph::_2));
}
}
#include <unistd.h>
using namespace std;
-using namespace std::placeholders;
using namespace isc;
using namespace isc::asiolink;
using namespace isc::config;
using namespace isc::stats;
using namespace isc::test;
using namespace isc::util;
+namespace ph = std::placeholders;
namespace {
ASSERT_NO_THROW(
CommandMgr::instance().registerCommand("foo",
std::bind(&CtrlChannelDhcpv6SrvTest::longCommandHandler,
- command.str(), _1, _2));
+ command.str(), ph::_1, ph::_2));
);
createUnixChannelServer();
// of a desired size.
ASSERT_NO_THROW(
CommandMgr::instance().registerCommand("foo",
- std::bind(&CtrlChannelDhcpv6SrvTest::longResponseHandler, _1, _2));
+ std::bind(&CtrlChannelDhcpv6SrvTest::longResponseHandler, ph::_1, ph::_2));
);
createUnixChannelServer();
using namespace isc::http;
using namespace isc::log;
using namespace isc::util;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
namespace isc {
namespace ha {
}
},
HttpClient::RequestTimeout(TIMEOUT_DEFAULT_HTTP_CLIENT_REQUEST),
- std::bind(&HAService::clientConnectHandler, this, _1, _2),
- std::bind(&HAService::clientCloseHandler, this, _1)
+ std::bind(&HAService::clientConnectHandler, this, ph::_1, ph::_2),
+ std::bind(&HAService::clientCloseHandler, this, ph::_1)
);
// The number of pending requests is the number of requests for which we
runModel(HA_HEARTBEAT_COMPLETE_EVT);
},
HttpClient::RequestTimeout(TIMEOUT_DEFAULT_HTTP_CLIENT_REQUEST),
- std::bind(&HAService::clientConnectHandler, this, _1, _2),
- std::bind(&HAService::clientCloseHandler, this, _1)
+ std::bind(&HAService::clientConnectHandler, this, ph::_1, ph::_2),
+ std::bind(&HAService::clientCloseHandler, this, ph::_1)
);
}
}
},
HttpClient::RequestTimeout(TIMEOUT_DEFAULT_HTTP_CLIENT_REQUEST),
- std::bind(&HAService::clientConnectHandler, this, _1, _2),
- std::bind(&HAService::clientCloseHandler, this, _1)
+ std::bind(&HAService::clientConnectHandler, this, ph::_1, ph::_2),
+ std::bind(&HAService::clientCloseHandler, this, ph::_1)
);
}
}
},
HttpClient::RequestTimeout(TIMEOUT_DEFAULT_HTTP_CLIENT_REQUEST),
- std::bind(&HAService::clientConnectHandler, this, _1, _2),
- std::bind(&HAService::clientCloseHandler, this, _1)
+ std::bind(&HAService::clientConnectHandler, this, ph::_1, ph::_2),
+ std::bind(&HAService::clientCloseHandler, this, ph::_1)
);
}
}
},
HttpClient::RequestTimeout(config_->getSyncTimeout()),
- std::bind(&HAService::clientConnectHandler, this, _1, _2),
- std::bind(&HAService::clientCloseHandler, this, _1)
+ std::bind(&HAService::clientConnectHandler, this, ph::_1, ph::_2),
+ std::bind(&HAService::clientCloseHandler, this, ph::_1)
);
}
captured_error_message = error_message;
},
HttpClient::RequestTimeout(TIMEOUT_DEFAULT_HTTP_CLIENT_REQUEST),
- std::bind(&HAService::clientConnectHandler, this, _1, _2),
- std::bind(&HAService::clientCloseHandler, this, _1)
+ std::bind(&HAService::clientConnectHandler, this, ph::_1, ph::_2),
+ std::bind(&HAService::clientCloseHandler, this, ph::_1)
);
// Run the IO service until it is stopped by any of the callbacks. This
}
},
HttpClient::RequestTimeout(TIMEOUT_DEFAULT_HTTP_CLIENT_REQUEST),
- std::bind(&HAService::clientConnectHandler, this, _1, _2),
- std::bind(&HAService::clientCloseHandler, this, _1)
+ std::bind(&HAService::clientConnectHandler, this, ph::_1, ph::_2),
+ std::bind(&HAService::clientCloseHandler, this, ph::_1)
);
// Run the IO service until it is stopped by any of the callbacks. This
// We are registerin the socket only to interrupt main-thread
// select().
IfaceMgr::instance().addExternalSocket(tcp_native_fd,
- std::bind(&HAService::socketReadyHandler, this, _1)
+ std::bind(&HAService::socketReadyHandler, this, ph::_1)
);
}
#include <set>
using namespace std;
-using namespace std::placeholders;
using namespace isc;
using namespace isc::hooks;
using namespace isc::config;
using namespace isc::asiolink;
using namespace isc::stats;
using namespace isc::test;
+namespace ph = std::placeholders;
namespace {
ASSERT_NO_THROW(cfg->enableUpdates(true));
ASSERT_NO_THROW(CfgMgr::instance().setD2ClientConfig(cfg));
d2_mgr_.startSender(std::bind(&LeaseCmdsTest::d2ErrorHandler, this,
- _1, _2));
+ ph::_1, ph::_2));
}
/// @brief Disables DHCP-DDNS updates.
#include <boost/enable_shared_from_this.hpp>
#include <functional>
#include <iostream>
+
using namespace boost::asio::local;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
namespace isc {
namespace asiolink {
const UnixDomainSocket::ConnectHandler& handler) {
auto local_handler = std::bind(&UnixDomainSocketImpl::connectHandler,
shared_from_this(),
- handler, _1);
+ handler, ph::_1);
socket_.async_connect(endpoint, local_handler);
}
const UnixDomainSocket::Handler& handler) {
auto local_handler = std::bind(&UnixDomainSocketImpl::sendHandler,
shared_from_this(),
- handler, buffer, _1, _2);
+ handler, buffer, ph::_1, ph::_2);
socket_.async_send(buffer, local_handler);
}
const UnixDomainSocket::Handler& handler) {
auto local_handler = std::bind(&UnixDomainSocketImpl::receiveHandler,
shared_from_this(),
- handler, buffer, _1, _2);
+ handler, buffer, ph::_1, ph::_2);
socket_.async_receive(buffer, 0, local_handler);
}
using namespace isc::data;
using namespace isc::db;
+namespace ph = std::placeholders;
/// @brief Test fixture for exercising DbLostCallback invocation
class DatabaseConnectionCallbackTest : public ::testing::Test {
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");
/// Install the callback.
DatabaseConnection::db_lost_callback =
- std::bind(&DatabaseConnectionCallbackTest::dbLostCallback, this, _1);
+ std::bind(&DatabaseConnectionCallbackTest::dbLostCallback, this, ph::_1);
/// Create the connection..
DatabaseConnection datasrc(pmap);
#include <unistd.h>
using namespace std;
-using namespace std::placeholders;
using namespace isc;
using namespace isc::asiolink;
using namespace isc::dhcp;
using namespace isc::dhcp::test;
using boost::scoped_ptr;
+namespace ph = std::placeholders;
namespace {
// 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 =
- std::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, _1);
+ std::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, ph::_1);
ASSERT_NO_THROW(IfaceMgr::instance().openSockets4(DHCP4_SERVER_PORT, true,
error_handler));
// 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 =
- std::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, _1);
+ std::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, ph::_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.
// 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 =
- std::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, _1);
+ std::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, ph::_1);
// Simulate opening sockets using the dummy packet filter.
bool success = false;
// 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 =
- std::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, _1);
+ std::bind(&IfaceMgrTest::ifaceMgrErrorHandler, this, ph::_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.
#include <functional>
+namespace ph = std::placeholders;
+
namespace isc {
namespace dhcp_ddns {
// 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,
std::bind(&NameChangeUDPListener::
- receiveCompletionHandler, this, _1, _2)));
+ receiveCompletionHandler, this, ph::_1, ph::_2)));
}
NameChangeUDPListener::~NameChangeUDPListener() {
// 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,
std::bind(&NameChangeUDPSender::
sendCompletionHandler, this,
- _1, _2)));
+ ph::_1, ph::_2)));
}
NameChangeUDPSender::~NameChangeUDPSender() {
using namespace isc::asiolink;
using namespace isc::data;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
namespace isc {
namespace dhcp {
// for some specific interface. This callback will simply log a
// warning message.
IfaceMgrErrorMsgCallback error_callback =
- std::bind(&CfgIface::socketOpenErrorHandler, _1);
+ std::bind(&CfgIface::socketOpenErrorHandler, ph::_1);
bool sopen;
if (family == AF_INET) {
// Use broadcast only if we're using raw sockets. For the UDP sockets,
#include <vector>
using namespace std;
-using namespace std::placeholders;
using namespace isc;
using namespace isc::asiolink;
using namespace isc::dhcp;
using namespace isc::dhcp_ddns;
using namespace isc::hooks;
using namespace isc::stats;
+namespace ph = std::placeholders;
namespace {
D2ClientConfigPtr cfg(new D2ClientConfig());
cfg->enableUpdates(true);
mgr.setD2ClientConfig(cfg);
- mgr.startSender(std::bind(&ExpirationAllocEngineTest::d2ErrorHandler, _1, _2));
+ mgr.startSender(std::bind(&ExpirationAllocEngineTest::d2ErrorHandler, ph::_1, ph::_2));
}
/// @brief No-op error handler for the D2 client.
#include <sys/select.h>
using namespace std;
-using namespace std::placeholders;
using namespace isc::dhcp;
using namespace isc;
+namespace ph = std::placeholders;
namespace {
/// @brief Returns D2ClientErroHandler bound to this::error_handler_.
D2ClientErrorHandler getErrorHandler() {
- return (std::bind(&D2ClientMgrTest::error_handler, this, _1, _2));
+ return (std::bind(&D2ClientMgrTest::error_handler, this, ph::_1, ph::_2));
}
/// @brief Constructs a NameChangeRequest message from a fixed JSON string.
#include <sstream>
using namespace std;
-using namespace std::placeholders;
using namespace isc::asiolink;
using namespace isc::data;
using namespace isc::db;
+namespace ph = std::placeholders;
namespace isc {
namespace dhcp {
void
LeaseMgrDbLostCallbackTest::testNoCallbackOnOpenFailure() {
DatabaseConnection::db_lost_callback =
- std::bind(&LeaseMgrDbLostCallbackTest::db_lost_callback, this, _1);
+ std::bind(&LeaseMgrDbLostCallbackTest::db_lost_callback, this, ph::_1);
callback_called_ = false;
ASSERT_THROW(LeaseMgrFactory::create(invalidConnectString()),
LeaseMgrDbLostCallbackTest::testDbLostCallback() {
// Set the connectivity lost callback.
DatabaseConnection::db_lost_callback =
- std::bind(&LeaseMgrDbLostCallbackTest::db_lost_callback, this, _1);
+ std::bind(&LeaseMgrDbLostCallbackTest::db_lost_callback, this, ph::_1);
// Connect to the lease backend.
ASSERT_NO_THROW(LeaseMgrFactory::create(validConnectString()));
using namespace isc::dhcp;
using namespace isc::dhcp::test;
using namespace isc::asiolink;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
namespace {
// Set the connectivity lost callback.
DatabaseConnection::db_lost_callback =
- std::bind(&HostMgrDbLostCallbackTest::db_lost_callback, this, _1);
+ std::bind(&HostMgrDbLostCallbackTest::db_lost_callback, this, ph::_1);
// Find the most recently opened socket. Our SQL client's socket should
// be the next one.
using namespace isc::asiolink;
using namespace isc::dhcp;
using namespace isc::dhcp_ddns;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
namespace {
ASSERT_NO_THROW(cfg->enableUpdates(true));
ASSERT_NO_THROW(CfgMgr::instance().setD2ClientConfig(cfg));
d2_mgr_.startSender(std::bind(&NCRGeneratorTest::d2ErrorHandler, this,
- _1, _2));
+ ph::_1, ph::_2));
}
/// @brief Disables DHCP-DDNS updates.
AddRRCallback
RRCollator::getCallback() {
- using namespace std::placeholders;
+ namespace ph = std::placeholders;
return (std::bind(&RRCollator::Impl::addRR, this->impl_,
- _1, _2, _3, _4, _5));
+ ph::_1, ph::_2, ph::_3, ph::_4, ph::_5));
}
void
#include <functional>
using namespace isc;
+namespace ph = std::placeholders;
namespace isc {
namespace dns {
RRsetCollection::constructHelper(T source, const isc::dns::Name& origin,
const isc::dns::RRClass& rrclass)
{
- using namespace std::placeholders;
- RRCollator collator(std::bind(&RRsetCollection::addRRset, this, _1));
+ RRCollator collator(std::bind(&RRsetCollection::addRRset, this, ph::_1));
MasterLoaderCallbacks callbacks
- (std::bind(&RRsetCollection::loaderCallback, this, _1, _2, _3),
- std::bind(&RRsetCollection::loaderCallback, this, _1, _2, _3));
+ (std::bind(&RRsetCollection::loaderCallback, this, ph::_1, ph::_2, ph::_3),
+ std::bind(&RRsetCollection::loaderCallback, this, ph::_1, ph::_2, ph::_3));
MasterLoader loader(source, origin, rrclass, callbacks,
collator.getCallback(),
MasterLoader::DEFAULT);
using std::string;
using namespace isc::dns;
- using namespace std::placeholders;
+namespace ph = std::placeholders;
class MasterLoaderCallbacksTest : public ::testing::Test {
protected:
rrset_(new RRset(Name("example.org"), RRClass::IN(), RRType::A(),
RRTTL(3600))),
error_(std::bind(&MasterLoaderCallbacksTest::checkCallback, this,
- true, _1, _2, _3)),
+ true, ph::_1, ph::_2, ph::_3)),
warning_(std::bind(&MasterLoaderCallbacksTest::checkCallback, this,
- false, _1, _2, _3)),
+ false, ph::_1, ph::_2, ph::_3)),
callbacks_(error_, warning_)
{}
#include <sstream>
using namespace isc::dns;
-using namespace std::placeholders;
using std::vector;
using std::string;
using std::list;
using std::stringstream;
using std::endl;
using boost::lexical_cast;
+namespace ph = std::placeholders;
namespace {
class MasterLoaderTest : public ::testing::Test {
public:
MasterLoaderTest() :
callbacks_(std::bind(&MasterLoaderTest::callback, this,
- &errors_, _1, _2, _3),
+ &errors_, ph::_1, ph::_2, ph::_3),
std::bind(&MasterLoaderTest::callback, this,
- &warnings_, _1, _2, _3))
+ &warnings_, ph::_1, ph::_2, ph::_3))
{}
void TearDown() {
{
loader_.reset(new MasterLoader(file, origin, rrclass, callbacks_,
std::bind(&MasterLoaderTest::addRRset,
- this, _1, _2, _3, _4, _5),
+ this, ph::_1, ph::_2, ph::_3,
+ ph::_4, ph::_5),
options));
}
{
loader_.reset(new MasterLoader(stream, origin, rrclass, callbacks_,
std::bind(&MasterLoaderTest::addRRset,
- this, _1, _2, _3, _4, _5),
+ this, ph::_1, ph::_2, ph::_3,
+ ph::_4, ph::_5),
options));
}
#include <dns/rrset.h>
using namespace std;
-using namespace std::placeholders;
using namespace isc::dns;
+namespace ph = std::placeholders;
namespace {
// A callback functor for masterLoad() commonly used for the following tests.
// object)
rr_stream << txt_rr << a_rr1 << soa_rr;
masterLoad(rr_stream, origin, zclass,
- std::bind(&testCallback, _1, &results));
+ std::bind(&testCallback, ph::_1, &results));
ASSERT_EQ(3, results.size());
EXPECT_EQ(txt_rr, results[0]->toText());
EXPECT_EQ(a_rr1, results[1]->toText());
// help of std.bind)
rr_stream << txt_rr << a_rr1 << soa_rr;
masterLoad(rr_stream, origin, zclass,
- std::bind(&MasterLoadTest::rrsetCallback, this, _1));
+ std::bind(&MasterLoadTest::rrsetCallback, this, ph::_1));
ASSERT_EQ(3, results.size());
EXPECT_EQ(txt_rr, results[0]->toText());
EXPECT_EQ(a_rr1, results[1]->toText());
#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;
using isc::UnitTestUtil;
using isc::util::unittests::matchWireData;
+namespace ph = std::placeholders;
namespace isc {
namespace dns {
CreateRdataCallback callback;
MasterLoaderCallbacks callbacks(
std::bind(&CreateRdataCallback::callback, &callback,
- CreateRdataCallback::ERROR, _1, _2, _3),
+ CreateRdataCallback::ERROR, ph::_1, ph::_2, ph::_3),
std::bind(&CreateRdataCallback::callback, &callback,
- CreateRdataCallback::WARN, _1, _2, _3));
+ CreateRdataCallback::WARN, ph::_1, ph::_2, ph::_3));
size_t line = 0;
using std::vector;
using namespace isc::dns;
using namespace isc::dns::rdata;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
namespace {
RRCollatorTest() :
origin_("example.com"), rrclass_(RRClass::IN()), rrttl_(3600),
throw_from_callback_(false),
- collator_(std::bind(addRRset, _1, &rrsets_, &throw_from_callback_)),
+ collator_(std::bind(addRRset, ph::_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")),
using isc::Unexpected;
using namespace isc::dns;
using namespace isc::dns::rdata;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
namespace {
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_(std::bind(&ZoneCheckerTest::callback, this, _1, true),
- std::bind(&ZoneCheckerTest::callback, this, _1, false))
+ callbacks_(std::bind(&ZoneCheckerTest::callback, this, ph::_1, true),
+ std::bind(&ZoneCheckerTest::callback, this, ph::_1, false))
{
std::stringstream ss;
ss << "example.com. 60 IN SOA " << soa_txt << "\n";
// If null callback is specified, checkZone() only returns the final
// result.
ZoneCheckerCallbacks noerror_callbacks(
- 0, std::bind(&ZoneCheckerTest::callback, this, _1, false));
+ 0, std::bind(&ZoneCheckerTest::callback, this, ph::_1, false));
EXPECT_FALSE(checkZone(zname_, zclass_, *rrsets_, noerror_callbacks));
checkIssues();
// Same check, but disabling warning callback. Same result, but without
// the warning.
ZoneCheckerCallbacks nowarn_callbacks(
- std::bind(&ZoneCheckerTest::callback, this, _1, true), 0);
+ std::bind(&ZoneCheckerTest::callback, this, ph::_1, true), 0);
EXPECT_TRUE(checkZone(zname_, zclass_, *rrsets_, nowarn_callbacks));
checkIssues();
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(
- std::bind(errorWrapper, _1, &callbacks, &had_error),
+ std::bind(errorWrapper, std::placeholders::_1, &callbacks, &had_error),
std::bind(&ZoneCheckerCallbacks::warn, &callbacks, _1));
checkSOA(zone_name, zone_class, zone_rrsets, my_callbacks);
}
void Daemon::handleSignal() {
- using namespace std::placeholders;
if (signal_set_ && signal_handler_) {
- signal_set_->handleNext(std::bind(signal_handler_, _1));
+ signal_set_->handleNext(std::bind(signal_handler_, std::placeholders::_1));
}
}
return (bytes);
}
-};
-};
+}
+}
void
IOSignalSetImpl::install() {
- using namespace std::placeholders;
signal_set_.async_wait(std::bind(&IOSignalSetImpl::callback,
- shared_from_this(), _1, _2));
+ shared_from_this(),
+ std::placeholders::_1,
+ std::placeholders::_2));
}
void
impl_->add(signum);
}
-}; // end of isc::process namespace
-}; // end of isc namespace
+} // end of isc::process namespace
+} // end of isc namespace
using namespace isc;
using namespace isc::util;
-using namespace std::placeholders;
+namespace ph = std::placeholders;
/// @brief Test fixture class for @c isc::util::SignalSet class.
///
// second one should be dropped.
ASSERT_EQ(0, raise(SIGHUP));
// Execute the first handler (for SIGHUP).
- signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, _1));
+ signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, ph::_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(std::bind(&SignalSetTest::testHandler, _1));
+ signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, ph::_1));
EXPECT_EQ(2, handler_calls_);
EXPECT_EQ(SIGINT, signum_);
// There should be no more waiting handlers.
// 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(std::bind(&SignalSetTest::testHandler, _1));
+ secondary_signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, ph::_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(std::bind(&SignalSetTest::testHandler, _1));
+ signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, ph::_1));
EXPECT_EQ(2, handler_calls_);
EXPECT_EQ(SIGHUP, signum_);
// No more signals to be handled by this signal set.
TEST_F(SignalSetTest, onReceiptTests) {
// Install an on-receipt handler.
SignalSet::setOnReceiptHandler(std::bind(&SignalSetTest::onReceiptHandler,
- this, _1));
+ this, ph::_1));
// Create a SignalSet for SIGHUP and SIGUSR1.
ASSERT_NO_THROW(signal_set_.reset(new SignalSet(SIGHUP, SIGUSR1)));
EXPECT_EQ(SIGUSR1, signal_set_->getNext());
// Verify we can process SIGUSR1 with the deferred handler.
- signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, _1));
+ signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, ph::_1));
EXPECT_EQ(1, handler_calls_);
EXPECT_EQ(SIGUSR1, signum_);
EXPECT_EQ(SIGHUP, signal_set_->getNext());
// Verify we can process it with deferred handler.
- signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, _1));
+ signal_set_->handleNext(std::bind(&SignalSetTest::testHandler, ph::_1));
EXPECT_EQ(2, handler_calls_);
EXPECT_EQ(SIGHUP, signum_);
}