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/rfnoc/graph_stream_manager.cpp | 2 +- host/lib/rfnoc/rfnoc_graph.cpp | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'host/lib/rfnoc') diff --git a/host/lib/rfnoc/graph_stream_manager.cpp b/host/lib/rfnoc/graph_stream_manager.cpp index dcfa88f32..dba913998 100644 --- a/host/lib/rfnoc/graph_stream_manager.cpp +++ b/host/lib/rfnoc/graph_stream_manager.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include 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 #include #include -#include -#include // FIXME remove when rfnoc_device is ready #include 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(streamer); + auto rfnoc_streamer = std::dynamic_pointer_cast(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(streamer); + auto rfnoc_streamer = std::dynamic_pointer_cast(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(num_chans, args)); + _rx_streamers.push_back(std::make_shared(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(num_chans, args)); + _tx_streamers.push_back(std::make_shared(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(uhd::device::make(device_addr)); + std::dynamic_pointer_cast(uhd::device::make(device_addr)); if (!dev) { throw uhd::key_error(std::string("No RFNoC devices found for ----->\n") + device_addr.to_pp_string()); -- cgit v1.2.3