aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/cores
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-10-16 16:21:19 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 12:21:32 -0800
commitd3a16b702230534f7265613a73204bdb051a458e (patch)
tree5cd9ace71b187aa2c5d8deb5904b14db28dc7c70 /host/lib/usrp/cores
parentdc698b990d368dfb8641b68dbe32a90079b7bd90 (diff)
downloaduhd-d3a16b702230534f7265613a73204bdb051a458e.tar.gz
uhd-d3a16b702230534f7265613a73204bdb051a458e.tar.bz2
uhd-d3a16b702230534f7265613a73204bdb051a458e.zip
uhd: Replace all occurrences of boost::bind with std::bind
Note: Replacing everything with a lambda would be even better, but that can't be easily scripted so we'll do this as a first step to reduce the Boost footprint. This also removes occurences of #include <boost/bind.hpp>, and makes sure all usages of std::bind have an #include <functional>. clang-format wasn't always applied to minimize the changeset in this commit, however, it was applied to the blocks of #includes. Due to conflicts with other Boost libraries, the placeholders _1, _2, etc. could not be directly used, but had to be explicitly called out (as std::placeholders::_1, etc.). This makes the use of std::bind even uglier, which serves as another reminder that using std::bind (and even more so, boost::bind) should be avoided. nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It was not possible to remove it by simply doing a search and replace, so it will be removed in a separate commit.
Diffstat (limited to 'host/lib/usrp/cores')
-rw-r--r--host/lib/usrp/cores/radio_ctrl_core_3000.cpp2
-rw-r--r--host/lib/usrp/cores/rx_dsp_core_3000.cpp10
-rw-r--r--host/lib/usrp/cores/rx_frontend_core_200.cpp10
-rw-r--r--host/lib/usrp/cores/rx_frontend_core_3000.cpp8
-rw-r--r--host/lib/usrp/cores/tx_dsp_core_3000.cpp10
-rw-r--r--host/lib/usrp/cores/tx_frontend_core_200.cpp6
6 files changed, 23 insertions, 23 deletions
diff --git a/host/lib/usrp/cores/radio_ctrl_core_3000.cpp b/host/lib/usrp/cores/radio_ctrl_core_3000.cpp
index fe4a01b35..15226e8c4 100644
--- a/host/lib/usrp/cores/radio_ctrl_core_3000.cpp
+++ b/host/lib/usrp/cores/radio_ctrl_core_3000.cpp
@@ -16,7 +16,7 @@
#include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp>
#include <boost/format.hpp>
-#include <boost/bind.hpp>
+#include <functional>
#include <queue>
using namespace uhd;
diff --git a/host/lib/usrp/cores/rx_dsp_core_3000.cpp b/host/lib/usrp/cores/rx_dsp_core_3000.cpp
index 46fce3f69..d9ad108aa 100644
--- a/host/lib/usrp/cores/rx_dsp_core_3000.cpp
+++ b/host/lib/usrp/cores/rx_dsp_core_3000.cpp
@@ -14,9 +14,9 @@
#include <uhdlib/usrp/cores/rx_dsp_core_3000.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/math/special_functions/round.hpp>
-#include <boost/thread/thread.hpp> //thread sleep
#include <algorithm>
#include <cmath>
+#include <functional>
#define REG_DSP_RX_FREQ _dsp_base + 0
#define REG_DSP_RX_SCALE_IQ _dsp_base + 4
@@ -297,16 +297,16 @@ public:
void populate_subtree(property_tree::sptr subtree)
{
subtree->create<meta_range_t>("rate/range")
- .set_publisher(boost::bind(&rx_dsp_core_3000::get_host_rates, this));
+ .set_publisher(std::bind(&rx_dsp_core_3000::get_host_rates, this));
subtree->create<double>("rate/value")
.set(DEFAULT_RATE)
- .set_coercer(boost::bind(&rx_dsp_core_3000::set_host_rate, this, _1));
+ .set_coercer(std::bind(&rx_dsp_core_3000::set_host_rate, this, std::placeholders::_1));
subtree->create<double>("freq/value")
.set(DEFAULT_CORDIC_FREQ)
- .set_coercer(boost::bind(&rx_dsp_core_3000::set_freq, this, _1))
+ .set_coercer(std::bind(&rx_dsp_core_3000::set_freq, this, std::placeholders::_1))
.set_publisher([this]() { return this->get_freq(); });
subtree->create<meta_range_t>("freq/range")
- .set_publisher(boost::bind(&rx_dsp_core_3000::get_freq_range, this));
+ .set_publisher(std::bind(&rx_dsp_core_3000::get_freq_range, this));
}
private:
diff --git a/host/lib/usrp/cores/rx_frontend_core_200.cpp b/host/lib/usrp/cores/rx_frontend_core_200.cpp
index f0556e4b0..f30da9466 100644
--- a/host/lib/usrp/cores/rx_frontend_core_200.cpp
+++ b/host/lib/usrp/cores/rx_frontend_core_200.cpp
@@ -5,10 +5,10 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
-#include <uhdlib/usrp/cores/rx_frontend_core_200.hpp>
#include <uhd/types/ranges.hpp>
+#include <uhdlib/usrp/cores/rx_frontend_core_200.hpp>
#include <boost/math/special_functions/round.hpp>
-#include <boost/bind.hpp>
+#include <functional>
using namespace uhd;
@@ -82,15 +82,15 @@ public:
;
subtree->create<std::complex<double> >("dc_offset/value")
.set(DEFAULT_DC_OFFSET_VALUE)
- .set_coercer(boost::bind(&rx_frontend_core_200::set_dc_offset, this, _1))
+ .set_coercer(std::bind(&rx_frontend_core_200::set_dc_offset, this, std::placeholders::_1))
;
subtree->create<bool>("dc_offset/enable")
.set(DEFAULT_DC_OFFSET_ENABLE)
- .add_coerced_subscriber(boost::bind(&rx_frontend_core_200::set_dc_offset_auto, this, _1))
+ .add_coerced_subscriber(std::bind(&rx_frontend_core_200::set_dc_offset_auto, this, std::placeholders::_1))
;
subtree->create<std::complex<double> >("iq_balance/value")
.set(DEFAULT_IQ_BALANCE_VALUE)
- .add_coerced_subscriber(boost::bind(&rx_frontend_core_200::set_iq_balance, this, _1))
+ .add_coerced_subscriber(std::bind(&rx_frontend_core_200::set_iq_balance, this, std::placeholders::_1))
;
}
diff --git a/host/lib/usrp/cores/rx_frontend_core_3000.cpp b/host/lib/usrp/cores/rx_frontend_core_3000.cpp
index dfaa4a76c..aa83b83c8 100644
--- a/host/lib/usrp/cores/rx_frontend_core_3000.cpp
+++ b/host/lib/usrp/cores/rx_frontend_core_3000.cpp
@@ -11,8 +11,8 @@
#include <uhdlib/usrp/cores/dsp_core_utils.hpp>
#include <uhdlib/usrp/cores/rx_frontend_core_3000.hpp>
#include <boost/assign/list_of.hpp>
-#include <boost/bind.hpp>
#include <boost/math/special_functions/round.hpp>
+#include <functional>
using namespace uhd;
@@ -177,15 +177,15 @@ public:
.set(meta_range_t(DC_OFFSET_MIN, DC_OFFSET_MAX));
subtree->create<std::complex<double>>("dc_offset/value")
.set(DEFAULT_DC_OFFSET_VALUE)
- .set_coercer(boost::bind(&rx_frontend_core_3000::set_dc_offset, this, _1));
+ .set_coercer(std::bind(&rx_frontend_core_3000::set_dc_offset, this, std::placeholders::_1));
subtree->create<bool>("dc_offset/enable")
.set(DEFAULT_DC_OFFSET_ENABLE)
.add_coerced_subscriber(
- boost::bind(&rx_frontend_core_3000::set_dc_offset_auto, this, _1));
+ std::bind(&rx_frontend_core_3000::set_dc_offset_auto, this, std::placeholders::_1));
subtree->create<std::complex<double>>("iq_balance/value")
.set(DEFAULT_IQ_BALANCE_VALUE)
.add_coerced_subscriber(
- boost::bind(&rx_frontend_core_3000::set_iq_balance, this, _1));
+ std::bind(&rx_frontend_core_3000::set_iq_balance, this, std::placeholders::_1));
}
double get_output_rate()
diff --git a/host/lib/usrp/cores/tx_dsp_core_3000.cpp b/host/lib/usrp/cores/tx_dsp_core_3000.cpp
index be7593841..c89b684fa 100644
--- a/host/lib/usrp/cores/tx_dsp_core_3000.cpp
+++ b/host/lib/usrp/cores/tx_dsp_core_3000.cpp
@@ -13,9 +13,9 @@
#include <uhdlib/usrp/cores/tx_dsp_core_3000.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/math/special_functions/round.hpp>
-#include <boost/thread/thread.hpp> //sleep
#include <algorithm>
#include <cmath>
+#include <functional>
#define REG_DSP_TX_FREQ _dsp_base + 0
#define REG_DSP_TX_SCALE_IQ _dsp_base + 4
@@ -184,16 +184,16 @@ public:
void populate_subtree(property_tree::sptr subtree)
{
subtree->create<meta_range_t>("rate/range")
- .set_publisher(boost::bind(&tx_dsp_core_3000::get_host_rates, this));
+ .set_publisher(std::bind(&tx_dsp_core_3000::get_host_rates, this));
subtree->create<double>("rate/value")
.set(DEFAULT_RATE)
- .set_coercer(boost::bind(&tx_dsp_core_3000::set_host_rate, this, _1));
+ .set_coercer(std::bind(&tx_dsp_core_3000::set_host_rate, this, std::placeholders::_1));
subtree->create<double>("freq/value")
.set(DEFAULT_CORDIC_FREQ)
- .set_coercer(boost::bind(&tx_dsp_core_3000::set_freq, this, _1))
+ .set_coercer(std::bind(&tx_dsp_core_3000::set_freq, this, std::placeholders::_1))
.set_publisher([this]() { return this->get_freq(); });
subtree->create<meta_range_t>("freq/range")
- .set_publisher(boost::bind(&tx_dsp_core_3000::get_freq_range, this));
+ .set_publisher(std::bind(&tx_dsp_core_3000::get_freq_range, this));
}
private:
diff --git a/host/lib/usrp/cores/tx_frontend_core_200.cpp b/host/lib/usrp/cores/tx_frontend_core_200.cpp
index af40d4379..c02ce755a 100644
--- a/host/lib/usrp/cores/tx_frontend_core_200.cpp
+++ b/host/lib/usrp/cores/tx_frontend_core_200.cpp
@@ -11,7 +11,7 @@
#include <uhd/exception.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/math/special_functions/round.hpp>
-#include <boost/bind.hpp>
+#include <functional>
using namespace uhd;
@@ -78,11 +78,11 @@ public:
;
subtree->create< std::complex<double> >("dc_offset/value")
.set(DEFAULT_DC_OFFSET_VALUE)
- .set_coercer(boost::bind(&tx_frontend_core_200::set_dc_offset, this, _1))
+ .set_coercer(std::bind(&tx_frontend_core_200::set_dc_offset, this, std::placeholders::_1))
;
subtree->create< std::complex<double> >("iq_balance/value")
.set(DEFAULT_IQ_BALANCE_VALUE)
- .add_coerced_subscriber(boost::bind(&tx_frontend_core_200::set_iq_balance, this, _1))
+ .add_coerced_subscriber(std::bind(&tx_frontend_core_200::set_iq_balance, this, std::placeholders::_1))
;
}