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 /host/lib/include/uhdlib | |
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
Diffstat (limited to 'host/lib/include/uhdlib')
-rw-r--r-- | host/lib/include/uhdlib/experts/expert_nodes.hpp | 12 | ||||
-rw-r--r-- | host/lib/include/uhdlib/usrp/common/adf435x.hpp | 4 | ||||
-rw-r--r-- | host/lib/include/uhdlib/usrp/common/adf535x.hpp | 2 | ||||
-rw-r--r-- | host/lib/include/uhdlib/usrp/common/lmx2592.hpp | 2 | ||||
-rw-r--r-- | host/lib/include/uhdlib/usrp/common/max287x.hpp | 4 | ||||
-rw-r--r-- | host/lib/include/uhdlib/utils/ihex.hpp | 4 |
6 files changed, 14 insertions, 14 deletions
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 |