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/transport/zero_copy_flow_ctrl.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/transport/zero_copy_flow_ctrl.cpp')
-rw-r--r-- | host/lib/transport/zero_copy_flow_ctrl.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
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 <uhd/utils/safe_call.hpp> #include <boost/bind.hpp> #include <boost/format.hpp> -#include <boost/make_shared.hpp> +#include <memory> #include <boost/thread/mutex.hpp> #include <boost/thread/thread.hpp> @@ -97,7 +97,7 @@ private: class zero_copy_flow_ctrl_impl : public zero_copy_flow_ctrl { public: - typedef boost::shared_ptr<zero_copy_flow_ctrl_impl> sptr; + typedef std::shared_ptr<zero_copy_flow_ctrl_impl> 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<zero_copy_flow_ctrl_msb>(_send_flow_ctrl); + std::make_shared<zero_copy_flow_ctrl_msb>(_send_flow_ctrl); } for (size_t i = 0; i < transport->get_num_recv_frames(); i++) { _recv_buffers[i] = - boost::make_shared<zero_copy_flow_ctrl_mrb>(_recv_flow_ctrl); + std::make_shared<zero_copy_flow_ctrl_mrb>(_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<zero_copy_flow_ctrl_mrb> mb = + std::shared_ptr<zero_copy_flow_ctrl_mrb> 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<zero_copy_flow_ctrl_msb> mb = + std::shared_ptr<zero_copy_flow_ctrl_msb> 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<boost::shared_ptr<zero_copy_flow_ctrl_msb>> _send_buffers; - std::vector<boost::shared_ptr<zero_copy_flow_ctrl_mrb>> _recv_buffers; + std::vector<std::shared_ptr<zero_copy_flow_ctrl_msb>> _send_buffers; + std::vector<std::shared_ptr<zero_copy_flow_ctrl_mrb>> _recv_buffers; size_t _send_buff_index; size_t _recv_buff_index; |