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/b200/b200_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/b200/b200_impl.cpp')
-rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 1be8c263b..be21ade63 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -20,8 +20,7 @@ #include <boost/filesystem.hpp> #include <boost/lexical_cast.hpp> #include <boost/functional/hash.hpp> -#include <boost/make_shared.hpp> -#include <boost/weak_ptr.hpp> +#include <memory> #include <cstdio> #include <ctime> #include <cmath> @@ -255,7 +254,7 @@ static device::sptr b200_make(const device_addr_t &device_addr) catch (const uhd::usb_error &) { UHD_LOGGER_INFO("B200") << "Detected bad USB state; resetting." ; libusb::device_handle::sptr dev_handle(libusb::device_handle::get_cached_handle( - boost::static_pointer_cast<libusb::special_handle>(handle)->get_device() + std::static_pointer_cast<libusb::special_handle>(handle)->get_device() )); dev_handle->clear_endpoints(B200_USB_CTRL_RECV_ENDPOINT, B200_USB_CTRL_SEND_ENDPOINT); dev_handle->clear_endpoints(B200_USB_DATA_RECV_ENDPOINT, B200_USB_DATA_SEND_ENDPOINT); @@ -578,7 +577,7 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s //////////////////////////////////////////////////////////////////// _spi_iface = b200_local_spi_core::make(_local_ctrl); if (not (_product == B200MINI or _product == B205MINI)) { - _adf4001_iface = boost::make_shared<b200_ref_pll_ctrl>(_spi_iface); + _adf4001_iface = std::make_shared<b200_ref_pll_ctrl>(_spi_iface); } //////////////////////////////////////////////////////////////////// @@ -588,9 +587,9 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s reset_codec(); ad9361_params::sptr client_settings; if (_product == B200MINI or _product == B205MINI) { - client_settings = boost::make_shared<b2xxmini_ad9361_client_t>(); + client_settings = std::make_shared<b2xxmini_ad9361_client_t>(); } else { - client_settings = boost::make_shared<b200_ad9361_client_t>(); + client_settings = std::make_shared<b200_ad9361_client_t>(); } _codec_ctrl = ad9361_ctrl::make_spi(client_settings, _spi_iface, AD9361_SLAVENO); |