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/nirio_zero_copy.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/nirio_zero_copy.cpp')
-rw-r--r-- | host/lib/transport/nirio_zero_copy.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/host/lib/transport/nirio_zero_copy.cpp b/host/lib/transport/nirio_zero_copy.cpp index 9cd6644f1..f54e5a8ed 100644 --- a/host/lib/transport/nirio_zero_copy.cpp +++ b/host/lib/transport/nirio_zero_copy.cpp @@ -13,7 +13,7 @@ #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/format.hpp> #include <boost/interprocess/mapped_region.hpp> //get_page_size() -#include <boost/make_shared.hpp> +#include <memory> #include <algorithm> // std::max #include <chrono> #include <thread> @@ -136,7 +136,7 @@ private: class nirio_zero_copy_impl : public nirio_zero_copy { public: - typedef boost::shared_ptr<nirio_zero_copy_impl> sptr; + typedef std::shared_ptr<nirio_zero_copy_impl> sptr; nirio_zero_copy_impl(uhd::niusrprio::niusrprio_session::sptr fpga_session, uint32_t instance, @@ -224,13 +224,13 @@ public: if (nirio_status_not_fatal(status)) { // allocate re-usable managed receive buffers for (size_t i = 0; i < get_num_recv_frames(); i++) { - _mrb_pool.push_back(boost::shared_ptr<nirio_zero_copy_mrb>( + _mrb_pool.push_back(std::shared_ptr<nirio_zero_copy_mrb>( new nirio_zero_copy_mrb(*_recv_fifo, get_recv_frame_size()))); } // allocate re-usable managed send buffers for (size_t i = 0; i < get_num_send_frames(); i++) { - _msb_pool.push_back(boost::shared_ptr<nirio_zero_copy_msb>( + _msb_pool.push_back(std::shared_ptr<nirio_zero_copy_msb>( new nirio_zero_copy_msb(*_send_fifo, get_send_frame_size()))); } } @@ -383,8 +383,8 @@ private: uint32_t _fifo_instance; nirio_fifo<fifo_data_t>::sptr _recv_fifo, _send_fifo; const zero_copy_xport_params _xport_params; - std::vector<boost::shared_ptr<nirio_zero_copy_msb>> _msb_pool; - std::vector<boost::shared_ptr<nirio_zero_copy_mrb>> _mrb_pool; + std::vector<std::shared_ptr<nirio_zero_copy_msb>> _msb_pool; + std::vector<std::shared_ptr<nirio_zero_copy_mrb>> _mrb_pool; size_t _next_recv_buff_index, _next_send_buff_index; }; |