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/tests/packet_handler_benchmark.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'host/tests/packet_handler_benchmark.cpp') diff --git a/host/tests/packet_handler_benchmark.cpp b/host/tests/packet_handler_benchmark.cpp index d0a28bdc2..bf21b0c2b 100644 --- a/host/tests/packet_handler_benchmark.cpp +++ b/host/tests/packet_handler_benchmark.cpp @@ -56,7 +56,7 @@ struct rx_fc_cache_t }; inline bool rx_flow_ctrl( - boost::shared_ptr fc_cache, uhd::transport::managed_buffer::sptr buff) + std::shared_ptr fc_cache, uhd::transport::managed_buffer::sptr buff) { // If the caller supplied a buffer if (buff) { @@ -92,7 +92,7 @@ inline bool rx_flow_ctrl( } inline void handle_rx_flowctrl_ack( - boost::shared_ptr /*fc_cache*/, const uint32_t* /*payload*/) + std::shared_ptr /*fc_cache*/, const uint32_t* /*payload*/) { // For the benchmark, we should never reach this UHD_THROW_INVALID_CODE_PATH(); @@ -119,7 +119,7 @@ struct tx_fc_cache_t pack; }; -inline bool tx_flow_ctrl(boost::shared_ptr fc_cache, +inline bool tx_flow_ctrl(std::shared_ptr fc_cache, uhd::transport::zero_copy_if::sptr /*xport*/, uhd::transport::managed_buffer::sptr buff) { @@ -151,7 +151,7 @@ inline bool tx_flow_ctrl(boost::shared_ptr fc_cache, return false; } -inline void tx_flow_ctrl_ack(boost::shared_ptr fc_cache, +inline void tx_flow_ctrl_ack(std::shared_ptr fc_cache, uhd::transport::zero_copy_if::sptr /*send_xport*/) { if (not fc_cache->fc_received) { @@ -187,7 +187,7 @@ void benchmark_recv_packet_handler(const size_t spp, const std::string& format) xport->set_reuse_recv_memory(true); // Configure xport flow control - boost::shared_ptr fc_cache(new rx_fc_cache_t()); + std::shared_ptr fc_cache(new rx_fc_cache_t()); fc_cache->to_host = uhd::ntohx; fc_cache->from_host = uhd::htonx; fc_cache->pack = vrt::chdr::if_hdr_pack_be; @@ -201,7 +201,7 @@ void benchmark_recv_packet_handler(const size_t spp, const std::string& format) }); // Create streamer - auto streamer = boost::make_shared(spp); + auto streamer = std::make_shared(spp); streamer->set_tick_rate(1.0); streamer->set_samp_rate(1.0); @@ -260,7 +260,7 @@ void benchmark_send_packet_handler( xport->set_reuse_send_memory(true); // Configure flow control - boost::shared_ptr fc_cache(new tx_fc_cache_t()); + std::shared_ptr fc_cache(new tx_fc_cache_t()); fc_cache->to_host = uhd::ntohx; fc_cache->from_host = uhd::htonx; fc_cache->pack = vrt::chdr::if_hdr_pack_be; @@ -274,7 +274,7 @@ void benchmark_send_packet_handler( 0); // Create streamer - auto streamer = boost::make_shared(spp); + auto streamer = std::make_shared(spp); streamer->set_vrt_packer(&vrt::chdr::if_hdr_pack_be); // Configure converter -- cgit v1.2.3