From d3a16b702230534f7265613a73204bdb051a458e Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 16 Oct 2019 16:21:19 -0700 Subject: uhd: Replace all occurrences of boost::bind with std::bind Note: Replacing everything with a lambda would be even better, but that can't be easily scripted so we'll do this as a first step to reduce the Boost footprint. This also removes occurences of #include , and makes sure all usages of std::bind have an #include . clang-format wasn't always applied to minimize the changeset in this commit, however, it was applied to the blocks of #includes. Due to conflicts with other Boost libraries, the placeholders _1, _2, etc. could not be directly used, but had to be explicitly called out (as std::placeholders::_1, etc.). This makes the use of std::bind even uglier, which serves as another reminder that using std::bind (and even more so, boost::bind) should be avoided. nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It was not possible to remove it by simply doing a search and replace, so it will be removed in a separate commit. --- host/lib/usrp/usrp1/io_impl.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'host/lib/usrp/usrp1/io_impl.cpp') diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp index 462f330e6..4eb1a5c50 100644 --- a/host/lib/usrp/usrp1/io_impl.cpp +++ b/host/lib/usrp/usrp1/io_impl.cpp @@ -12,18 +12,18 @@ #include "../../transport/super_recv_packet_handler.hpp" #define SSPH_DONT_PAD_TO_ONE #include "../../transport/super_send_packet_handler.hpp" +#include #include -#include #include -#include -#include +#include +#include #include +#include #include -#include -#include -#include #include #include +#include +#include #include #define bmFR_RX_FORMAT_SHIFT_SHIFT 0 @@ -140,7 +140,7 @@ struct usrp1_impl::io_impl{ io_impl(zero_copy_if::sptr data_transport): data_transport(data_transport), curr_buff(offset_send_buffer(data_transport->get_send_buff())), - omsb(boost::bind(&usrp1_impl::io_impl::commit_send_buff, this, _1, _2, _3)), + omsb(std::bind(&usrp1_impl::io_impl::commit_send_buff, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)), vandal_loop_exit(false) { /* NOP */ @@ -242,7 +242,7 @@ void usrp1_impl::io_init(void){ _io_impl->flush_send_buff(); //create a new vandal thread to poll xerflow conditions - _io_impl->vandal_task = task::make(boost::bind( + _io_impl->vandal_task = task::make(std::bind( &usrp1_impl::vandal_conquest_loop, this, std::ref(_io_impl->vandal_loop_exit) )); } @@ -637,8 +637,8 @@ rx_streamer::sptr usrp1_impl::get_rx_stream(const uhd::stream_args_t &args_){ //init some streamer stuff my_streamer->set_tick_rate(_master_clock_rate); my_streamer->set_vrt_unpacker(&usrp1_bs_vrt_unpacker); - my_streamer->set_xport_chan_get_buff(0, boost::bind( - &uhd::transport::zero_copy_if::get_recv_buff, _io_impl->data_transport, _1 + my_streamer->set_xport_chan_get_buff(0, std::bind( + &uhd::transport::zero_copy_if::get_recv_buff, _io_impl->data_transport, std::placeholders::_1 )); //set the converter @@ -687,15 +687,15 @@ tx_streamer::sptr usrp1_impl::get_tx_stream(const uhd::stream_args_t &args_){ const size_t spp = bpp/convert::get_bytes_per_item(args.otw_format); //make the new streamer given the samples per packet - std::function tx_fcn = boost::bind(&usrp1_impl::tx_stream_on_off, this, _1); + std::function tx_fcn = std::bind(&usrp1_impl::tx_stream_on_off, this, std::placeholders::_1); std::shared_ptr my_streamer = std::make_shared(spp, _soft_time_ctrl, tx_fcn); //init some streamer stuff my_streamer->set_tick_rate(_master_clock_rate); my_streamer->set_vrt_packer(&usrp1_bs_vrt_packer); - my_streamer->set_xport_chan_get_buff(0, boost::bind( - &usrp1_impl::io_impl::get_send_buff, _io_impl.get(), _1 + my_streamer->set_xport_chan_get_buff(0, std::bind( + &usrp1_impl::io_impl::get_send_buff, _io_impl.get(), std::placeholders::_1 )); //set the converter -- cgit v1.2.3