aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp_clock
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_clock
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_clock')
-rw-r--r--host/lib/usrp_clock/octoclock/octoclock_impl.cpp38
1 files changed, 16 insertions, 22 deletions
diff --git a/host/lib/usrp_clock/octoclock/octoclock_impl.cpp b/host/lib/usrp_clock/octoclock/octoclock_impl.cpp
index f3cf3f4ea..a1891c7bd 100644
--- a/host/lib/usrp_clock/octoclock/octoclock_impl.cpp
+++ b/host/lib/usrp_clock/octoclock/octoclock_impl.cpp
@@ -5,31 +5,25 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
-#include <iostream>
-
-#include <boost/asio.hpp>
-#include <boost/assign.hpp>
-#include <stdint.h>
-#include <boost/filesystem.hpp>
-#include <boost/format.hpp>
-#include <boost/thread.hpp>
-
+#include "octoclock_impl.hpp"
+#include "common.h"
+#include "octoclock_uart.hpp"
#include <uhd/device.hpp>
#include <uhd/exception.hpp>
-#include <uhd/transport/udp_simple.hpp>
#include <uhd/transport/if_addrs.hpp>
+#include <uhd/transport/udp_simple.hpp>
#include <uhd/types/dict.hpp>
#include <uhd/usrp/gps_ctrl.hpp>
#include <uhd/usrp_clock/octoclock_eeprom.hpp>
#include <uhd/utils/byteswap.hpp>
-#include <uhd/utils/paths.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/paths.hpp>
#include <uhd/utils/static.hpp>
-
-#include "octoclock_impl.hpp"
-#include "octoclock_uart.hpp"
-#include "common.h"
+#include <stdint.h>
+#include <boost/asio.hpp>
+#include <boost/assign.hpp>
+#include <boost/filesystem.hpp>
+#include <boost/format.hpp>
using namespace uhd;
using namespace uhd::usrp_clock;
@@ -232,21 +226,21 @@ octoclock_impl::octoclock_impl(const device_addr_t &_device_addr){
_oc_dict[oc].eeprom = octoclock_eeprom_t(_oc_dict[oc].ctrl_xport, _proto_ver);
_tree->create<octoclock_eeprom_t>(oc_path / "eeprom")
.set(_oc_dict[oc].eeprom)
- .add_coerced_subscriber(boost::bind(&octoclock_impl::_set_eeprom, this, oc, _1));
+ .add_coerced_subscriber(std::bind(&octoclock_impl::_set_eeprom, this, oc, std::placeholders::_1));
////////////////////////////////////////////////////////////////////
// Initialize non-GPSDO sensors
////////////////////////////////////////////////////////////////////
_tree->create<uint32_t>(oc_path / "time")
- .set_publisher(boost::bind(&octoclock_impl::_get_time, this, oc));
+ .set_publisher(std::bind(&octoclock_impl::_get_time, this, oc));
_tree->create<sensor_value_t>(oc_path / "sensors/ext_ref_detected")
- .set_publisher(boost::bind(&octoclock_impl::_ext_ref_detected, this, oc));
+ .set_publisher(std::bind(&octoclock_impl::_ext_ref_detected, this, oc));
_tree->create<sensor_value_t>(oc_path / "sensors/gps_detected")
- .set_publisher(boost::bind(&octoclock_impl::_gps_detected, this, oc));
+ .set_publisher(std::bind(&octoclock_impl::_gps_detected, this, oc));
_tree->create<sensor_value_t>(oc_path / "sensors/using_ref")
- .set_publisher(boost::bind(&octoclock_impl::_which_ref, this, oc));
+ .set_publisher(std::bind(&octoclock_impl::_which_ref, this, oc));
_tree->create<sensor_value_t>(oc_path / "sensors/switch_pos")
- .set_publisher(boost::bind(&octoclock_impl::_switch_pos, this, oc));
+ .set_publisher(std::bind(&octoclock_impl::_switch_pos, this, oc));
////////////////////////////////////////////////////////////////////
// Check reference and GPSDO
@@ -266,7 +260,7 @@ octoclock_impl::octoclock_impl(const device_addr_t &_device_addr){
if(_oc_dict[oc].gps and _oc_dict[oc].gps->gps_detected()){
for(const std::string &name: _oc_dict[oc].gps->get_sensors()){
_tree->create<sensor_value_t>(oc_path / "sensors" / name)
- .set_publisher(boost::bind(&gps_ctrl::get_sensor, _oc_dict[oc].gps, name));
+ .set_publisher(std::bind(&gps_ctrl::get_sensor, _oc_dict[oc].gps, name));
}
}
else{