diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-09-28 12:54:27 +0200 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 12:21:32 -0800 |
commit | fcc2e9c602a6103dfd0f75e035f614b177c5dc35 (patch) | |
tree | 8c6162ab134a79f343b8404f1d82b6bd9483d116 | |
parent | 0c43030e71f4786bf1ba1b7f08abf6b3d019761f (diff) | |
download | uhd-fcc2e9c602a6103dfd0f75e035f614b177c5dc35.tar.gz uhd-fcc2e9c602a6103dfd0f75e035f614b177c5dc35.tar.bz2 uhd-fcc2e9c602a6103dfd0f75e035f614b177c5dc35.zip |
uhd: Replace boost::function with std::function
This is mostly a search-and-replace operation, with few exceptions:
- boost::function has a clear() method. In C++11, this is achieved by
assigning nullptr to the std::function object.
- The empty() method is replaced by std::function's bool() operator
28 files changed, 71 insertions, 66 deletions
diff --git a/host/examples/rfnoc_rx_to_file.cpp b/host/examples/rfnoc_rx_to_file.cpp index 7908b2ef6..2211831aa 100644 --- a/host/examples/rfnoc_rx_to_file.cpp +++ b/host/examples/rfnoc_rx_to_file.cpp @@ -176,7 +176,7 @@ void recv_to_file(uhd::rx_streamer::sptr rx_stream, } } -typedef boost::function<uhd::sensor_value_t(const std::string&)> get_sensor_fn_t; +typedef std::function<uhd::sensor_value_t(const std::string&)> get_sensor_fn_t; bool check_locked_sensor(std::vector<std::string> sensor_names, const char* sensor_name, diff --git a/host/include/uhd/convert.hpp b/host/include/uhd/convert.hpp index 4d84fcdaa..b94c46851 100644 --- a/host/include/uhd/convert.hpp +++ b/host/include/uhd/convert.hpp @@ -10,7 +10,7 @@ #include <uhd/config.hpp> #include <uhd/types/ref_vector.hpp> -#include <boost/function.hpp> +#include <functional> #include <boost/operators.hpp> #include <memory> #include <string> @@ -51,7 +51,7 @@ private: }; //! Conversion factory function typedef -typedef boost::function<converter::sptr(void)> function_type; +typedef std::function<converter::sptr(void)> function_type; //! Priority of conversion routines typedef int priority_type; diff --git a/host/include/uhd/device.hpp b/host/include/uhd/device.hpp index 11bedf216..f4594504d 100644 --- a/host/include/uhd/device.hpp +++ b/host/include/uhd/device.hpp @@ -13,7 +13,7 @@ #include <uhd/stream.hpp> #include <uhd/types/device_addr.hpp> #include <uhd/utils/noncopyable.hpp> -#include <boost/function.hpp> +#include <functional> #include <memory> namespace uhd { @@ -28,8 +28,8 @@ class UHD_API device : uhd::noncopyable { public: typedef std::shared_ptr<device> sptr; - typedef boost::function<device_addrs_t(const device_addr_t&)> find_t; - typedef boost::function<sptr(const device_addr_t&)> make_t; + typedef std::function<device_addrs_t(const device_addr_t&)> find_t; + typedef std::function<sptr(const device_addr_t&)> make_t; //! Device type, used as a filter in make enum device_filter_t { ANY, USRP, CLOCK }; diff --git a/host/include/uhd/image_loader.hpp b/host/include/uhd/image_loader.hpp index ba1ab7454..d3f9f5445 100644 --- a/host/include/uhd/image_loader.hpp +++ b/host/include/uhd/image_loader.hpp @@ -12,7 +12,7 @@ #include <uhd/config.hpp> #include <uhd/types/device_addr.hpp> #include <uhd/utils/noncopyable.hpp> -#include <boost/function.hpp> +#include <functional> #include <string> namespace uhd { @@ -50,7 +50,7 @@ public: * device and expect the default image(s) to be loaded, but the specific * model of the device cannot be determined beyond a category. */ - typedef boost::function<bool(const image_loader_args_t&)> loader_fcn_t; + typedef std::function<bool(const image_loader_args_t&)> loader_fcn_t; //! Register an image loader /*! diff --git a/host/include/uhd/property_tree.hpp b/host/include/uhd/property_tree.hpp index 4a839f8e9..9e4bcd57a 100644 --- a/host/include/uhd/property_tree.hpp +++ b/host/include/uhd/property_tree.hpp @@ -11,7 +11,7 @@ #include <uhd/config.hpp> #include <uhd/utils/noncopyable.hpp> -#include <boost/function.hpp> +#include <functional> #include <memory> #include <typeindex> #include <vector> @@ -70,9 +70,9 @@ template <typename T> class property : uhd::noncopyable { public: - typedef boost::function<void(const T&)> subscriber_type; - typedef boost::function<T(void)> publisher_type; - typedef boost::function<T(const T&)> coercer_type; + typedef std::function<void(const T&)> subscriber_type; + typedef std::function<T(void)> publisher_type; + typedef std::function<T(const T&)> coercer_type; virtual ~property<T>(void) = 0; diff --git a/host/include/uhd/property_tree.ipp b/host/include/uhd/property_tree.ipp index 73b3c737a..7a4ffd85a 100644 --- a/host/include/uhd/property_tree.ipp +++ b/host/include/uhd/property_tree.ipp @@ -37,8 +37,9 @@ public: property<T>& set_coercer(const typename property<T>::coercer_type& coercer) { - if (not _coercer.empty()) + if (_coercer) { uhd::assertion_error("cannot register more than one coercer for a property"); + } if (_coerce_mode == property_tree::MANUAL_COERCE) uhd::assertion_error( "cannot register coercer for a manually coerced property"); @@ -49,9 +50,10 @@ public: property<T>& set_publisher(const typename property<T>::publisher_type& publisher) { - if (not _publisher.empty()) + if (_publisher) { uhd::assertion_error( "cannot register more than one publisher for a property"); + } _publisher = publisher; return *this; @@ -91,7 +93,7 @@ public: for (typename property<T>::subscriber_type& dsub : _desired_subscribers) { dsub(get_value_ref(_value)); // let errors propagate } - if (not _coercer.empty()) { + if (_coercer) { _set_coerced(_coercer(get_value_ref(_value))); } else { if (_coerce_mode == property_tree::AUTO_COERCE) @@ -113,7 +115,7 @@ public: if (empty()) { throw uhd::runtime_error("Cannot get() on an uninitialized (empty) property"); } - if (not _publisher.empty()) { + if (_publisher) { return _publisher(); } else { if (_coerced_value.get() == NULL @@ -135,7 +137,7 @@ public: bool empty(void) const { - return _publisher.empty() and _value.get() == NULL; + return !bool(_publisher) and _value.get() == NULL; } private: diff --git a/host/include/uhd/transport/bounded_buffer.ipp b/host/include/uhd/transport/bounded_buffer.ipp index 4db182508..d1058756d 100644 --- a/host/include/uhd/transport/bounded_buffer.ipp +++ b/host/include/uhd/transport/bounded_buffer.ipp @@ -12,7 +12,7 @@ #include <uhd/utils/noncopyable.hpp> #include <boost/bind.hpp> #include <boost/utility.hpp> -#include <boost/function.hpp> +#include <functional> #include <boost/circular_buffer.hpp> #include <boost/thread/condition.hpp> #include <boost/thread/locks.hpp> @@ -133,7 +133,7 @@ namespace uhd{ namespace transport{ bool not_full(void) const{return not _buffer.full();} bool not_empty(void) const{return not _buffer.empty();} - boost::function<bool(void)> _not_full_fcn, _not_empty_fcn; + std::function<bool(void)> _not_full_fcn, _not_empty_fcn; /*! * Three part operation to pop an element: diff --git a/host/include/uhd/transport/muxed_zero_copy_if.hpp b/host/include/uhd/transport/muxed_zero_copy_if.hpp index 61086fbba..b2527db10 100644 --- a/host/include/uhd/transport/muxed_zero_copy_if.hpp +++ b/host/include/uhd/transport/muxed_zero_copy_if.hpp @@ -11,7 +11,7 @@ #include <uhd/config.hpp> #include <uhd/transport/zero_copy.hpp> #include <stdint.h> -#include <boost/function.hpp> +#include <functional> #include <uhd/utils/noncopyable.hpp> namespace uhd { namespace transport { @@ -40,7 +40,7 @@ public: * \param size number of bytes in the frame payload * \return stream number */ - typedef boost::function<uint32_t(void* buff, size_t size)> stream_classifier_fn; + typedef std::function<uint32_t(void* buff, size_t size)> stream_classifier_fn; //! virtual dtor virtual ~muxed_zero_copy_if() {} diff --git a/host/include/uhd/transport/zero_copy_flow_ctrl.hpp b/host/include/uhd/transport/zero_copy_flow_ctrl.hpp index f12aed2a9..4028e2e1d 100644 --- a/host/include/uhd/transport/zero_copy_flow_ctrl.hpp +++ b/host/include/uhd/transport/zero_copy_flow_ctrl.hpp @@ -10,7 +10,7 @@ #include <uhd/config.hpp> #include <uhd/transport/zero_copy.hpp> -#include <boost/function.hpp> +#include <functional> #include <memory> namespace uhd { namespace transport { @@ -20,7 +20,7 @@ namespace uhd { namespace transport { * \param buff buffer to be sent or receive buffer being released * \return true if OK, false if not */ -typedef boost::function<bool(managed_buffer::sptr buff)> flow_ctrl_func; +typedef std::function<bool(managed_buffer::sptr buff)> flow_ctrl_func; /*! * Adds flow control to any zero_copy_if transport. diff --git a/host/include/uhd/utils/gain_group.hpp b/host/include/uhd/utils/gain_group.hpp index 8fe69441f..bfc6a94a6 100644 --- a/host/include/uhd/utils/gain_group.hpp +++ b/host/include/uhd/utils/gain_group.hpp @@ -11,7 +11,7 @@ #include <uhd/config.hpp> #include <uhd/types/ranges.hpp> #include <uhd/utils/noncopyable.hpp> -#include <boost/function.hpp> +#include <functional> #include <memory> #include <string> #include <vector> @@ -23,9 +23,9 @@ namespace uhd { */ struct UHD_API gain_fcns_t { - boost::function<gain_range_t(void)> get_range; - boost::function<double(void)> get_value; - boost::function<void(double)> set_value; + std::function<gain_range_t(void)> get_range; + std::function<double(void)> get_value; + std::function<void(double)> set_value; }; class UHD_API gain_group : uhd::noncopyable diff --git a/host/include/uhd/utils/msg_task.hpp b/host/include/uhd/utils/msg_task.hpp index fd08523f7..9b8b5b23d 100644 --- a/host/include/uhd/utils/msg_task.hpp +++ b/host/include/uhd/utils/msg_task.hpp @@ -1,6 +1,7 @@ // // Copyright 2011-2015 Ettus Research LLC // Copyright 2018 Ettus Research, a National Instruments Company +// Copyright 2019 Ettus Research, a National Instruments Brand // // SPDX-License-Identifier: GPL-3.0-or-later // @@ -10,11 +11,12 @@ #include <uhd/config.hpp> #include <uhd/transport/zero_copy.hpp> +#include <uhd/utils/noncopyable.hpp> #include <stdint.h> -#include <boost/function.hpp> #include <boost/optional/optional.hpp> +#include <cstring> +#include <functional> #include <memory> -#include <uhd/utils/noncopyable.hpp> #include <vector> namespace uhd { @@ -24,7 +26,7 @@ public: typedef std::shared_ptr<msg_task> sptr; typedef std::vector<uint8_t> msg_payload_t; typedef std::pair<uint32_t, msg_payload_t> msg_type_t; - typedef boost::function<boost::optional<msg_type_t>(void)> task_fcn_type; + typedef std::function<boost::optional<msg_type_t>(void)> task_fcn_type; /* * During shutdown message queues for radio control cores might not be available diff --git a/host/include/uhd/utils/tasks.hpp b/host/include/uhd/utils/tasks.hpp index eaee3edbe..456af25e6 100644 --- a/host/include/uhd/utils/tasks.hpp +++ b/host/include/uhd/utils/tasks.hpp @@ -12,7 +12,7 @@ #include <uhd/config.hpp> #include <uhd/utils/noncopyable.hpp> -#include <boost/function.hpp> +#include <functional> #include <memory> #include <string> @@ -22,7 +22,7 @@ class UHD_API task : uhd::noncopyable { public: typedef std::shared_ptr<task> sptr; - typedef boost::function<void(void)> task_fcn_type; + typedef std::function<void(void)> task_fcn_type; /*! * Create a new task object with function callback. diff --git a/host/lib/convert/gen_convert_general.py b/host/lib/convert/gen_convert_general.py index 1b1106d4c..19d699cd2 100644 --- a/host/lib/convert/gen_convert_general.py +++ b/host/lib/convert/gen_convert_general.py @@ -20,6 +20,7 @@ TMPL_HEADER = """ #include "convert_common.hpp" #include <uhd/utils/byteswap.hpp> #include <algorithm> +#include <cstring> using namespace uhd::convert; diff --git a/host/lib/experts/expert_container.cpp b/host/lib/experts/expert_container.cpp index 33412cb6f..3a1e54ae4 100644 --- a/host/lib/experts/expert_container.cpp +++ b/host/lib/experts/expert_container.cpp @@ -10,7 +10,7 @@ #include <uhdlib/experts/expert_container.hpp> #include <boost/bind.hpp> #include <boost/format.hpp> -#include <boost/function.hpp> +#include <functional> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/depth_first_search.hpp> #include <boost/graph/graph_traits.hpp> diff --git a/host/lib/include/uhdlib/experts/expert_nodes.hpp b/host/lib/include/uhdlib/experts/expert_nodes.hpp index d1f38ac07..665c0e579 100644 --- a/host/lib/include/uhdlib/experts/expert_nodes.hpp +++ b/host/lib/include/uhdlib/experts/expert_nodes.hpp @@ -13,7 +13,7 @@ #include <uhd/utils/dirty_tracked.hpp> #include <uhd/utils/noncopyable.hpp> #include <uhd/types/time_spec.hpp> -#include <boost/function.hpp> +#include <functional> #include <boost/thread/recursive_mutex.hpp> #include <boost/thread.hpp> #include <boost/core/demangle.hpp> @@ -36,7 +36,7 @@ namespace uhd { namespace experts { */ class dag_vertex_t : private uhd::noncopyable { public: - typedef boost::function<void(std::string)> callback_func_t; + typedef std::function<void(std::string)> callback_func_t; virtual ~dag_vertex_t() {} @@ -195,11 +195,11 @@ namespace uhd { namespace experts { } virtual bool has_write_callback() const { - return not _wr_callback.empty(); + return bool(_wr_callback); } virtual void clear_write_callback() { - _wr_callback.clear(); + _wr_callback = nullptr; } virtual void set_read_callback(const callback_func_t& func) { @@ -207,11 +207,11 @@ namespace uhd { namespace experts { } virtual bool has_read_callback() const { - return not _rd_callback.empty(); + return bool(_rd_callback); } virtual void clear_read_callback() { - _rd_callback.clear(); + _rd_callback = nullptr; } boost::recursive_mutex* _callback_mutex; diff --git a/host/lib/include/uhdlib/usrp/common/adf435x.hpp b/host/lib/include/uhdlib/usrp/common/adf435x.hpp index 6f654bcbb..886c8d335 100644 --- a/host/lib/include/uhdlib/usrp/common/adf435x.hpp +++ b/host/lib/include/uhdlib/usrp/common/adf435x.hpp @@ -15,7 +15,7 @@ #include <uhd/types/ranges.hpp> #include <uhd/utils/log.hpp> #include <uhdlib/utils/math.hpp> -#include <boost/function.hpp> +#include <functional> #include <boost/math/special_functions/round.hpp> #include <boost/thread.hpp> #include <vector> @@ -24,7 +24,7 @@ class adf435x_iface { public: typedef std::shared_ptr<adf435x_iface> sptr; - typedef boost::function<void(std::vector<uint32_t>)> write_fn_t; + typedef std::function<void(std::vector<uint32_t>)> write_fn_t; static sptr make_adf4350(write_fn_t write); static sptr make_adf4351(write_fn_t write); diff --git a/host/lib/include/uhdlib/usrp/common/adf535x.hpp b/host/lib/include/uhdlib/usrp/common/adf535x.hpp index bc3c445bb..c42f05b57 100644 --- a/host/lib/include/uhdlib/usrp/common/adf535x.hpp +++ b/host/lib/include/uhdlib/usrp/common/adf535x.hpp @@ -15,7 +15,7 @@ #include <uhd/utils/safe_call.hpp> #include <stdint.h> #include <boost/format.hpp> -#include <boost/function.hpp> +#include <functional> #include <algorithm> #include <iomanip> #include <utility> diff --git a/host/lib/include/uhdlib/usrp/common/lmx2592.hpp b/host/lib/include/uhdlib/usrp/common/lmx2592.hpp index a754fa63d..9ee3f944f 100644 --- a/host/lib/include/uhdlib/usrp/common/lmx2592.hpp +++ b/host/lib/include/uhdlib/usrp/common/lmx2592.hpp @@ -12,7 +12,7 @@ #include <uhd/utils/math.hpp> #include <uhd/utils/safe_call.hpp> #include <boost/format.hpp> -#include <boost/function.hpp> +#include <functional> #include <algorithm> #include <cstdint> #include <utility> diff --git a/host/lib/include/uhdlib/usrp/common/max287x.hpp b/host/lib/include/uhdlib/usrp/common/max287x.hpp index 51c22c5d8..08ee5b16d 100644 --- a/host/lib/include/uhdlib/usrp/common/max287x.hpp +++ b/host/lib/include/uhdlib/usrp/common/max287x.hpp @@ -17,7 +17,7 @@ #include <uhd/utils/math.hpp> #include <uhd/utils/safe_call.hpp> #include <boost/assign.hpp> -#include <boost/function.hpp> +#include <functional> #include <boost/math/special_functions/round.hpp> #include <vector> #include <chrono> @@ -32,7 +32,7 @@ class max287x_iface public: typedef std::shared_ptr<max287x_iface> sptr; - typedef boost::function<void(std::vector<uint32_t>)> write_fn; + typedef std::function<void(std::vector<uint32_t>)> write_fn; /** * LD Pin Modes diff --git a/host/lib/include/uhdlib/utils/ihex.hpp b/host/lib/include/uhdlib/utils/ihex.hpp index 4b1be77f1..9cb204280 100644 --- a/host/lib/include/uhdlib/utils/ihex.hpp +++ b/host/lib/include/uhdlib/utils/ihex.hpp @@ -9,7 +9,7 @@ #define INCLUDED_IHEX_READER_HPP #include <boost/bind.hpp> -#include <boost/function.hpp> +#include <functional> #include <stdint.h> #include <string> #include <vector> @@ -20,7 +20,7 @@ class ihex_reader { public: // Arguments are: lower address bits, upper address bits, buff, length - typedef boost::function<int(uint16_t,uint16_t,unsigned char*,uint16_t)> record_handle_type; + typedef std::function<int(uint16_t,uint16_t,unsigned char*,uint16_t)> record_handle_type; /* * \param ihex_filename Path to the *.ihx file diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp index fbeddbcdd..356d247cb 100644 --- a/host/lib/transport/libusb1_zero_copy.cpp +++ b/host/lib/transport/libusb1_zero_copy.cpp @@ -15,7 +15,7 @@ #include <boost/bind.hpp> #include <boost/circular_buffer.hpp> #include <boost/format.hpp> -#include <boost/function.hpp> +#include <functional> #include <memory> #include <boost/thread/condition_variable.hpp> #include <boost/thread/mutex.hpp> @@ -115,7 +115,7 @@ class libusb_zero_copy_mb : public managed_buffer public: libusb_zero_copy_mb(libusb_transfer* lut, const size_t frame_size, - boost::function<void(libusb_zero_copy_mb*)> release_cb, + std::function<void(libusb_zero_copy_mb*)> release_cb, const bool is_recv, const std::string& name) : _release_cb(release_cb) @@ -192,7 +192,7 @@ public: } private: - boost::function<void(libusb_zero_copy_mb*)> _release_cb; + std::function<void(libusb_zero_copy_mb*)> _release_cb; const bool _is_recv; const std::string _name; libusb_context* _ctx; diff --git a/host/lib/transport/super_recv_packet_handler.hpp b/host/lib/transport/super_recv_packet_handler.hpp index a09281459..b19b50b38 100644 --- a/host/lib/transport/super_recv_packet_handler.hpp +++ b/host/lib/transport/super_recv_packet_handler.hpp @@ -20,7 +20,7 @@ #include <uhd/utils/tasks.hpp> #include <boost/dynamic_bitset.hpp> #include <boost/format.hpp> -#include <boost/function.hpp> +#include <functional> #include <memory> #include <iostream> #include <vector> @@ -36,7 +36,7 @@ UHD_INLINE uint32_t get_context_code( return word0 & 0xff; } -typedef boost::function<void(void)> handle_overflow_type; +typedef std::function<void(void)> handle_overflow_type; static inline void handle_overflow_nop(void) {} /*********************************************************************** @@ -49,12 +49,12 @@ static inline void handle_overflow_nop(void) {} class recv_packet_handler { public: - typedef boost::function<managed_recv_buffer::sptr(double)> get_buff_type; - typedef boost::function<void(const size_t)> handle_flowctrl_type; + typedef std::function<managed_recv_buffer::sptr(double)> get_buff_type; + typedef std::function<void(const size_t)> handle_flowctrl_type; typedef std::function<void(const uint32_t*)> handle_flowctrl_ack_type; - typedef boost::function<void(const stream_cmd_t&)> issue_stream_cmd_type; + typedef std::function<void(const stream_cmd_t&)> issue_stream_cmd_type; typedef void (*vrt_unpacker_type)(const uint32_t*, vrt::if_packet_info_t&); - // typedef boost::function<void(const uint32_t *, vrt::if_packet_info_t &)> + // typedef std::function<void(const uint32_t *, vrt::if_packet_info_t &)> // vrt_unpacker_type; /*! diff --git a/host/lib/transport/super_send_packet_handler.hpp b/host/lib/transport/super_send_packet_handler.hpp index 40ca2e414..21f7357c3 100644 --- a/host/lib/transport/super_send_packet_handler.hpp +++ b/host/lib/transport/super_send_packet_handler.hpp @@ -18,7 +18,7 @@ #include <uhd/utils/byteswap.hpp> #include <uhd/utils/tasks.hpp> #include <uhd/utils/thread.hpp> -#include <boost/function.hpp> +#include <functional> #include <chrono> #include <iostream> #include <thread> diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp index 3d45824e4..462f330e6 100644 --- a/host/lib/usrp/usrp1/io_impl.cpp +++ b/host/lib/usrp/usrp1/io_impl.cpp @@ -76,7 +76,7 @@ struct offset_send_buffer{ **********************************************************************/ class offset_managed_send_buffer : public managed_send_buffer{ public: - typedef boost::function<void(offset_send_buffer&, offset_send_buffer&, size_t)> commit_cb_type; + typedef std::function<void(offset_send_buffer&, offset_send_buffer&, size_t)> commit_cb_type; offset_managed_send_buffer(const commit_cb_type &commit_cb): _commit_cb(commit_cb) { @@ -366,7 +366,7 @@ private: **********************************************************************/ class usrp1_send_packet_streamer : public sph::send_packet_handler, public tx_streamer{ public: - usrp1_send_packet_streamer(const size_t max_num_samps, soft_time_ctrl::sptr stc, boost::function<void(bool)> tx_enb_fcn){ + usrp1_send_packet_streamer(const size_t max_num_samps, soft_time_ctrl::sptr stc, std::function<void(bool)> tx_enb_fcn){ _max_num_samps = max_num_samps; this->set_max_samples_per_packet(_max_num_samps); _stc = stc; @@ -419,7 +419,7 @@ public: private: size_t _max_num_samps; soft_time_ctrl::sptr _stc; - boost::function<void(bool)> _tx_enb_fcn; + std::function<void(bool)> _tx_enb_fcn; }; /*********************************************************************** @@ -687,7 +687,7 @@ tx_streamer::sptr usrp1_impl::get_tx_stream(const uhd::stream_args_t &args_){ const size_t spp = bpp/convert::get_bytes_per_item(args.otw_format); //make the new streamer given the samples per packet - boost::function<void(bool)> tx_fcn = boost::bind(&usrp1_impl::tx_stream_on_off, this, _1); + std::function<void(bool)> tx_fcn = boost::bind(&usrp1_impl::tx_stream_on_off, this, _1); std::shared_ptr<usrp1_send_packet_streamer> my_streamer = std::make_shared<usrp1_send_packet_streamer>(spp, _soft_time_ctrl, tx_fcn); diff --git a/host/lib/usrp/usrp1/soft_time_ctrl.hpp b/host/lib/usrp/usrp1/soft_time_ctrl.hpp index 9143b6af2..48915499a 100644 --- a/host/lib/usrp/usrp1/soft_time_ctrl.hpp +++ b/host/lib/usrp/usrp1/soft_time_ctrl.hpp @@ -14,7 +14,7 @@ #include <uhd/transport/bounded_buffer.hpp> #include <uhd/utils/noncopyable.hpp> #include <memory> -#include <boost/function.hpp> +#include <functional> namespace uhd{ namespace usrp{ @@ -28,7 +28,7 @@ namespace uhd{ namespace usrp{ class soft_time_ctrl : uhd::noncopyable{ public: typedef std::shared_ptr<soft_time_ctrl> sptr; - typedef boost::function<void(bool)> cb_fcn_type; + typedef std::function<void(bool)> cb_fcn_type; virtual ~soft_time_ctrl(void) = 0; diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp index d965b4e24..efc0644db 100644 --- a/host/lib/usrp/usrp2/io_impl.cpp +++ b/host/lib/usrp/usrp2/io_impl.cpp @@ -113,7 +113,7 @@ private: boost::condition _fc_cond; seq_type _last_seq_out, _last_seq_ack; const seq_type _max_seqs_out; - boost::function<bool(void)> _ready_fcn; + std::function<bool(void)> _ready_fcn; }; /*********************************************************************** diff --git a/host/lib/usrp/usrp2/usrp2_iface.hpp b/host/lib/usrp/usrp2/usrp2_iface.hpp index 2752d1a28..b602dab53 100644 --- a/host/lib/usrp/usrp2/usrp2_iface.hpp +++ b/host/lib/usrp/usrp2/usrp2_iface.hpp @@ -13,7 +13,7 @@ #include <uhd/usrp/mboard_eeprom.hpp> #include <memory> #include <boost/utility.hpp> -#include <boost/function.hpp> +#include <functional> #include "usrp2_regs.hpp" #include <uhd/types/wb_iface.hpp> #include <string> diff --git a/host/lib/usrp/usrp2/usrp2_impl.hpp b/host/lib/usrp/usrp2/usrp2_impl.hpp index 14a3ae8d6..9e4e507de 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.hpp +++ b/host/lib/usrp/usrp2/usrp2_impl.hpp @@ -33,7 +33,7 @@ #include <uhd/usrp/dboard_manager.hpp> #include <uhd/usrp/subdev_spec.hpp> #include <memory> -#include <boost/function.hpp> +#include <functional> #include <atomic> static const double USRP2_LINK_RATE_BPS = 1000e6/8; |