From 1fe98e8701dd0b790b172762c3629db32956d1fc Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Sat, 28 Sep 2019 11:18:57 +0200 Subject: 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 . 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. --- host/lib/usrp/dboard/db_sbx_common.hpp | 2 +- host/lib/usrp/dboard/db_twinrx.cpp | 10 +++++----- host/lib/usrp/dboard/db_ubx.cpp | 10 +++++----- host/lib/usrp/dboard/db_wbx_common.hpp | 4 ++-- host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp | 2 ++ host/lib/usrp/dboard/magnesium/magnesium_radio_control.cpp | 2 +- .../lib/usrp/dboard/magnesium/magnesium_radio_control_init.cpp | 2 +- host/lib/usrp/dboard/rhodium/rhodium_radio_control.cpp | 2 +- host/lib/usrp/dboard/rhodium/rhodium_radio_control.hpp | 2 +- host/lib/usrp/dboard/twinrx/twinrx_io.hpp | 4 ++-- 10 files changed, 21 insertions(+), 19 deletions(-) (limited to 'host/lib/usrp/dboard') diff --git a/host/lib/usrp/dboard/db_sbx_common.hpp b/host/lib/usrp/dboard/db_sbx_common.hpp index 4d463603f..9c09f21a3 100644 --- a/host/lib/usrp/dboard/db_sbx_common.hpp +++ b/host/lib/usrp/dboard/db_sbx_common.hpp @@ -272,7 +272,7 @@ protected: * sbx_version* subclass, and invoke any relevant functions through that * object. This pointer is set to the proper object at construction time. */ - typedef boost::shared_ptr sbx_versionx_sptr; + typedef std::shared_ptr sbx_versionx_sptr; sbx_versionx_sptr db_actual; }; diff --git a/host/lib/usrp/dboard/db_twinrx.cpp b/host/lib/usrp/dboard/db_twinrx.cpp index de1cd3f33..5a8fefeb7 100644 --- a/host/lib/usrp/dboard/db_twinrx.cpp +++ b/host/lib/usrp/dboard/db_twinrx.cpp @@ -19,7 +19,7 @@ #include #include #include "dboard_ctor_args.hpp" -#include +#include #include #include //#include //Needed for _expert->to_dot() below @@ -229,13 +229,13 @@ private: class twinrx_rcvr : public rx_dboard_base { public: - typedef boost::shared_ptr sptr; + typedef std::shared_ptr sptr; twinrx_rcvr(ctor_args_t args) : rx_dboard_base(args) { _db_iface = get_iface(); - twinrx_gpio::sptr gpio_iface = boost::make_shared(_db_iface); - twinrx_cpld_regmap::sptr cpld_regs = boost::make_shared(); + twinrx_gpio::sptr gpio_iface = std::make_shared(_db_iface); + twinrx_cpld_regmap::sptr cpld_regs = std::make_shared(); cpld_regs->initialize(*gpio_iface, false); _ctrl = twinrx_ctrl::make(_db_iface, gpio_iface, cpld_regs, get_rx_id()); _expert = expert_factory::create_container("twinrx_expert"); @@ -304,7 +304,7 @@ public: static dboard_base::sptr make_twinrx_fe(dboard_base::ctor_args_t args) { const dboard_ctor_args_t& db_args = dboard_ctor_args_t::cast(args); - sptr container = boost::dynamic_pointer_cast(db_args.rx_container); + sptr container = std::dynamic_pointer_cast(db_args.rx_container); if (container) { dboard_base::sptr fe = dboard_base::sptr( new twinrx_rcvr_fe(args, container->get_expert(), container->get_ctrl())); diff --git a/host/lib/usrp/dboard/db_ubx.cpp b/host/lib/usrp/dboard/db_ubx.cpp index 305a69c52..72b3e331d 100644 --- a/host/lib/usrp/dboard/db_ubx.cpp +++ b/host/lib/usrp/dboard/db_ubx.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include @@ -1329,10 +1329,10 @@ private: ubx_cpld_reg_t _cpld_reg; uint32_t _prev_cpld_value; std::map _gpio_map; - boost::shared_ptr _txlo1; - boost::shared_ptr _txlo2; - boost::shared_ptr _rxlo1; - boost::shared_ptr _rxlo2; + std::shared_ptr _txlo1; + std::shared_ptr _txlo2; + std::shared_ptr _rxlo1; + std::shared_ptr _rxlo2; double _tx_target_pfd_freq; double _rx_target_pfd_freq; double _tx_gain; diff --git a/host/lib/usrp/dboard/db_wbx_common.hpp b/host/lib/usrp/dboard/db_wbx_common.hpp index ea012c91c..ec6459583 100644 --- a/host/lib/usrp/dboard/db_wbx_common.hpp +++ b/host/lib/usrp/dboard/db_wbx_common.hpp @@ -61,7 +61,7 @@ #include #include #include -#include +#include #include #include @@ -200,7 +200,7 @@ protected: * wbx_version_* subclass, and invoke any relevant functions through that * object. This pointer is set to the proper object at construction time. */ - typedef boost::shared_ptr wbx_versionx_sptr; + typedef std::shared_ptr wbx_versionx_sptr; wbx_versionx_sptr db_actual; uhd::dict _tx_gains, _rx_gains; diff --git a/host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp b/host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp index 05455e3fd..8f4ee0caa 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_cpld_ctrl.hpp @@ -1,5 +1,6 @@ // // Copyright 2017 Ettus Research, a National Instruments Company +// Copyright 2019 Ettus Research, a National Instruments Brand // // SPDX-License-Identifier: GPL-3.0-or-later // @@ -12,6 +13,7 @@ #include #include #include +#include //! Controls the CPLD on a Magnesium daughterboard // diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_control.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_control.cpp index 13186e146..32c16adc6 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_radio_control.cpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_control.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_control_init.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_control_init.cpp index d8a1ccba8..a1b039079 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_radio_control_init.cpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_control_init.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include diff --git a/host/lib/usrp/dboard/rhodium/rhodium_radio_control.cpp b/host/lib/usrp/dboard/rhodium/rhodium_radio_control.cpp index df2c3aadd..54c6333bc 100644 --- a/host/lib/usrp/dboard/rhodium/rhodium_radio_control.cpp +++ b/host/lib/usrp/dboard/rhodium/rhodium_radio_control.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/host/lib/usrp/dboard/rhodium/rhodium_radio_control.hpp b/host/lib/usrp/dboard/rhodium/rhodium_radio_control.hpp index a70db79cc..8cee33f17 100644 --- a/host/lib/usrp/dboard/rhodium/rhodium_radio_control.hpp +++ b/host/lib/usrp/dboard/rhodium/rhodium_radio_control.hpp @@ -29,7 +29,7 @@ namespace uhd { namespace rfnoc { class rhodium_radio_control_impl : public radio_control_impl { public: - typedef boost::shared_ptr sptr; + typedef std::shared_ptr sptr; //! Frequency bands for RX. Bands are a function of the analog filter banks enum class rx_band { diff --git a/host/lib/usrp/dboard/twinrx/twinrx_io.hpp b/host/lib/usrp/dboard/twinrx/twinrx_io.hpp index ea1f1150a..e3e475148 100644 --- a/host/lib/usrp/dboard/twinrx/twinrx_io.hpp +++ b/host/lib/usrp/dboard/twinrx/twinrx_io.hpp @@ -41,7 +41,7 @@ static uint32_t get_reg(wb_iface::wb_addr_type addr) { class twinrx_gpio : public wb_iface { public: - typedef boost::shared_ptr sptr; + typedef std::shared_ptr sptr; //---------------------------------------------- //Public GPIO fields @@ -123,7 +123,7 @@ private: //Members/definitions class twinrx_cpld_regmap : public uhd::soft_regmap_t { public: - typedef boost::shared_ptr sptr; + typedef std::shared_ptr sptr; //---------------------------------------------- // IF CCA: CPLD 1 -- cgit v1.2.3