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/zero_copy_flow_ctrl.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'host/lib/transport/zero_copy_flow_ctrl.cpp') diff --git a/host/lib/transport/zero_copy_flow_ctrl.cpp b/host/lib/transport/zero_copy_flow_ctrl.cpp index 7d1ddd7e0..f92b826db 100644 --- a/host/lib/transport/zero_copy_flow_ctrl.cpp +++ b/host/lib/transport/zero_copy_flow_ctrl.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include @@ -97,7 +97,7 @@ private: class zero_copy_flow_ctrl_impl : public zero_copy_flow_ctrl { public: - typedef boost::shared_ptr sptr; + typedef std::shared_ptr sptr; zero_copy_flow_ctrl_impl(zero_copy_if::sptr transport, flow_ctrl_func send_flow_ctrl, @@ -114,11 +114,11 @@ public: for (size_t i = 0; i < transport->get_num_send_frames(); i++) { _send_buffers[i] = - boost::make_shared(_send_flow_ctrl); + std::make_shared(_send_flow_ctrl); } for (size_t i = 0; i < transport->get_num_recv_frames(); i++) { _recv_buffers[i] = - boost::make_shared(_recv_flow_ctrl); + std::make_shared(_recv_flow_ctrl); } } @@ -133,7 +133,7 @@ public: managed_recv_buffer::sptr ptr; managed_recv_buffer::sptr buff = _transport->get_recv_buff(timeout); if (buff) { - boost::shared_ptr mb = + std::shared_ptr mb = _recv_buffers[_recv_buff_index++]; _recv_buff_index %= _recv_buffers.size(); ptr = mb->get(buff); @@ -160,7 +160,7 @@ public: managed_send_buffer::sptr ptr; managed_send_buffer::sptr buff = _transport->get_send_buff(timeout); if (buff) { - boost::shared_ptr mb = + std::shared_ptr mb = _send_buffers[_send_buff_index++]; _send_buff_index %= _send_buffers.size(); ptr = mb->get(buff); @@ -183,8 +183,8 @@ private: zero_copy_if::sptr _transport; // buffers - std::vector> _send_buffers; - std::vector> _recv_buffers; + std::vector> _send_buffers; + std::vector> _recv_buffers; size_t _send_buff_index; size_t _recv_buff_index; -- cgit v1.2.3