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/transport/libusb1_zero_copy.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'host/lib/transport/libusb1_zero_copy.cpp') diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp index 9a1b74fb2..fbeddbcdd 100644 --- a/host/lib/transport/libusb1_zero_copy.cpp +++ b/host/lib/transport/libusb1_zero_copy.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -29,7 +29,7 @@ static const size_t DEFAULT_XFER_SIZE = 32 * 512; // bytes //! type for sharing the release queue with managed buffers class libusb_zero_copy_mb; -typedef boost::shared_ptr> mb_queue_sptr; +typedef std::shared_ptr> mb_queue_sptr; /*! * The libusb docs state that status and actual length can only be read in the callback. @@ -251,7 +251,7 @@ public: libusb_transfer* lut = libusb_alloc_transfer(0); UHD_ASSERT_THROW(lut != NULL); - _mb_pool.push_back(boost::make_shared(lut, + _mb_pool.push_back(std::make_shared(lut, this->get_frame_size(), boost::bind(&libusb_zero_copy_single::enqueue_buffer, this, _1), is_recv, @@ -345,7 +345,7 @@ private: //! Storage for transfer related objects buffer_pool::sptr _buffer_pool; - std::vector> _mb_pool; + std::vector> _mb_pool; boost::mutex _queue_mutex; boost::condition_variable _buff_ready_cond; @@ -440,7 +440,7 @@ struct libusb_zero_copy_impl : usb_zero_copy return _send_impl->get_frame_size(); } - boost::shared_ptr _recv_impl, _send_impl; + std::shared_ptr _recv_impl, _send_impl; boost::mutex _recv_mutex, _send_mutex; }; @@ -468,7 +468,7 @@ usb_zero_copy::sptr usb_zero_copy::make(usb_device_handle::sptr handle, const device_addr_t& hints) { libusb::device_handle::sptr dev_handle(libusb::device_handle::get_cached_handle( - boost::static_pointer_cast(handle)->get_device())); + std::static_pointer_cast(handle)->get_device())); return sptr(new libusb_zero_copy_impl( dev_handle, recv_interface, recv_endpoint, send_interface, send_endpoint, hints)); } -- cgit v1.2.3