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/rfnoc/rfnoc_graph.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/rfnoc/rfnoc_graph.cpp')
-rw-r--r-- | host/lib/rfnoc/rfnoc_graph.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/host/lib/rfnoc/rfnoc_graph.cpp b/host/lib/rfnoc/rfnoc_graph.cpp index a6ec59d01..929ce518d 100644 --- a/host/lib/rfnoc/rfnoc_graph.cpp +++ b/host/lib/rfnoc/rfnoc_graph.cpp @@ -19,8 +19,6 @@ #include <uhdlib/rfnoc/rfnoc_rx_streamer.hpp> #include <uhdlib/rfnoc/rfnoc_tx_streamer.hpp> #include <uhdlib/utils/narrow.hpp> -#include <boost/make_shared.hpp> -#include <boost/shared_ptr.hpp> // FIXME remove when rfnoc_device is ready #include <memory> using namespace uhd; @@ -215,7 +213,7 @@ public: uhd::transport::adapter_id_t adapter_id) { // Verify the streamer was created by us - auto rfnoc_streamer = boost::dynamic_pointer_cast<rfnoc_tx_streamer>(streamer); + auto rfnoc_streamer = std::dynamic_pointer_cast<rfnoc_tx_streamer>(streamer); if (!rfnoc_streamer) { throw uhd::type_error("Streamer is not rfnoc capable"); } @@ -271,7 +269,7 @@ public: uhd::transport::adapter_id_t adapter_id) { // Verify the streamer was created by us - auto rfnoc_streamer = boost::dynamic_pointer_cast<rfnoc_rx_streamer>(streamer); + auto rfnoc_streamer = std::dynamic_pointer_cast<rfnoc_rx_streamer>(streamer); if (!rfnoc_streamer) { throw uhd::type_error("Streamer is not rfnoc capable"); } @@ -323,14 +321,14 @@ public: uhd::rx_streamer::sptr create_rx_streamer( const size_t num_chans, const uhd::stream_args_t& args) { - _rx_streamers.push_back(boost::make_shared<rfnoc_rx_streamer>(num_chans, args)); + _rx_streamers.push_back(std::make_shared<rfnoc_rx_streamer>(num_chans, args)); return _rx_streamers.back(); } uhd::tx_streamer::sptr create_tx_streamer( const size_t num_chans, const uhd::stream_args_t& args) { - _tx_streamers.push_back(boost::make_shared<rfnoc_tx_streamer>(num_chans, args)); + _tx_streamers.push_back(std::make_shared<rfnoc_tx_streamer>(num_chans, args)); return _tx_streamers.back(); } @@ -905,7 +903,7 @@ rfnoc_graph::sptr make_rfnoc_graph( rfnoc_graph::sptr rfnoc_graph::make(const uhd::device_addr_t& device_addr) { auto dev = - boost::dynamic_pointer_cast<detail::rfnoc_device>(uhd::device::make(device_addr)); + std::dynamic_pointer_cast<detail::rfnoc_device>(uhd::device::make(device_addr)); if (!dev) { throw uhd::key_error(std::string("No RFNoC devices found for ----->\n") + device_addr.to_pp_string()); |