From fcc2e9c602a6103dfd0f75e035f614b177c5dc35 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Sat, 28 Sep 2019 12:54:27 +0200 Subject: uhd: Replace boost::function with std::function This is mostly a search-and-replace operation, with few exceptions: - boost::function has a clear() method. In C++11, this is achieved by assigning nullptr to the std::function object. - The empty() method is replaced by std::function's bool() operator --- host/lib/usrp/usrp1/io_impl.cpp | 8 ++++---- host/lib/usrp/usrp1/soft_time_ctrl.hpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'host/lib/usrp/usrp1') diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp index 3d45824e4..462f330e6 100644 --- a/host/lib/usrp/usrp1/io_impl.cpp +++ b/host/lib/usrp/usrp1/io_impl.cpp @@ -76,7 +76,7 @@ struct offset_send_buffer{ **********************************************************************/ class offset_managed_send_buffer : public managed_send_buffer{ public: - typedef boost::function commit_cb_type; + typedef std::function commit_cb_type; offset_managed_send_buffer(const commit_cb_type &commit_cb): _commit_cb(commit_cb) { @@ -366,7 +366,7 @@ private: **********************************************************************/ class usrp1_send_packet_streamer : public sph::send_packet_handler, public tx_streamer{ public: - usrp1_send_packet_streamer(const size_t max_num_samps, soft_time_ctrl::sptr stc, boost::function tx_enb_fcn){ + usrp1_send_packet_streamer(const size_t max_num_samps, soft_time_ctrl::sptr stc, std::function tx_enb_fcn){ _max_num_samps = max_num_samps; this->set_max_samples_per_packet(_max_num_samps); _stc = stc; @@ -419,7 +419,7 @@ public: private: size_t _max_num_samps; soft_time_ctrl::sptr _stc; - boost::function _tx_enb_fcn; + std::function _tx_enb_fcn; }; /*********************************************************************** @@ -687,7 +687,7 @@ 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 - boost::function tx_fcn = boost::bind(&usrp1_impl::tx_stream_on_off, this, _1); + std::function tx_fcn = boost::bind(&usrp1_impl::tx_stream_on_off, this, _1); std::shared_ptr my_streamer = std::make_shared(spp, _soft_time_ctrl, tx_fcn); diff --git a/host/lib/usrp/usrp1/soft_time_ctrl.hpp b/host/lib/usrp/usrp1/soft_time_ctrl.hpp index 9143b6af2..48915499a 100644 --- a/host/lib/usrp/usrp1/soft_time_ctrl.hpp +++ b/host/lib/usrp/usrp1/soft_time_ctrl.hpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include namespace uhd{ namespace usrp{ @@ -28,7 +28,7 @@ namespace uhd{ namespace usrp{ class soft_time_ctrl : uhd::noncopyable{ public: typedef std::shared_ptr sptr; - typedef boost::function cb_fcn_type; + typedef std::function cb_fcn_type; virtual ~soft_time_ctrl(void) = 0; -- cgit v1.2.3