diff options
author | Johannes Demel <demel@ant.uni-bremen.de> | 2020-05-02 15:36:51 +0200 |
---|---|---|
committer | Josh Morman <mormjb@gmail.com> | 2020-06-04 10:05:48 -0400 |
commit | a6a1954f83478aff0c4fc53d0e8f51b49d51cc1e (patch) | |
tree | 933ed1043c7c379e7d3f220aae96fdccd052c1fe /gr-blocks/lib/socket_pdu_impl.cc | |
parent | 3165f73d7c6224523957fa69beade6069efea6ef (diff) |
msg_handler: Switch from boost::function to std::function
This commit is a first stab at moving from `boost::function` to `std::function`.
For now, it does only update gr-blocks. Also, this requires more testing.
If others can confirm that this change works, I'll continue to update all modules.
Diffstat (limited to 'gr-blocks/lib/socket_pdu_impl.cc')
-rw-r--r-- | gr-blocks/lib/socket_pdu_impl.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gr-blocks/lib/socket_pdu_impl.cc b/gr-blocks/lib/socket_pdu_impl.cc index cd74d60603..14dc124e63 100644 --- a/gr-blocks/lib/socket_pdu_impl.cc +++ b/gr-blocks/lib/socket_pdu_impl.cc @@ -88,8 +88,9 @@ socket_pdu_impl::socket_pdu_impl(std::string type, start_tcp_accept(); - set_msg_handler(pdu::pdu_port_id(), - boost::bind(&socket_pdu_impl::tcp_server_send, this, _1)); + set_msg_handler( + pdu::pdu_port_id(), + std::bind(&socket_pdu_impl::tcp_server_send, this, std::placeholders::_1)); } else if (type == "TCP_CLIENT") { boost::system::error_code error = boost::asio::error::host_not_found; d_tcp_socket.reset(new boost::asio::ip::tcp::socket(d_io_service)); @@ -98,8 +99,9 @@ socket_pdu_impl::socket_pdu_impl(std::string type, throw boost::system::system_error(error); d_tcp_socket->set_option(boost::asio::ip::tcp::no_delay(d_tcp_no_delay)); - set_msg_handler(pdu::pdu_port_id(), - boost::bind(&socket_pdu_impl::tcp_client_send, this, _1)); + set_msg_handler( + pdu::pdu_port_id(), + std::bind(&socket_pdu_impl::tcp_client_send, this, std::placeholders::_1)); d_tcp_socket->async_read_some( boost::asio::buffer(d_rxbuf), @@ -118,8 +120,9 @@ socket_pdu_impl::socket_pdu_impl(std::string type, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); - set_msg_handler(pdu::pdu_port_id(), - boost::bind(&socket_pdu_impl::udp_send, this, _1)); + set_msg_handler( + pdu::pdu_port_id(), + std::bind(&socket_pdu_impl::udp_send, this, std::placeholders::_1)); } else if (type == "UDP_CLIENT") { d_udp_socket.reset( new boost::asio::ip::udp::socket(d_io_service, d_udp_endpoint)); @@ -131,8 +134,9 @@ socket_pdu_impl::socket_pdu_impl(std::string type, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); - set_msg_handler(pdu::pdu_port_id(), - boost::bind(&socket_pdu_impl::udp_send, this, _1)); + set_msg_handler( + pdu::pdu_port_id(), + std::bind(&socket_pdu_impl::udp_send, this, std::placeholders::_1)); } else throw std::runtime_error("gr::blocks:socket_pdu: unknown socket type"); |