diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-09-28 11:18:57 +0200 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 12:21:32 -0800 |
commit | 1fe98e8701dd0b790b172762c3629db32956d1fc (patch) | |
tree | 7719e69633f9639f1dcdcf00ebf7db6c4cd6dda2 /host/lib/usrp/usrp1/io_impl.cpp | |
parent | 8541a9b397fb53034c37dd00289aa96def24d410 (diff) | |
download | uhd-1fe98e8701dd0b790b172762c3629db32956d1fc.tar.gz uhd-1fe98e8701dd0b790b172762c3629db32956d1fc.tar.bz2 uhd-1fe98e8701dd0b790b172762c3629db32956d1fc.zip |
uhd: Replace usage of boost smart pointers with C++11 counterparts
This removes the following Boost constructs:
- boost::shared_ptr, boost::weak_ptr
- boost::enable_shared_from_this
- boost::static_pointer_cast, boost::dynamic_pointer_cast
The appropriate includes were also removed. All C++11 versions of these
require #include <memory>.
Note that the stdlib and Boost versions have the exact same syntax, they
only differ in the namespace (boost vs. std). The modifications were all
done using sed, with the exception of boost::scoped_ptr, which was
replaced by std::unique_ptr.
References to boost::smart_ptr were also removed.
boost::intrusive_ptr is not removed in this commit, since it does not
have a 1:1 mapping to a C++11 construct.
Diffstat (limited to 'host/lib/usrp/usrp1/io_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp1/io_impl.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp index 3ccfa11c9..3d45824e4 100644 --- a/host/lib/usrp/usrp1/io_impl.cpp +++ b/host/lib/usrp/usrp1/io_impl.cpp @@ -21,7 +21,7 @@ #include <boost/thread/thread.hpp> #include <boost/bind.hpp> #include <boost/format.hpp> -#include <boost/make_shared.hpp> +#include <memory> #include <atomic> #include <chrono> #include <thread> @@ -508,8 +508,8 @@ double usrp1_impl::update_rx_samp_rate(size_t dspno, const double samp_rate){ this->restore_rx(s); //update the streamer if created - boost::shared_ptr<usrp1_recv_packet_streamer> my_streamer = - boost::dynamic_pointer_cast<usrp1_recv_packet_streamer>(_rx_streamer.lock()); + std::shared_ptr<usrp1_recv_packet_streamer> my_streamer = + std::dynamic_pointer_cast<usrp1_recv_packet_streamer>(_rx_streamer.lock()); if (my_streamer.get() != NULL){ my_streamer->set_samp_rate(_master_clock_rate / rate); } @@ -530,8 +530,8 @@ double usrp1_impl::update_tx_samp_rate(size_t dspno, const double samp_rate){ this->restore_tx(s); //update the streamer if created - boost::shared_ptr<usrp1_send_packet_streamer> my_streamer = - boost::dynamic_pointer_cast<usrp1_send_packet_streamer>(_tx_streamer.lock()); + std::shared_ptr<usrp1_send_packet_streamer> my_streamer = + std::dynamic_pointer_cast<usrp1_send_packet_streamer>(_tx_streamer.lock()); if (my_streamer.get() != NULL){ my_streamer->set_samp_rate(_master_clock_rate / rate); } @@ -631,8 +631,8 @@ rx_streamer::sptr usrp1_impl::get_rx_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::shared_ptr<usrp1_recv_packet_streamer> my_streamer = - boost::make_shared<usrp1_recv_packet_streamer>(spp, _soft_time_ctrl); + std::shared_ptr<usrp1_recv_packet_streamer> my_streamer = + std::make_shared<usrp1_recv_packet_streamer>(spp, _soft_time_ctrl); //init some streamer stuff my_streamer->set_tick_rate(_master_clock_rate); @@ -688,8 +688,8 @@ tx_streamer::sptr usrp1_impl::get_tx_stream(const uhd::stream_args_t &args_){ //make the new streamer given the samples per packet boost::function<void(bool)> tx_fcn = boost::bind(&usrp1_impl::tx_stream_on_off, this, _1); - boost::shared_ptr<usrp1_send_packet_streamer> my_streamer = - boost::make_shared<usrp1_send_packet_streamer>(spp, _soft_time_ctrl, tx_fcn); + std::shared_ptr<usrp1_send_packet_streamer> my_streamer = + std::make_shared<usrp1_send_packet_streamer>(spp, _soft_time_ctrl, tx_fcn); //init some streamer stuff my_streamer->set_tick_rate(_master_clock_rate); |