aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/tcp_zero_copy.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-09-28 11:18:57 +0200
committerMartin Braun <martin.braun@ettus.com>2019-11-26 12:21:32 -0800
commit1fe98e8701dd0b790b172762c3629db32956d1fc (patch)
tree7719e69633f9639f1dcdcf00ebf7db6c4cd6dda2 /host/lib/transport/tcp_zero_copy.cpp
parent8541a9b397fb53034c37dd00289aa96def24d410 (diff)
downloaduhd-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/tcp_zero_copy.cpp')
-rw-r--r--host/lib/transport/tcp_zero_copy.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/host/lib/transport/tcp_zero_copy.cpp b/host/lib/transport/tcp_zero_copy.cpp
index 01bca900f..555dd238e 100644
--- a/host/lib/transport/tcp_zero_copy.cpp
+++ b/host/lib/transport/tcp_zero_copy.cpp
@@ -11,7 +11,7 @@
#include <uhdlib/utils/atomic.hpp>
#include <uhdlib/transport/udp_common.hpp>
#include <boost/format.hpp>
-#include <boost/make_shared.hpp>
+#include <memory>
#include <chrono>
#include <thread>
#include <vector>
@@ -133,7 +133,7 @@ tcp_zero_copy::~tcp_zero_copy(void)
class tcp_zero_copy_asio_impl : public tcp_zero_copy
{
public:
- typedef boost::shared_ptr<tcp_zero_copy_asio_impl> sptr;
+ typedef std::shared_ptr<tcp_zero_copy_asio_impl> sptr;
tcp_zero_copy_asio_impl(
const std::string& addr, const std::string& port, const device_addr_t& hints)
@@ -169,13 +169,13 @@ public:
// allocate re-usable managed receive buffers
for (size_t i = 0; i < get_num_recv_frames(); i++) {
- _mrb_pool.push_back(boost::make_shared<tcp_zero_copy_asio_mrb>(
+ _mrb_pool.push_back(std::make_shared<tcp_zero_copy_asio_mrb>(
_recv_buffer_pool->at(i), _sock_fd, 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::make_shared<tcp_zero_copy_asio_msb>(
+ _msb_pool.push_back(std::make_shared<tcp_zero_copy_asio_msb>(
_send_buffer_pool->at(i), _sock_fd, get_send_frame_size()));
}
}
@@ -225,13 +225,13 @@ private:
const size_t _recv_frame_size, _num_recv_frames;
const size_t _send_frame_size, _num_send_frames;
buffer_pool::sptr _recv_buffer_pool, _send_buffer_pool;
- std::vector<boost::shared_ptr<tcp_zero_copy_asio_msb>> _msb_pool;
- std::vector<boost::shared_ptr<tcp_zero_copy_asio_mrb>> _mrb_pool;
+ std::vector<std::shared_ptr<tcp_zero_copy_asio_msb>> _msb_pool;
+ std::vector<std::shared_ptr<tcp_zero_copy_asio_mrb>> _mrb_pool;
size_t _next_recv_buff_index, _next_send_buff_index;
// asio guts -> socket and service
asio::io_service _io_service;
- boost::shared_ptr<asio::ip::tcp::socket> _socket;
+ std::shared_ptr<asio::ip::tcp::socket> _socket;
int _sock_fd;
};