aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorAndrej Rode <andrej.rode@ettus.com>2017-02-09 23:19:55 -0800
committerMartin Braun <martin.braun@ettus.com>2017-02-10 16:44:33 -0800
commit26cc20847cde543e759aa5cee9a27eaa69c5dd9e (patch)
treeeee102333381e2313af59e725d6b7a06b665161f /host/lib/usrp
parentf3a004faf7d50cbb5564f5e2f67f54ee07e051dd (diff)
downloaduhd-26cc20847cde543e759aa5cee9a27eaa69c5dd9e.tar.gz
uhd-26cc20847cde543e759aa5cee9a27eaa69c5dd9e.tar.bz2
uhd-26cc20847cde543e759aa5cee9a27eaa69c5dd9e.zip
uhd: replace BOOST_FOREACH with C++11 range-based for loop
Note: This is the first commit that uses for-range, and range-based for-loops are now usable for UHD development.
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/b100/b100_impl.cpp14
-rw-r--r--host/lib/usrp/b100/clock_ctrl.cpp3
-rw-r--r--host/lib/usrp/b100/io_impl.cpp4
-rw-r--r--host/lib/usrp/b100/usb_zero_copy_wrapper.cpp1
-rw-r--r--host/lib/usrp/b200/b200_image_loader.cpp5
-rw-r--r--host/lib/usrp/b200/b200_impl.cpp26
-rw-r--r--host/lib/usrp/b200/b200_io_impl.cpp8
-rw-r--r--host/lib/usrp/b200/b200_uart.cpp3
-rw-r--r--host/lib/usrp/common/ad936x_manager.cpp9
-rw-r--r--host/lib/usrp/common/apply_corrections.cpp3
-rw-r--r--host/lib/usrp/common/constrained_device_args.hpp2
-rw-r--r--host/lib/usrp/common/max287x.hpp2
-rw-r--r--host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp1
-rw-r--r--host/lib/usrp/common/validate_subdev_spec.cpp9
-rw-r--r--host/lib/usrp/dboard/db_cbx.cpp2
-rw-r--r--host/lib/usrp/dboard/db_dbsrx.cpp6
-rw-r--r--host/lib/usrp/dboard/db_dbsrx2.cpp2
-rw-r--r--host/lib/usrp/dboard/db_rfx.cpp8
-rw-r--r--host/lib/usrp/dboard/db_sbx_common.cpp4
-rw-r--r--host/lib/usrp/dboard/db_sbx_version3.cpp2
-rw-r--r--host/lib/usrp/dboard/db_sbx_version4.cpp2
-rw-r--r--host/lib/usrp/dboard/db_tvrx.cpp8
-rw-r--r--host/lib/usrp/dboard/db_tvrx2.cpp12
-rw-r--r--host/lib/usrp/dboard/db_twinrx.cpp2
-rw-r--r--host/lib/usrp/dboard/db_ubx.cpp10
-rw-r--r--host/lib/usrp/dboard/db_unknown.cpp3
-rw-r--r--host/lib/usrp/dboard/db_wbx_common.cpp4
-rw-r--r--host/lib/usrp/dboard/db_wbx_version2.cpp2
-rw-r--r--host/lib/usrp/dboard/db_wbx_version3.cpp2
-rw-r--r--host/lib/usrp/dboard/db_wbx_version4.cpp2
-rw-r--r--host/lib/usrp/dboard/db_xcvr2450.cpp4
-rw-r--r--host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp6
-rw-r--r--host/lib/usrp/dboard_eeprom.cpp1
-rw-r--r--host/lib/usrp/dboard_manager.cpp17
-rw-r--r--host/lib/usrp/device3/device3_impl.cpp4
-rw-r--r--host/lib/usrp/device3/device3_io_impl.cpp12
-rw-r--r--host/lib/usrp/e100/clock_ctrl.cpp3
-rw-r--r--host/lib/usrp/e100/e100_ctrl.cpp1
-rw-r--r--host/lib/usrp/e100/e100_impl.cpp10
-rw-r--r--host/lib/usrp/e100/io_impl.cpp4
-rw-r--r--host/lib/usrp/e300/e300_common.cpp1
-rw-r--r--host/lib/usrp/e300/e300_common.hpp2
-rw-r--r--host/lib/usrp/e300/e300_impl.cpp24
-rw-r--r--host/lib/usrp/e300/e300_io_impl.cpp7
-rw-r--r--host/lib/usrp/gps_ctrl.cpp3
-rw-r--r--host/lib/usrp/mboard_eeprom.cpp1
-rw-r--r--host/lib/usrp/multi_usrp.cpp23
-rw-r--r--host/lib/usrp/n230/n230_clk_pps_ctrl.cpp3
-rw-r--r--host/lib/usrp/n230/n230_impl.cpp15
-rw-r--r--host/lib/usrp/n230/n230_resource_manager.cpp2
-rw-r--r--host/lib/usrp/n230/n230_stream_manager.cpp1
-rw-r--r--host/lib/usrp/subdev_spec.cpp7
-rw-r--r--host/lib/usrp/usrp1/io_impl.cpp8
-rw-r--r--host/lib/usrp/usrp1/usrp1_calc_mux.hpp4
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.cpp14
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.hpp3
-rw-r--r--host/lib/usrp/usrp2/codec_ctrl.cpp1
-rw-r--r--host/lib/usrp/usrp2/dboard_iface.cpp2
-rw-r--r--host/lib/usrp/usrp2/io_impl.cpp22
-rw-r--r--host/lib/usrp/usrp2/n200_image_loader.cpp4
-rw-r--r--host/lib/usrp/usrp2/usrp2_iface.cpp1
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp21
-rw-r--r--host/lib/usrp/usrp_c.cpp3
-rw-r--r--host/lib/usrp/x300/x300_adc_ctrl.cpp1
-rw-r--r--host/lib/usrp/x300/x300_dac_ctrl.cpp1
-rw-r--r--host/lib/usrp/x300/x300_dboard_iface.cpp2
-rw-r--r--host/lib/usrp/x300/x300_fw_uart.cpp3
-rw-r--r--host/lib/usrp/x300/x300_image_loader.cpp2
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp25
-rw-r--r--host/lib/usrp/x300/x300_io_impl.cpp3
-rw-r--r--host/lib/usrp/x300/x300_radio_ctrl_impl.cpp8
71 files changed, 206 insertions, 234 deletions
diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp
index 1a38bf3b7..d87d0890d 100644
--- a/host/lib/usrp/b100/b100_impl.cpp
+++ b/host/lib/usrp/b100/b100_impl.cpp
@@ -73,7 +73,7 @@ static device_addrs_t b100_find(const device_addr_t &hint)
//find the usrps and load firmware
size_t found = 0;
- BOOST_FOREACH(usb_device_handle::sptr handle, usb_device_handle::get_device_list(vid, pid)) {
+ for(usb_device_handle::sptr handle: usb_device_handle::get_device_list(vid, pid)) {
//extract the firmware path for the b100
std::string b100_fw_image;
try{
@@ -102,7 +102,7 @@ static device_addrs_t b100_find(const device_addr_t &hint)
//search for the device until found or timeout
while (boost::get_system_time() < timeout_time and b100_addrs.empty() and found != 0)
{
- BOOST_FOREACH(usb_device_handle::sptr handle, usb_device_handle::get_device_list(vid, pid))
+ for(usb_device_handle::sptr handle: usb_device_handle::get_device_list(vid, pid))
{
usb_control::sptr control;
try{control = usb_control::make(handle, 0);}
@@ -161,7 +161,7 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
//locate the matching handle in the device list
usb_device_handle::sptr handle;
- BOOST_FOREACH(usb_device_handle::sptr dev_handle, device_list) {
+ for(usb_device_handle::sptr dev_handle: device_list) {
if (dev_handle->get_serial() == device_addr["serial"]){
handle = dev_handle;
break;
@@ -478,12 +478,12 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
//bind frontend corrections to the dboard freq props
const fs_path db_tx_fe_path = mb_path / "dboards" / "A" / "tx_frontends";
- BOOST_FOREACH(const std::string &name, _tree->list(db_tx_fe_path)){
+ for(const std::string &name: _tree->list(db_tx_fe_path)){
_tree->access<double>(db_tx_fe_path / name / "freq" / "value")
.add_coerced_subscriber(boost::bind(&b100_impl::set_tx_fe_corrections, this, _1));
}
const fs_path db_rx_fe_path = mb_path / "dboards" / "A" / "rx_frontends";
- BOOST_FOREACH(const std::string &name, _tree->list(db_rx_fe_path)){
+ for(const std::string &name: _tree->list(db_rx_fe_path)){
_tree->access<double>(db_rx_fe_path / name / "freq" / "value")
.add_coerced_subscriber(boost::bind(&b100_impl::set_rx_fe_corrections, this, _1));
}
@@ -504,10 +504,10 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
.add_coerced_subscriber(boost::bind(&b100_clock_ctrl::set_fpga_clock_rate, _clock_ctrl, _1));
//reset cordic rates and their properties to zero
- BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "rx_dsps")){
+ for(const std::string &name: _tree->list(mb_path / "rx_dsps")){
_tree->access<double>(mb_path / "rx_dsps" / name / "freq" / "value").set(0.0);
}
- BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "tx_dsps")){
+ for(const std::string &name: _tree->list(mb_path / "tx_dsps")){
_tree->access<double>(mb_path / "tx_dsps" / name / "freq" / "value").set(0.0);
}
diff --git a/host/lib/usrp/b100/clock_ctrl.cpp b/host/lib/usrp/b100/clock_ctrl.cpp
index 5700a321a..99ad6a052 100644
--- a/host/lib/usrp/b100/clock_ctrl.cpp
+++ b/host/lib/usrp/b100/clock_ctrl.cpp
@@ -25,7 +25,6 @@
#include <stdint.h>
#include "b100_regs.hpp" //spi slave constants
#include <boost/assign/list_of.hpp>
-#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <boost/thread/thread.hpp>
#include <boost/math/common_factor_rt.hpp> //gcd
@@ -533,7 +532,7 @@ private:
;
//write initial register values and latch/update
- BOOST_FOREACH(const range_t &range, ranges){
+ for(const range_t &range: ranges){
for(uint16_t addr = range.first; addr <= range.second; addr++){
this->send_reg(addr);
}
diff --git a/host/lib/usrp/b100/io_impl.cpp b/host/lib/usrp/b100/io_impl.cpp
index c1810ed8c..09973491c 100644
--- a/host/lib/usrp/b100/io_impl.cpp
+++ b/host/lib/usrp/b100/io_impl.cpp
@@ -36,10 +36,10 @@ void b100_impl::update_rates(void){
_tree->access<double>(mb_path / "tick_rate").update();
//and now that the tick rate is set, init the host rates to something
- BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "rx_dsps")){
+ for(const std::string &name: _tree->list(mb_path / "rx_dsps")){
_tree->access<double>(mb_path / "rx_dsps" / name / "rate" / "value").update();
}
- BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "tx_dsps")){
+ for(const std::string &name: _tree->list(mb_path / "tx_dsps")){
_tree->access<double>(mb_path / "tx_dsps" / name / "rate" / "value").update();
}
}
diff --git a/host/lib/usrp/b100/usb_zero_copy_wrapper.cpp b/host/lib/usrp/b100/usb_zero_copy_wrapper.cpp
index d57d57f21..568b7add9 100644
--- a/host/lib/usrp/b100/usb_zero_copy_wrapper.cpp
+++ b/host/lib/usrp/b100/usb_zero_copy_wrapper.cpp
@@ -21,7 +21,6 @@
#include <uhd/utils/msg.hpp>
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/atomic.hpp>
-#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
diff --git a/host/lib/usrp/b200/b200_image_loader.cpp b/host/lib/usrp/b200/b200_image_loader.cpp
index b9c2c0caf..af79a59fc 100644
--- a/host/lib/usrp/b200/b200_image_loader.cpp
+++ b/host/lib/usrp/b200/b200_image_loader.cpp
@@ -16,7 +16,6 @@
//
#include <boost/assign.hpp>
-#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <uhd/exception.hpp>
@@ -45,7 +44,7 @@ static b200_iface::sptr get_b200_iface(const image_loader::image_loader_args_t&
mboard_eeprom_t eeprom; // Internal use
if(dev_handles.size() > 0){
- BOOST_FOREACH(usb_device_handle::sptr dev_handle, dev_handles){
+ for(usb_device_handle::sptr dev_handle: dev_handles){
if(dev_handle->firmware_loaded()){
iface = b200_iface::make(usb_control::make(dev_handle,0));
eeprom = mboard_eeprom_t(*iface, "B200");
@@ -74,7 +73,7 @@ static b200_iface::sptr get_b200_iface(const image_loader::image_loader_args_t&
std::string err_msg = "Could not resolve given args to a single B2XX device.\n"
"Applicable devices:\n";
- BOOST_FOREACH(usb_device_handle::sptr dev_handle, applicable_dev_handles){
+ for(usb_device_handle::sptr dev_handle: applicable_dev_handles){
eeprom = mboard_eeprom_t(*b200_iface::make(usb_control::make(dev_handle,0)), "B200");
err_msg += str(boost::format(" * %s (serial=%s)\n")
% B2XX_STR_NAMES.get(get_b200_product(dev_handle, mb_eeprom), "B2XX")
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp
index e2a0e0b70..62f0c2f59 100644
--- a/host/lib/usrp/b200/b200_impl.cpp
+++ b/host/lib/usrp/b200/b200_impl.cpp
@@ -172,7 +172,7 @@ static device_addrs_t b200_find(const device_addr_t &hint)
//Return an empty list of addresses when an address or resource is specified,
//since an address and resource is intended for a different, non-USB, device.
- BOOST_FOREACH(device_addr_t hint_i, separate_device_addr(hint)) {
+ for(device_addr_t hint_i: separate_device_addr(hint)) {
if (hint_i.has_key("addr") || hint_i.has_key("resource")) return b200_addrs;
}
@@ -182,7 +182,7 @@ static device_addrs_t b200_find(const device_addr_t &hint)
// so that re-enumeration after fw load can occur successfully.
// This requirement is a courtesy of libusb1.0 on windows.
size_t found = 0;
- BOOST_FOREACH(usb_device_handle::sptr handle, get_b200_device_handles(hint)) {
+ for(usb_device_handle::sptr handle: get_b200_device_handles(hint)) {
//extract the firmware path for the b200
std::string b200_fw_image;
try{
@@ -213,7 +213,7 @@ static device_addrs_t b200_find(const device_addr_t &hint)
//search for the device until found or timeout
while (boost::get_system_time() < timeout_time and b200_addrs.empty() and found != 0)
{
- BOOST_FOREACH(usb_device_handle::sptr handle, get_b200_device_handles(hint))
+ for(usb_device_handle::sptr handle: get_b200_device_handles(hint))
{
usb_control::sptr control;
try{control = usb_control::make(handle, 0);}
@@ -344,7 +344,7 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
std::vector<usb_device_handle::sptr> device_list = usb_device_handle::get_device_list(vid_pid_pair_list);
//locate the matching handle in the device list
- BOOST_FOREACH(usb_device_handle::sptr dev_handle, device_list) {
+ for(usb_device_handle::sptr dev_handle: device_list) {
try {
if (dev_handle->get_serial() == device_addr["serial"]){
handle = dev_handle;
@@ -500,7 +500,7 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
if (_gps and _gps->gps_detected())
{
//UHD_MSG(status) << "found" << std::endl;
- BOOST_FOREACH(const std::string &name, _gps->get_sensors())
+ for(const std::string &name: _gps->get_sensors())
{
_tree->create<sensor_value_t>(mb_path / "sensors" / name)
.set_publisher(boost::bind(&gps_ctrl::get_sensor, _gps, name));
@@ -621,7 +621,7 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
this->setup_radio(i);
//now test each radio module's connection to the codec interface
- BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)
+ for(radio_perifs_t &perif: _radio_perifs)
{
_codec_mgr->loopback_self_test(
boost::bind(
@@ -641,7 +641,7 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
.add_coerced_subscriber(boost::bind(&b200_impl::sync_times, this));
_tree->create<time_spec_t>(mb_path / "time" / "pps")
.set_publisher(boost::bind(&time_core_3000::get_time_last_pps, _radio_perifs[0].time64));
- BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)
+ for(radio_perifs_t &perif: _radio_perifs)
{
_tree->access<time_spec_t>(mb_path / "time" / "pps")
.add_coerced_subscriber(boost::bind(&time_core_3000::set_time_next_pps, perif.time64, _1));
@@ -670,7 +670,7 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
// front panel gpio
////////////////////////////////////////////////////////////////////
_radio_perifs[0].fp_gpio = gpio_atr_3000::make(_radio_perifs[0].ctrl, TOREG(SR_FP_GPIO), RB32_FP_GPIO);
- BOOST_FOREACH(const gpio_attr_map_t::value_type attr, gpio_attr_map)
+ for(const gpio_attr_map_t::value_type attr: gpio_attr_map)
{
_tree->create<uint32_t>(mb_path / "gpio" / "FP0" / attr.second)
.set(0)
@@ -701,11 +701,11 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
//subdev spec contains full width of selections
subdev_spec_t rx_spec, tx_spec;
- BOOST_FOREACH(const std::string &fe, _tree->list(mb_path / "dboards" / "A" / "rx_frontends"))
+ for(const std::string &fe: _tree->list(mb_path / "dboards" / "A" / "rx_frontends"))
{
rx_spec.push_back(subdev_spec_pair_t("A", fe));
}
- BOOST_FOREACH(const std::string &fe, _tree->list(mb_path / "dboards" / "A" / "tx_frontends"))
+ for(const std::string &fe: _tree->list(mb_path / "dboards" / "A" / "tx_frontends"))
{
tx_spec.push_back(subdev_spec_pair_t("A", fe));
}
@@ -830,7 +830,7 @@ void b200_impl::setup_radio(const size_t dspno)
// create RF frontend interfacing
////////////////////////////////////////////////////////////////////
static const std::vector<direction_t> dirs = boost::assign::list_of(RX_DIRECTION)(TX_DIRECTION);
- BOOST_FOREACH(direction_t dir, dirs) {
+ for(direction_t dir: dirs) {
const std::string x = (dir == RX_DIRECTION) ? "rx" : "tx";
const std::string key = std::string(((dir == RX_DIRECTION) ? "RX" : "TX")) + std::string(((dspno == _fe1) ? "1" : "2"));
const fs_path rf_fe_path
@@ -932,7 +932,7 @@ double b200_impl::set_tick_rate(const double new_tick_rate)
_tick_rate = _codec_ctrl->set_clock_rate(new_tick_rate);
UHD_MSG(status) << std::endl << (boost::format("Actually got clock rate %.6f MHz.") % (_tick_rate/1e6)) << std::endl;
- BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)
+ for(radio_perifs_t &perif: _radio_perifs)
{
perif.time64->set_tick_rate(_tick_rate);
perif.time64->self_test();
@@ -1088,7 +1088,7 @@ void b200_impl::update_time_source(const std::string &source)
void b200_impl::set_time(const uhd::time_spec_t& t)
{
- BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)
+ for(radio_perifs_t &perif: _radio_perifs)
perif.time64->set_time_sync(t);
_local_ctrl->poke32(TOREG(SR_CORE_SYNC), 1 << 2 | uint32_t(_time_source));
_local_ctrl->poke32(TOREG(SR_CORE_SYNC), _time_source);
diff --git a/host/lib/usrp/b200/b200_io_impl.cpp b/host/lib/usrp/b200/b200_io_impl.cpp
index 0a00b9402..09aaff7ed 100644
--- a/host/lib/usrp/b200/b200_io_impl.cpp
+++ b/host/lib/usrp/b200/b200_io_impl.cpp
@@ -45,7 +45,7 @@ void b200_impl::check_tick_rate_with_current_streamers(double rate)
size_t b200_impl::max_chan_count(const std::string &direction /* = "" */)
{
size_t max_count = 0;
- BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)
+ for(radio_perifs_t &perif: _radio_perifs)
{
if ((direction == "RX" or direction.empty()) and not perif.rx_streamer.expired()) {
boost::shared_ptr<sph::recv_packet_streamer> rx_streamer =
@@ -97,7 +97,7 @@ void b200_impl::set_auto_tick_rate(
for (int i = 0; i < 2; i++) { // Loop through rx and tx
std::string dir = (i == 0) ? "tx" : "rx";
// We assume all 'set' DSPs are being used.
- BOOST_FOREACH(const std::string &dsp_no, _tree->list(str(boost::format("/mboards/0/%s_dsps") % dir))) {
+ for(const std::string &dsp_no: _tree->list(str(boost::format("/mboards/0/%s_dsps") % dir))) {
fs_path dsp_path = str(boost::format("/mboards/0/%s_dsps/%s") % dir % dsp_no);
if (dsp_path == tree_dsp_path) {
continue;
@@ -146,14 +146,14 @@ void b200_impl::update_tick_rate(const double new_tick_rate)
{
check_tick_rate_with_current_streamers(new_tick_rate);
- BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)
+ for(radio_perifs_t &perif: _radio_perifs)
{
boost::shared_ptr<sph::recv_packet_streamer> my_streamer =
boost::dynamic_pointer_cast<sph::recv_packet_streamer>(perif.rx_streamer.lock());
if (my_streamer) my_streamer->set_tick_rate(new_tick_rate);
perif.framer->set_tick_rate(new_tick_rate);
}
- BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)
+ for(radio_perifs_t &perif: _radio_perifs)
{
boost::shared_ptr<sph::send_packet_streamer> my_streamer =
boost::dynamic_pointer_cast<sph::send_packet_streamer>(perif.tx_streamer.lock());
diff --git a/host/lib/usrp/b200/b200_uart.cpp b/host/lib/usrp/b200/b200_uart.cpp
index 3c49ebf2a..016dd4ca3 100644
--- a/host/lib/usrp/b200/b200_uart.cpp
+++ b/host/lib/usrp/b200/b200_uart.cpp
@@ -23,7 +23,6 @@
#include <uhd/utils/msg.hpp>
#include <uhd/types/time_spec.hpp>
#include <uhd/exception.hpp>
-#include <boost/foreach.hpp>
using namespace uhd;
using namespace uhd::transport;
@@ -69,7 +68,7 @@ struct b200_uart_impl : b200_uart
void write_uart(const std::string &buff)
{
- BOOST_FOREACH(const char ch, buff)
+ for(const char ch: buff)
{
this->send_char(ch);
}
diff --git a/host/lib/usrp/common/ad936x_manager.cpp b/host/lib/usrp/common/ad936x_manager.cpp
index 2b6d69c15..20e06a072 100644
--- a/host/lib/usrp/common/ad936x_manager.cpp
+++ b/host/lib/usrp/common/ad936x_manager.cpp
@@ -17,7 +17,6 @@
#include "ad936x_manager.hpp"
#include <uhd/utils/msg.hpp>
-#include <boost/foreach.hpp>
#include <boost/functional/hash.hpp>
#include <boost/thread/thread.hpp>
@@ -66,7 +65,7 @@ class ad936x_manager_impl : public ad936x_manager
***********************************************************************/
void init_codec()
{
- BOOST_FOREACH(const std::string &rx_fe, _rx_frontends) {
+ for(const std::string &rx_fe: _rx_frontends) {
_codec_ctrl->set_gain(rx_fe, DEFAULT_GAIN);
_codec_ctrl->set_bw_filter(rx_fe, DEFAULT_BANDWIDTH);
_codec_ctrl->tune(rx_fe, DEFAULT_FREQ);
@@ -74,7 +73,7 @@ class ad936x_manager_impl : public ad936x_manager
_codec_ctrl->set_iq_balance_auto(rx_fe, DEFAULT_AUTO_IQ_BALANCE);
_codec_ctrl->set_agc(rx_fe, DEFAULT_AGC_ENABLE);
}
- BOOST_FOREACH(const std::string &tx_fe, _tx_frontends) {
+ for(const std::string &tx_fe: _tx_frontends) {
_codec_ctrl->set_gain(tx_fe, DEFAULT_GAIN);
_codec_ctrl->set_bw_filter(tx_fe, DEFAULT_BANDWIDTH);
_codec_ctrl->tune(tx_fe, DEFAULT_FREQ);
@@ -218,7 +217,7 @@ class ad936x_manager_impl : public ad936x_manager
}
// Gains
- BOOST_FOREACH(const std::string &name, ad9361_ctrl::get_gain_names(key))
+ for(const std::string &name: ad9361_ctrl::get_gain_names(key))
{
subtree->create<meta_range_t>(uhd::fs_path("gains") / name / "range")
.set(ad9361_ctrl::get_gain_range(key));
@@ -278,7 +277,7 @@ class ad936x_manager_impl : public ad936x_manager
}
// Frontend filters
- BOOST_FOREACH(const std::string &filter_name, _codec_ctrl->get_filter_names(key)) {
+ for(const std::string &filter_name: _codec_ctrl->get_filter_names(key)) {
subtree->create<filter_info_base::sptr>(uhd::fs_path("filters") / filter_name / "value" )
.set_publisher(boost::bind(&ad9361_ctrl::get_filter, _codec_ctrl, key, filter_name))
.add_coerced_subscriber(boost::bind(&ad9361_ctrl::set_filter, _codec_ctrl, key, filter_name, _1));
diff --git a/host/lib/usrp/common/apply_corrections.cpp b/host/lib/usrp/common/apply_corrections.cpp
index 272e0e093..f1ba47bd9 100644
--- a/host/lib/usrp/common/apply_corrections.cpp
+++ b/host/lib/usrp/common/apply_corrections.cpp
@@ -22,7 +22,6 @@
#include <uhd/utils/csv.hpp>
#include <uhd/types/dict.hpp>
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <boost/thread/mutex.hpp>
#include <cstdio>
#include <complex>
@@ -114,7 +113,7 @@ static void apply_fe_corrections(
bool read_data = false, skip_next = false;;
std::vector<fe_cal_t> datas;
- BOOST_FOREACH(const uhd::csv::row_type &row, rows){
+ for(const uhd::csv::row_type &row: rows){
if (not read_data and not row.empty() and row[0] == "DATA STARTS HERE"){
read_data = true;
skip_next = true;
diff --git a/host/lib/usrp/common/constrained_device_args.hpp b/host/lib/usrp/common/constrained_device_args.hpp
index 1bfd1df00..47c5f4cc0 100644
--- a/host/lib/usrp/common/constrained_device_args.hpp
+++ b/host/lib/usrp/common/constrained_device_args.hpp
@@ -260,7 +260,7 @@ namespace usrp {
template<typename arg_t, typename data_t>
static inline void _enforce_discrete(const arg_t& arg, const std::vector<data_t>& valid_values) {
bool match = false;
- BOOST_FOREACH(const data_t& val, valid_values) {
+ for(const data_t& val: valid_values) {
if (val == arg.get()) {
match = true;
break;
diff --git a/host/lib/usrp/common/max287x.hpp b/host/lib/usrp/common/max287x.hpp
index 9022e0f02..df6f6bc26 100644
--- a/host/lib/usrp/common/max287x.hpp
+++ b/host/lib/usrp/common/max287x.hpp
@@ -402,7 +402,7 @@ public:
while (vco_freq < MIN_VCO_FREQ)
vco_freq *=2;
uint8_t vco_index = 0xFF;
- BOOST_FOREACH(const vco_map_t::value_type &vco, max2871_vco_map)
+ for(const vco_map_t::value_type &vco: max2871_vco_map)
{
if (uhd::math::fp_compare::fp_compare_epsilon<double>(vco_freq) < vco.second.stop())
{
diff --git a/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp b/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp
index 16ee84140..35758d4dd 100644
--- a/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp
+++ b/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp
@@ -22,7 +22,6 @@
#include <uhd/exception.hpp>
#include <boost/format.hpp>
#include <boost/asio.hpp> //used for htonl and ntohl
-#include <boost/foreach.hpp>
#include "fw_comm_protocol.h"
namespace uhd { namespace usrp { namespace usrp3 {
diff --git a/host/lib/usrp/common/validate_subdev_spec.cpp b/host/lib/usrp/common/validate_subdev_spec.cpp
index fab40b204..76e61221e 100644
--- a/host/lib/usrp/common/validate_subdev_spec.cpp
+++ b/host/lib/usrp/common/validate_subdev_spec.cpp
@@ -18,7 +18,6 @@
#include "validate_subdev_spec.hpp"
#include <uhd/exception.hpp>
#include <uhd/utils/assert_has.hpp>
-#include <boost/foreach.hpp>
#include <boost/format.hpp>
using namespace uhd;
@@ -52,19 +51,19 @@ void uhd::usrp::validate_subdev_spec(
//make a list of all possible specs
subdev_spec_t all_specs;
- BOOST_FOREACH(const std::string &db, tree->list(str(boost::format("/mboards/%s/dboards") % mb))){
- BOOST_FOREACH(const std::string &sd, tree->list(str(boost::format("/mboards/%s/dboards/%s/%s_frontends") % mb % db % type))){
+ for(const std::string &db: tree->list(str(boost::format("/mboards/%s/dboards") % mb))){
+ for(const std::string &sd: tree->list(str(boost::format("/mboards/%s/dboards/%s/%s_frontends") % mb % db % type))){
all_specs.push_back(subdev_spec_pair_t(db, sd));
}
}
//validate that the spec is possible
- BOOST_FOREACH(const subdev_spec_pair_t &pair, spec){
+ for(const subdev_spec_pair_t &pair: spec){
uhd::assert_has(all_specs, pair, str(boost::format("%s subdevice specification on mboard %s") % type % mb));
}
//enable selected frontends, disable others
- BOOST_FOREACH(const subdev_spec_pair_t &pair, all_specs){
+ for(const subdev_spec_pair_t &pair: all_specs){
const bool enb = uhd::has(spec, pair);
tree->access<bool>(str(boost::format(
"/mboards/%s/dboards/%s/%s_frontends/%s/enabled"
diff --git a/host/lib/usrp/dboard/db_cbx.cpp b/host/lib/usrp/dboard/db_cbx.cpp
index c27cbf58a..05f8846d6 100644
--- a/host/lib/usrp/dboard/db_cbx.cpp
+++ b/host/lib/usrp/dboard/db_cbx.cpp
@@ -40,7 +40,7 @@ sbx_xcvr::cbx::~cbx(void){
void sbx_xcvr::cbx::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> &regs)
{
- BOOST_FOREACH(uint32_t reg, regs)
+ for(uint32_t reg: regs)
{
self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32);
}
diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp
index f296820c5..2862f97dc 100644
--- a/host/lib/usrp/dboard/db_dbsrx.cpp
+++ b/host/lib/usrp/dboard/db_dbsrx.cpp
@@ -205,7 +205,7 @@ dbsrx::dbsrx(ctor_args_t args) : rx_dboard_base(args){
.set("DBSRX");
this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
.set_publisher(boost::bind(&dbsrx::get_locked, this));
- BOOST_FOREACH(const std::string &name, dbsrx_gain_ranges.keys()){
+ for(const std::string &name: dbsrx_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
.set_coercer(boost::bind(&dbsrx::set_gain, this, _1, name))
.set(dbsrx_gain_ranges[name].start());
@@ -266,7 +266,7 @@ double dbsrx::set_lo_freq(double target_freq){
//choose refclock
std::vector<double> clock_rates = this->get_iface()->get_clock_rates(dboard_iface::UNIT_RX);
const double max_clock_rate = uhd::sorted(clock_rates).back();
- BOOST_FOREACH(ref_clock, uhd::reversed(uhd::sorted(clock_rates))){
+ for(auto ref_clock: uhd::reversed(uhd::sorted(clock_rates))){
//USRP1 feeds the DBSRX clock from a FPGA GPIO line.
//make sure that this clock does not exceed rate limit.
if (this->get_iface()->get_special_props().soft_clock_divider){
@@ -286,7 +286,7 @@ double dbsrx::set_lo_freq(double target_freq){
if (m >= 32) continue;
//choose R
- for(r = 0; r <= 6; r += 1) {
+ for(auto r = 0; r <= 6; r += 1) {
//compute divider from setting
R = 1 << (r+1);
UHD_LOGV(often) << boost::format("DBSRX R:%d\n") % R << std::endl;
diff --git a/host/lib/usrp/dboard/db_dbsrx2.cpp b/host/lib/usrp/dboard/db_dbsrx2.cpp
index 21b0fd02d..544671d3b 100644
--- a/host/lib/usrp/dboard/db_dbsrx2.cpp
+++ b/host/lib/usrp/dboard/db_dbsrx2.cpp
@@ -192,7 +192,7 @@ dbsrx2::dbsrx2(ctor_args_t args) : rx_dboard_base(args){
.set("DBSRX2");
this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
.set_publisher(boost::bind(&dbsrx2::get_locked, this));
- BOOST_FOREACH(const std::string &name, dbsrx2_gain_ranges.keys()){
+ for(const std::string &name: dbsrx2_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
.set_coercer(boost::bind(&dbsrx2::set_gain, this, _1, name))
.set(dbsrx2_gain_ranges[name].start());
diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp
index 9bbd73425..3982ba224 100644
--- a/host/lib/usrp/dboard/db_rfx.cpp
+++ b/host/lib/usrp/dboard/db_rfx.cpp
@@ -184,7 +184,7 @@ rfx_xcvr::rfx_xcvr(
this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
.set_publisher(boost::bind(&rfx_xcvr::get_locked, this, dboard_iface::UNIT_RX));
- BOOST_FOREACH(const std::string &name, _rx_gain_ranges.keys()){
+ for(const std::string &name: _rx_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
.set_coercer(boost::bind(&rfx_xcvr::set_rx_gain, this, _1, name))
.set(_rx_gain_ranges[name].start());
@@ -379,9 +379,9 @@ double rfx_xcvr::set_lo_freq(
* fvco*R/fref = P*B + A = N
*/
for(R = 2; R <= 32; R+=2){
- BOOST_FOREACH(BS, bandsel_to_enum.keys()){
+ for(auto BS: bandsel_to_enum.keys()){
if (ref_freq/R/BS > 1e6) continue; //constraint on band select clock
- BOOST_FOREACH(P, prescaler_to_enum.keys()){
+ for(auto P: prescaler_to_enum.keys()){
//calculate B and A from N
double N = target_freq*R/ref_freq;
B = int(std::floor(N/P));
@@ -433,7 +433,7 @@ double rfx_xcvr::set_lo_freq(
(adf4360_regs_t::ADDR_CONTROL)
(adf4360_regs_t::ADDR_NCOUNTER)
;
- BOOST_FOREACH(adf4360_regs_t::addr_t addr, addrs){
+ for(adf4360_regs_t::addr_t addr: addrs){
this->get_iface()->write_spi(
unit, spi_config_t::EDGE_RISE,
regs.get_reg(addr), 24
diff --git a/host/lib/usrp/dboard/db_sbx_common.cpp b/host/lib/usrp/dboard/db_sbx_common.cpp
index efc84d7e6..ab7eb2566 100644
--- a/host/lib/usrp/dboard/db_sbx_common.cpp
+++ b/host/lib/usrp/dboard/db_sbx_common.cpp
@@ -160,7 +160,7 @@ sbx_xcvr::sbx_xcvr(ctor_args_t args) : xcvr_dboard_base(args){
this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
.set_publisher(boost::bind(&sbx_xcvr::get_locked, this, dboard_iface::UNIT_RX));
- BOOST_FOREACH(const std::string &name, sbx_rx_gain_ranges.keys()){
+ for(const std::string &name: sbx_rx_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
.set_coercer(boost::bind(&sbx_xcvr::set_rx_gain, this, _1, name))
.set(sbx_rx_gain_ranges[name].start());
@@ -201,7 +201,7 @@ sbx_xcvr::sbx_xcvr(ctor_args_t args) : xcvr_dboard_base(args){
this->get_tx_subtree()->create<sensor_value_t>("sensors/lo_locked")
.set_publisher(boost::bind(&sbx_xcvr::get_locked, this, dboard_iface::UNIT_TX));
- BOOST_FOREACH(const std::string &name, sbx_tx_gain_ranges.keys()){
+ for(const std::string &name: sbx_tx_gain_ranges.keys()){
this->get_tx_subtree()->create<double>("gains/"+name+"/value")
.set_coercer(boost::bind(&sbx_xcvr::set_tx_gain, this, _1, name))
.set(sbx_tx_gain_ranges[name].start());
diff --git a/host/lib/usrp/dboard/db_sbx_version3.cpp b/host/lib/usrp/dboard/db_sbx_version3.cpp
index bb2ba6bd6..91a1b6a53 100644
--- a/host/lib/usrp/dboard/db_sbx_version3.cpp
+++ b/host/lib/usrp/dboard/db_sbx_version3.cpp
@@ -40,7 +40,7 @@ sbx_xcvr::sbx_version3::~sbx_version3(void){
void sbx_xcvr::sbx_version3::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> &regs)
{
- BOOST_FOREACH(uint32_t reg, regs)
+ for(uint32_t reg: regs)
{
self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32);
}
diff --git a/host/lib/usrp/dboard/db_sbx_version4.cpp b/host/lib/usrp/dboard/db_sbx_version4.cpp
index e5b6e081c..6521285ea 100644
--- a/host/lib/usrp/dboard/db_sbx_version4.cpp
+++ b/host/lib/usrp/dboard/db_sbx_version4.cpp
@@ -41,7 +41,7 @@ sbx_xcvr::sbx_version4::~sbx_version4(void){
void sbx_xcvr::sbx_version4::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> &regs)
{
- BOOST_FOREACH(uint32_t reg, regs)
+ for(uint32_t reg: regs)
{
self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32);
}
diff --git a/host/lib/usrp/dboard/db_tvrx.cpp b/host/lib/usrp/dboard/db_tvrx.cpp
index 5c0600c61..5b25883f8 100644
--- a/host/lib/usrp/dboard/db_tvrx.cpp
+++ b/host/lib/usrp/dboard/db_tvrx.cpp
@@ -107,7 +107,7 @@ static const boost::array<double, 17> tvrx_gains_volts =
static uhd::dict<std::string, gain_range_t> get_tvrx_gain_ranges(void) {
double rfmax = 0.0, rfmin = FLT_MAX;
- BOOST_FOREACH(const std::string range, tvrx_rf_gains_db.keys()) {
+ for(const std::string range: tvrx_rf_gains_db.keys()) {
double my_max = tvrx_rf_gains_db[range].back(); //we're assuming it's monotonic
double my_min = tvrx_rf_gains_db[range].front(); //if it's not this is wrong wrong wrong
if(my_max > rfmax) rfmax = my_max;
@@ -188,7 +188,7 @@ tvrx::tvrx(ctor_args_t args) : rx_dboard_base(args){
this->get_rx_subtree()->create<std::string>("name")
.set("TVRX");
this->get_rx_subtree()->create<int>("sensors"); //phony property so this dir exists
- BOOST_FOREACH(const std::string &name, get_tvrx_gain_ranges().keys()){
+ for(const std::string &name: get_tvrx_gain_ranges().keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
.set_coercer(boost::bind(&tvrx::set_gain, this, _1, name));
this->get_rx_subtree()->create<meta_range_t>("gains/"+name+"/range")
@@ -232,7 +232,7 @@ tvrx::tvrx(ctor_args_t args) : rx_dboard_base(args){
this->get_rx_subtree()->access<double>("freq/value").set(tvrx_freq_range.start());
//set default gains
- BOOST_FOREACH(const std::string &name, get_tvrx_gain_ranges().keys()){
+ for(const std::string &name: get_tvrx_gain_ranges().keys()){
this->get_rx_subtree()->access<double>("gains/"+name+"/value")
.set(get_tvrx_gain_ranges()[name].start());
}
@@ -247,7 +247,7 @@ tvrx::~tvrx(void){
*/
static std::string get_band(double freq) {
- BOOST_FOREACH(const std::string &band, tvrx_freq_ranges.keys()) {
+ for(const std::string &band: tvrx_freq_ranges.keys()) {
if(freq >= tvrx_freq_ranges[band].start() && freq <= tvrx_freq_ranges[band].stop()){
UHD_LOGV(often) << "Band: " << band << std::endl;
return band;
diff --git a/host/lib/usrp/dboard/db_tvrx2.cpp b/host/lib/usrp/dboard/db_tvrx2.cpp
index 1bac81153..3ba581b0f 100644
--- a/host/lib/usrp/dboard/db_tvrx2.cpp
+++ b/host/lib/usrp/dboard/db_tvrx2.cpp
@@ -962,7 +962,7 @@ tvrx2::tvrx2(ctor_args_t args) : rx_dboard_base(args){
.set_publisher(boost::bind(&tvrx2::get_rssi, this));
this->get_rx_subtree()->create<sensor_value_t>("sensors/temperature")
.set_publisher(boost::bind(&tvrx2::get_temp, this));
- BOOST_FOREACH(const std::string &name, tvrx2_gain_ranges.keys()){
+ for(const std::string &name: tvrx2_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
.set_coercer(boost::bind(&tvrx2::set_gain, this, _1, name));
this->get_rx_subtree()->create<meta_range_t>("gains/"+name+"/range")
@@ -1066,7 +1066,7 @@ bool tvrx2::set_enabled(bool enable){
test_rf_filter_robustness();
- BOOST_FOREACH(const std::string &name, tvrx2_gain_ranges.keys()){
+ for(const std::string &name: tvrx2_gain_ranges.keys()){
this->get_rx_subtree()->access<double>("gains/"+name+"/value")
.set(tvrx2_gain_ranges[name].start());
}
@@ -1271,14 +1271,14 @@ void tvrx2::tvrx2_tda18272_init_rfcal(void)
// Loop through rfcal_log_* registers, initialize _rfcal_results
- BOOST_FOREACH(const uint32_t &result, result_to_cal_regs.keys())
+ for(const uint32_t &result: result_to_cal_regs.keys())
_rfcal_results[result].delta_c = result_to_cal_regs[result] > 63 ? result_to_cal_regs[result] - 128 : result_to_cal_regs[result];
/* read byte 0x26-0x2B */
read_reg(0x26, 0x2B);
// Loop through rfcal_byte_* registers, initialize _rfcal_coeffs
- BOOST_FOREACH(const uint32_t &subband, _rfcal_coeffs.keys())
+ for(const uint32_t &subband: _rfcal_coeffs.keys())
{
freq_range_t subband_freqs;
@@ -1473,7 +1473,7 @@ void tvrx2::test_rf_filter_robustness(void){
("UHFHigh_1", 0x43)
;
- BOOST_FOREACH(const std::string &name, filter_cal_regs.keys()){
+ for(const std::string &name: filter_cal_regs.keys()){
uint8_t cal_result = _tda18272hnm_regs.get_reg(filter_cal_regs[name]);
if (cal_result & 0x80) {
_filter_ratings.set(name, "E");
@@ -1516,7 +1516,7 @@ void tvrx2::test_rf_filter_robustness(void){
std::stringstream robustness_message;
robustness_message << boost::format("TVRX2 (%s): RF Filter Robustness Results:") % (get_subdev_name()) << std::endl;
- BOOST_FOREACH(const std::string &name, uhd::sorted(_filter_ratings.keys())){
+ for(const std::string &name: uhd::sorted(_filter_ratings.keys())){
robustness_message << boost::format("\t%s:\tMargin = %0.2f,\tRobustness = %c") % name % (_filter_margins[name]) % (_filter_ratings[name]) << std::endl;
}
diff --git a/host/lib/usrp/dboard/db_twinrx.cpp b/host/lib/usrp/dboard/db_twinrx.cpp
index 2af6bc4ff..91b38f90c 100644
--- a/host/lib/usrp/dboard/db_twinrx.cpp
+++ b/host/lib/usrp/dboard/db_twinrx.cpp
@@ -265,7 +265,7 @@ public:
// Add workers to expert
//---------------------------------------------------------
//Channel (front-end) specific
- BOOST_FOREACH(const std::string& fe, _fe_names) {
+ for(const std::string& fe: _fe_names) {
expert_factory::add_worker_node<twinrx_freq_path_expert>(_expert, _expert->node_retriever(), fe);
expert_factory::add_worker_node<twinrx_freq_coercion_expert>(_expert, _expert->node_retriever(), fe);
expert_factory::add_worker_node<twinrx_chan_gain_expert>(_expert, _expert->node_retriever(), fe);
diff --git a/host/lib/usrp/dboard/db_ubx.cpp b/host/lib/usrp/dboard/db_ubx.cpp
index 3dd0b1c84..2f3c1ebe7 100644
--- a/host/lib/usrp/dboard/db_ubx.cpp
+++ b/host/lib/usrp/dboard/db_ubx.cpp
@@ -300,7 +300,7 @@ public:
{
std::vector<double> rates = _iface->get_clock_rates(dboard_iface::UNIT_RX);
double highest_rate = 0.0;
- BOOST_FOREACH(double rate, rates)
+ for(double rate: rates)
{
if (rate <= pfd_freq_max and rate > highest_rate)
highest_rate = rate;
@@ -312,7 +312,7 @@ public:
{
std::vector<double> rates = _iface->get_clock_rates(dboard_iface::UNIT_TX);
double highest_rate = 0.0;
- BOOST_FOREACH(double rate, rates)
+ for(double rate: rates)
{
if (rate <= pfd_freq_max and rate > highest_rate)
highest_rate = rate;
@@ -370,7 +370,7 @@ public:
_rxlo1 = max287x_iface::make<max2870>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO1, _1));
_rxlo2 = max287x_iface::make<max2870>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO2, _1));
std::vector<max287x_iface::sptr> los = boost::assign::list_of(_txlo1)(_txlo2)(_rxlo1)(_rxlo2);
- BOOST_FOREACH(max287x_iface::sptr lo, los)
+ for(max287x_iface::sptr lo: los)
{
lo->set_auto_retune(false);
lo->set_muxout_mode(max287x_iface::MUXOUT_DLD);
@@ -384,7 +384,7 @@ public:
_rxlo1 = max287x_iface::make<max2871>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO1, _1));
_rxlo2 = max287x_iface::make<max2871>(boost::bind(&ubx_xcvr::write_spi_regs, this, RXLO2, _1));
std::vector<max287x_iface::sptr> los = boost::assign::list_of(_txlo1)(_txlo2)(_rxlo1)(_rxlo2);
- BOOST_FOREACH(max287x_iface::sptr lo, los)
+ for(max287x_iface::sptr lo: los)
{
lo->set_auto_retune(false);
//lo->set_cycle_slip_mode(true); // tried it - caused longer lock times
@@ -547,7 +547,7 @@ private:
{
boost::mutex::scoped_lock lock(_spi_mutex);
ROUTE_SPI(_iface, dest);
- BOOST_FOREACH(uint32_t value, values)
+ for(uint32_t value: values)
WRITE_SPI(_iface, value);
}
diff --git a/host/lib/usrp/dboard/db_unknown.cpp b/host/lib/usrp/dboard/db_unknown.cpp
index 2ed50cd91..7e1c20a9e 100644
--- a/host/lib/usrp/dboard/db_unknown.cpp
+++ b/host/lib/usrp/dboard/db_unknown.cpp
@@ -23,7 +23,6 @@
#include <uhd/usrp/dboard_manager.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/format.hpp>
-#include <boost/foreach.hpp>
#include <boost/tuple/tuple.hpp>
#include <vector>
@@ -43,7 +42,7 @@ static void warn_if_old_rfx(const dboard_id_t &dboard_id, const std::string &xx)
(old_ids_t("Flex 1800 Classic", 0x0030, 0x0031))
(old_ids_t("Flex 2400 Classic", 0x0007, 0x000b))
;
- BOOST_FOREACH(const old_ids_t &old_id, old_rfx_ids){
+ for(const old_ids_t &old_id: old_rfx_ids){
std::string name; dboard_id_t rx_id, tx_id;
boost::tie(name, rx_id, tx_id) = old_id;
if (
diff --git a/host/lib/usrp/dboard/db_wbx_common.cpp b/host/lib/usrp/dboard/db_wbx_common.cpp
index 5afbb1f88..1ad6ad45b 100644
--- a/host/lib/usrp/dboard/db_wbx_common.cpp
+++ b/host/lib/usrp/dboard/db_wbx_common.cpp
@@ -70,7 +70,7 @@ wbx_base::wbx_base(ctor_args_t args) : xcvr_dboard_base(args){
this->get_rx_subtree()->create<device_addr_t>("tune_args").set(device_addr_t());
this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
.set_publisher(boost::bind(&wbx_base::get_locked, this, dboard_iface::UNIT_RX));
- BOOST_FOREACH(const std::string &name, wbx_rx_gain_ranges.keys()){
+ for(const std::string &name: wbx_rx_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
.set_coercer(boost::bind(&wbx_base::set_rx_gain, this, _1, name))
.set(wbx_rx_gain_ranges[name].start());
@@ -158,7 +158,7 @@ sensor_value_t wbx_base::get_locked(dboard_iface::unit_t unit){
}
void wbx_base::wbx_versionx::write_lo_regs(dboard_iface::unit_t unit, const std::vector<uint32_t> &regs) {
- BOOST_FOREACH(uint32_t reg, regs) {
+ for(uint32_t reg: regs) {
self_base->get_iface()->write_spi(unit, spi_config_t::EDGE_RISE, reg, 32);
}
}
diff --git a/host/lib/usrp/dboard/db_wbx_version2.cpp b/host/lib/usrp/dboard/db_wbx_version2.cpp
index 489291881..319434c3a 100644
--- a/host/lib/usrp/dboard/db_wbx_version2.cpp
+++ b/host/lib/usrp/dboard/db_wbx_version2.cpp
@@ -91,7 +91,7 @@ wbx_base::wbx_version2::wbx_version2(wbx_base *_self_wbx_base) {
// Register TX properties
////////////////////////////////////////////////////////////////////
this->get_tx_subtree()->create<std::string>("name").set("WBXv2 TX");
- BOOST_FOREACH(const std::string &name, wbx_v2_tx_gain_ranges.keys()){
+ for(const std::string &name: wbx_v2_tx_gain_ranges.keys()){
self_base->get_tx_subtree()->create<double>("gains/"+name+"/value")
.set_coercer(boost::bind(&wbx_base::wbx_version2::set_tx_gain, this, _1, name))
.set(wbx_v2_tx_gain_ranges[name].start());
diff --git a/host/lib/usrp/dboard/db_wbx_version3.cpp b/host/lib/usrp/dboard/db_wbx_version3.cpp
index 1bd326e6f..cb7616e26 100644
--- a/host/lib/usrp/dboard/db_wbx_version3.cpp
+++ b/host/lib/usrp/dboard/db_wbx_version3.cpp
@@ -96,7 +96,7 @@ wbx_base::wbx_version3::wbx_version3(wbx_base *_self_wbx_base) {
// Register TX properties
////////////////////////////////////////////////////////////////////
this->get_tx_subtree()->create<std::string>("name").set("WBXv3 TX");
- BOOST_FOREACH(const std::string &name, wbx_v3_tx_gain_ranges.keys()){
+ for(const std::string &name: wbx_v3_tx_gain_ranges.keys()){
self_base->get_tx_subtree()->create<double>("gains/"+name+"/value")
.set_coercer(boost::bind(&wbx_base::wbx_version3::set_tx_gain, this, _1, name))
.set(wbx_v3_tx_gain_ranges[name].start());
diff --git a/host/lib/usrp/dboard/db_wbx_version4.cpp b/host/lib/usrp/dboard/db_wbx_version4.cpp
index 3cc0f1887..8db03b961 100644
--- a/host/lib/usrp/dboard/db_wbx_version4.cpp
+++ b/host/lib/usrp/dboard/db_wbx_version4.cpp
@@ -103,7 +103,7 @@ wbx_base::wbx_version4::wbx_version4(wbx_base *_self_wbx_base) {
//get_tx_id() will always return GDB ID, so use RX ID to determine WBXv4 vs. WBX-120
if(rx_id == 0x0063) this->get_tx_subtree()->create<std::string>("name").set("WBXv4 TX");
else if(rx_id == 0x0081) this->get_tx_subtree()->create<std::string>("name").set("WBX-120 TX");
- BOOST_FOREACH(const std::string &name, wbx_v4_tx_gain_ranges.keys()){
+ for(const std::string &name: wbx_v4_tx_gain_ranges.keys()){
self_base->get_tx_subtree()->create<double>("gains/"+name+"/value")
.set_coercer(boost::bind(&wbx_base::wbx_version4::set_tx_gain, this, _1, name))
.set(wbx_v4_tx_gain_ranges[name].start());
diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp
index 6876ee4be..63053e326 100644
--- a/host/lib/usrp/dboard/db_xcvr2450.cpp
+++ b/host/lib/usrp/dboard/db_xcvr2450.cpp
@@ -234,7 +234,7 @@ xcvr2450::xcvr2450(ctor_args_t args) : xcvr_dboard_base(args){
.set_publisher(boost::bind(&xcvr2450::get_locked, this));
this->get_rx_subtree()->create<sensor_value_t>("sensors/rssi")
.set_publisher(boost::bind(&xcvr2450::get_rssi, this));
- BOOST_FOREACH(const std::string &name, xcvr_rx_gain_ranges.keys()){
+ for(const std::string &name: xcvr_rx_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
.set_coercer(boost::bind(&xcvr2450::set_rx_gain, this, _1, name))
.set(xcvr_rx_gain_ranges[name].start());
@@ -270,7 +270,7 @@ xcvr2450::xcvr2450(ctor_args_t args) : xcvr_dboard_base(args){
.set("XCVR2450 TX");
this->get_tx_subtree()->create<sensor_value_t>("sensors/lo_locked")
.set_publisher(boost::bind(&xcvr2450::get_locked, this));
- BOOST_FOREACH(const std::string &name, xcvr_tx_gain_ranges.keys()){
+ for(const std::string &name: xcvr_tx_gain_ranges.keys()){
this->get_tx_subtree()->create<double>("gains/"+name+"/value")
.set_coercer(boost::bind(&xcvr2450::set_tx_gain, this, _1, name))
.set(xcvr_tx_gain_ranges[name].start());
diff --git a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp
index 346f39589..ddbbfaefb 100644
--- a/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp
+++ b/host/lib/usrp/dboard/twinrx/twinrx_ctrl.cpp
@@ -87,10 +87,10 @@ public:
//Initialize clocks and LO
bool found_rate = false;
- BOOST_FOREACH(double rate, _db_iface->get_clock_rates(dboard_iface::UNIT_TX)) {
+ for(double rate: _db_iface->get_clock_rates(dboard_iface::UNIT_TX)) {
found_rate |= uhd::math::frequencies_are_equal(rate, TWINRX_DESIRED_REFERENCE_FREQ);
}
- BOOST_FOREACH(double rate, _db_iface->get_clock_rates(dboard_iface::UNIT_RX)) {
+ for(double rate: _db_iface->get_clock_rates(dboard_iface::UNIT_RX)) {
found_rate |= uhd::math::frequencies_are_equal(rate, TWINRX_DESIRED_REFERENCE_FREQ);
}
if (not found_rate) {
@@ -506,7 +506,7 @@ private: //Functions
void _write_lo_spi(dboard_iface::unit_t unit, const std::vector<uint32_t> &regs)
{
- BOOST_FOREACH(uint32_t reg, regs) {
+ for(uint32_t reg: regs) {
spi_config_t spi_config = spi_config_t(spi_config_t::EDGE_RISE);
spi_config.use_custom_divider = true;
spi_config.divider = 67;
diff --git a/host/lib/usrp/dboard_eeprom.cpp b/host/lib/usrp/dboard_eeprom.cpp
index 9c748f556..0136e1fcb 100644
--- a/host/lib/usrp/dboard_eeprom.cpp
+++ b/host/lib/usrp/dboard_eeprom.cpp
@@ -19,7 +19,6 @@
#include <uhd/usrp/dboard_eeprom.hpp>
#include <uhd/exception.hpp>
#include <uhd/utils/log.hpp>
-#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>
#include <algorithm>
diff --git a/host/lib/usrp/dboard_manager.cpp b/host/lib/usrp/dboard_manager.cpp
index 56cd08fd7..698799fbc 100644
--- a/host/lib/usrp/dboard_manager.cpp
+++ b/host/lib/usrp/dboard_manager.cpp
@@ -26,7 +26,6 @@
#include <boost/tuple/tuple.hpp>
#include <boost/format.hpp>
#include <boost/bind.hpp>
-#include <boost/foreach.hpp>
#include <boost/assign/list_of.hpp>
using namespace uhd;
@@ -156,7 +155,7 @@ void dboard_manager::register_dboard_restricted(
std::string dboard_id_t::to_cname(void) const{
std::string cname;
- BOOST_FOREACH(const dboard_key_t &key, get_id_to_args_map().keys()){
+ for(const dboard_key_t &key: get_id_to_args_map().keys()){
if (
(not key.is_xcvr() and *this == key.xx_id()) or
(key.is_xcvr() and (*this == key.rx_id() or *this == key.tx_id()))
@@ -266,7 +265,7 @@ void dboard_manager_impl::init(
){
//find the dboard key matches for the dboard ids
dboard_key_t rx_dboard_key, tx_dboard_key, xcvr_dboard_key;
- BOOST_FOREACH(const dboard_key_t &key, get_id_to_args_map().keys()){
+ for(const dboard_key_t &key: get_id_to_args_map().keys()){
if (key.is_xcvr()){
if (rx_dboard_id == key.rx_id() and tx_dboard_id == key.tx_id()) xcvr_dboard_key = key;
if (rx_dboard_id == key.rx_id()) rx_dboard_key = key; //kept to handle warning
@@ -322,7 +321,7 @@ void dboard_manager_impl::init(
db_ctor_args.tx_container = db_ctor_args.rx_container; //Same TX and RX container
//create the xcvr object for each subdevice
- BOOST_FOREACH(const std::string &subdev, subdevs){
+ for(const std::string &subdev: subdevs){
db_ctor_args.sd_name = subdev;
db_ctor_args.rx_subtree = subtree->subtree("rx_frontends/" + db_ctor_args.sd_name);
db_ctor_args.tx_subtree = subtree->subtree("tx_frontends/" + db_ctor_args.sd_name);
@@ -373,7 +372,7 @@ void dboard_manager_impl::init(
}
//make the rx subdevs
- BOOST_FOREACH(const std::string &subdev, rx_subdevs){
+ for(const std::string &subdev: rx_subdevs){
db_ctor_args.sd_name = subdev;
db_ctor_args.rx_subtree = subtree->subtree("rx_frontends/" + db_ctor_args.sd_name);
_rx_dboards[subdev] = rx_dboard_ctor(&db_ctor_args);
@@ -412,7 +411,7 @@ void dboard_manager_impl::init(
}
//make the tx subdevs
- BOOST_FOREACH(const std::string &subdev, tx_subdevs){
+ for(const std::string &subdev: tx_subdevs){
db_ctor_args.sd_name = subdev;
db_ctor_args.tx_subtree = subtree->subtree("tx_frontends/" + db_ctor_args.sd_name);
_tx_dboards[subdev] = tx_dboard_ctor(&db_ctor_args);
@@ -436,11 +435,11 @@ void dboard_manager_impl::init(
}
void dboard_manager_impl::initialize_dboards(void) {
- BOOST_FOREACH(dboard_base::sptr& _rx_container, _rx_containers) {
+ for(dboard_base::sptr& _rx_container: _rx_containers) {
_rx_container->initialize();
}
- BOOST_FOREACH(dboard_base::sptr& _tx_container, _tx_containers) {
+ for(dboard_base::sptr& _tx_container: _tx_containers) {
_tx_container->initialize();
}
}
@@ -457,7 +456,7 @@ void dboard_manager_impl::set_nice_dboard_if(void){
;
//set nice settings on each unit
- BOOST_FOREACH(dboard_iface::unit_t unit, units){
+ for(dboard_iface::unit_t unit: units){
_iface->set_gpio_ddr(unit, 0x0000); //all inputs
_iface->set_gpio_out(unit, 0x0000); //all low
_iface->set_pin_ctrl(unit, 0x0000); //all gpio
diff --git a/host/lib/usrp/device3/device3_impl.cpp b/host/lib/usrp/device3/device3_impl.cpp
index 28b7bc34b..84b11ee51 100644
--- a/host/lib/usrp/device3/device3_impl.cpp
+++ b/host/lib/usrp/device3/device3_impl.cpp
@@ -70,7 +70,7 @@ void device3_impl::merge_channel_defs(
// - All block indices that are in chan_ids may be overwritten in the channel definition
// - If the channels in chan_ids are not yet in the property tree channel list,
// they are appended.
- BOOST_FOREACH(const std::string &chan_idx, curr_channels) {
+ for(const std::string &chan_idx: curr_channels) {
if (_tree->exists(chans_root / chan_idx)) {
rfnoc::block_id_t chan_block_id = _tree->access<rfnoc::block_id_t>(chans_root / chan_idx).get();
if (std::find(chan_ids.begin(), chan_ids.end(), chan_block_id) != chan_ids.end()) {
@@ -147,7 +147,7 @@ void device3_impl::enumerate_rfnoc_blocks(
}
UHD_ASSERT_THROW(block_def);
make_args.ctrl_ifaces[0] = ctrl;
- BOOST_FOREACH(const size_t port_number, block_def->get_all_port_numbers()) {
+ for(const size_t port_number: block_def->get_all_port_numbers()) {
if (port_number == 0) { // We've already set this up
continue;
}
diff --git a/host/lib/usrp/device3/device3_io_impl.cpp b/host/lib/usrp/device3/device3_io_impl.cpp
index 2f2e778c9..996399815 100644
--- a/host/lib/usrp/device3/device3_io_impl.cpp
+++ b/host/lib/usrp/device3/device3_io_impl.cpp
@@ -138,7 +138,7 @@ void generate_channel_list(
}
// Add all remaining args to all channel args
- BOOST_FOREACH(device_addr_t &chan_arg, chan_args_) {
+ for(device_addr_t &chan_arg: chan_args_) {
chan_arg = chan_arg.to_string() + "," + args.args.to_string();
}
@@ -459,7 +459,7 @@ bool device3_impl::recv_async_msg(
**********************************************************************/
void device3_impl::update_rx_streamers(double /* rate */)
{
- BOOST_FOREACH(const std::string &block_id, _rx_streamers.keys()) {
+ for(const std::string &block_id: _rx_streamers.keys()) {
UHD_STREAMER_LOG() << "[Device3] updating RX streamer to " << block_id << std::endl;
boost::shared_ptr<sph::recv_packet_streamer> my_streamer =
boost::dynamic_pointer_cast<sph::recv_packet_streamer>(_rx_streamers[block_id].lock());
@@ -547,7 +547,7 @@ rx_streamer::sptr device3_impl::get_rx_stream(const stream_args_t &args_)
// Find all upstream radio nodes and set their response in SID to the host
std::vector<boost::shared_ptr<uhd::rfnoc::radio_ctrl> > upstream_radio_nodes = blk_ctrl->find_upstream_node<uhd::rfnoc::radio_ctrl>();
UHD_STREAMER_LOG() << "[RX Streamer] Number of upstream radio nodes: " << upstream_radio_nodes.size() << std::endl;
- BOOST_FOREACH(const boost::shared_ptr<uhd::rfnoc::radio_ctrl> &node, upstream_radio_nodes) {
+ for(const boost::shared_ptr<uhd::rfnoc::radio_ctrl> &node: upstream_radio_nodes) {
node->sr_write(uhd::rfnoc::SR_RESP_OUT_DST_SID, xport.send_sid.get_src(), block_port);
}
@@ -661,7 +661,7 @@ rx_streamer::sptr device3_impl::get_rx_stream(const stream_args_t &args_)
**********************************************************************/
void device3_impl::update_tx_streamers(double /* rate */)
{
- BOOST_FOREACH(const std::string &block_id, _tx_streamers.keys()) {
+ for(const std::string &block_id: _tx_streamers.keys()) {
UHD_STREAMER_LOG() << "[Device3] updating TX streamer: " << block_id << std::endl;
boost::shared_ptr<sph::send_packet_streamer> my_streamer =
boost::dynamic_pointer_cast<sph::send_packet_streamer>(_tx_streamers[block_id].lock());
@@ -822,7 +822,7 @@ tx_streamer::sptr device3_impl::get_tx_stream(const uhd::stream_args_t &args_)
size_t radio_port = args.args.cast<size_t>("radio_port", 0);
std::vector<boost::shared_ptr<uhd::rfnoc::radio_ctrl> > downstream_radio_nodes = blk_ctrl->find_downstream_node<uhd::rfnoc::radio_ctrl>();
UHD_STREAMER_LOG() << "[TX Streamer] Number of downstream radio nodes: " << downstream_radio_nodes.size() << std::endl;
- BOOST_FOREACH(const boost::shared_ptr<uhd::rfnoc::radio_ctrl> &node, downstream_radio_nodes) {
+ for(const boost::shared_ptr<uhd::rfnoc::radio_ctrl> &node: downstream_radio_nodes) {
if (node->get_block_id() == radio_id) {
node->sr_write(uhd::rfnoc::SR_RESP_IN_DST_SID, xport.send_sid.get_src(), radio_port);
}
@@ -836,7 +836,7 @@ tx_streamer::sptr device3_impl::get_tx_stream(const uhd::stream_args_t &args_)
// Find all downstream radio nodes and set their response SID to the host
std::vector<boost::shared_ptr<uhd::rfnoc::radio_ctrl> > downstream_radio_nodes = blk_ctrl->find_downstream_node<uhd::rfnoc::radio_ctrl>();
UHD_STREAMER_LOG() << "[TX Streamer] Number of downstream radio nodes: " << downstream_radio_nodes.size() << std::endl;
- BOOST_FOREACH(const boost::shared_ptr<uhd::rfnoc::radio_ctrl> &node, downstream_radio_nodes) {
+ for(const boost::shared_ptr<uhd::rfnoc::radio_ctrl> &node: downstream_radio_nodes) {
node->sr_write(uhd::rfnoc::SR_RESP_IN_DST_SID, xport.send_sid.get_src(), block_port);
}
}
diff --git a/host/lib/usrp/e100/clock_ctrl.cpp b/host/lib/usrp/e100/clock_ctrl.cpp
index 0dbd6a5d3..b49b30a6a 100644
--- a/host/lib/usrp/e100/clock_ctrl.cpp
+++ b/host/lib/usrp/e100/clock_ctrl.cpp
@@ -23,7 +23,6 @@
#include <stdint.h>
#include "e100_regs.hpp" //spi slave constants
#include <boost/assign/list_of.hpp>
-#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <boost/thread/thread.hpp>
#include <boost/math/common_factor_rt.hpp> //gcd
@@ -521,7 +520,7 @@ private:
;
//write initial register values and latch/update
- BOOST_FOREACH(const range_t &range, ranges){
+ for(const range_t &range: ranges){
for(uint16_t addr = range.first; addr <= range.second; addr++){
this->send_reg(addr);
}
diff --git a/host/lib/usrp/e100/e100_ctrl.cpp b/host/lib/usrp/e100/e100_ctrl.cpp
index 4217286f8..777d1b5d5 100644
--- a/host/lib/usrp/e100/e100_ctrl.cpp
+++ b/host/lib/usrp/e100/e100_ctrl.cpp
@@ -27,7 +27,6 @@
#include <boost/thread/thread.hpp> //sleep
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
-#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <fstream>
diff --git a/host/lib/usrp/e100/e100_impl.cpp b/host/lib/usrp/e100/e100_impl.cpp
index 25c967cfa..41ba24d8f 100644
--- a/host/lib/usrp/e100/e100_impl.cpp
+++ b/host/lib/usrp/e100/e100_impl.cpp
@@ -269,7 +269,7 @@ e100_impl::e100_impl(const uhd::device_addr_t &device_addr){
}
if (_gps and _gps->gps_detected())
{
- BOOST_FOREACH(const std::string &name, _gps->get_sensors())
+ for(const std::string &name: _gps->get_sensors())
{
_tree->create<sensor_value_t>(mb_path / "sensors" / name)
.set_publisher(boost::bind(&gps_ctrl::get_sensor, _gps, name));
@@ -434,12 +434,12 @@ e100_impl::e100_impl(const uhd::device_addr_t &device_addr){
//bind frontend corrections to the dboard freq props
const fs_path db_tx_fe_path = mb_path / "dboards" / "A" / "tx_frontends";
- BOOST_FOREACH(const std::string &name, _tree->list(db_tx_fe_path)){
+ for(const std::string &name: _tree->list(db_tx_fe_path)){
_tree->access<double>(db_tx_fe_path / name / "freq" / "value")
.add_coerced_subscriber(boost::bind(&e100_impl::set_tx_fe_corrections, this, _1));
}
const fs_path db_rx_fe_path = mb_path / "dboards" / "A" / "rx_frontends";
- BOOST_FOREACH(const std::string &name, _tree->list(db_rx_fe_path)){
+ for(const std::string &name: _tree->list(db_rx_fe_path)){
_tree->access<double>(db_rx_fe_path / name / "freq" / "value")
.add_coerced_subscriber(boost::bind(&e100_impl::set_rx_fe_corrections, this, _1));
}
@@ -460,10 +460,10 @@ e100_impl::e100_impl(const uhd::device_addr_t &device_addr){
.add_coerced_subscriber(boost::bind(&e100_clock_ctrl::set_fpga_clock_rate, _clock_ctrl, _1));
//reset cordic rates and their properties to zero
- BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "rx_dsps")){
+ for(const std::string &name: _tree->list(mb_path / "rx_dsps")){
_tree->access<double>(mb_path / "rx_dsps" / name / "freq" / "value").set(0.0);
}
- BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "tx_dsps")){
+ for(const std::string &name: _tree->list(mb_path / "tx_dsps")){
_tree->access<double>(mb_path / "tx_dsps" / name / "freq" / "value").set(0.0);
}
diff --git a/host/lib/usrp/e100/io_impl.cpp b/host/lib/usrp/e100/io_impl.cpp
index ebed3614c..aedf79d5f 100644
--- a/host/lib/usrp/e100/io_impl.cpp
+++ b/host/lib/usrp/e100/io_impl.cpp
@@ -75,10 +75,10 @@ void e100_impl::update_rates(void){
_tree->access<double>(mb_path / "tick_rate").update();
//and now that the tick rate is set, init the host rates to something
- BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "rx_dsps")){
+ for(const std::string &name: _tree->list(mb_path / "rx_dsps")){
_tree->access<double>(mb_path / "rx_dsps" / name / "rate" / "value").update();
}
- BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "tx_dsps")){
+ for(const std::string &name: _tree->list(mb_path / "tx_dsps")){
_tree->access<double>(mb_path / "tx_dsps" / name / "rate" / "value").update();
}
}
diff --git a/host/lib/usrp/e300/e300_common.cpp b/host/lib/usrp/e300/e300_common.cpp
index 216713bc6..20cd4109f 100644
--- a/host/lib/usrp/e300/e300_common.cpp
+++ b/host/lib/usrp/e300/e300_common.cpp
@@ -26,6 +26,7 @@
#include "e300_common.hpp"
#include <boost/filesystem.hpp>
+#include <boost/noncopyable.hpp>
#include <fstream>
#include <string>
diff --git a/host/lib/usrp/e300/e300_common.hpp b/host/lib/usrp/e300/e300_common.hpp
index d9a0afd9e..c0cb9e2fd 100644
--- a/host/lib/usrp/e300/e300_common.hpp
+++ b/host/lib/usrp/e300/e300_common.hpp
@@ -18,6 +18,8 @@
#ifndef INCLUDED_E300_COMMON_HPP
#define INCLUDED_E300_COMMON_HPP
+#include <string>
+
namespace uhd { namespace usrp { namespace e300 {
namespace common {
diff --git a/host/lib/usrp/e300/e300_impl.cpp b/host/lib/usrp/e300/e300_impl.cpp
index 84f50c67b..64422a82b 100644
--- a/host/lib/usrp/e300/e300_impl.cpp
+++ b/host/lib/usrp/e300/e300_impl.cpp
@@ -130,7 +130,7 @@ device_addrs_t e300_find(const device_addr_t &multi_dev_hint)
if (hints.size() > 1) {
device_addrs_t found_devices;
std::string err_msg;
- BOOST_FOREACH(const device_addr_t &hint_i, hints)
+ for(const device_addr_t &hint_i: hints)
{
device_addrs_t found_devices_i = e300_find(hint_i);
if(found_devices_i.size() != 1)
@@ -165,7 +165,7 @@ device_addrs_t e300_find(const device_addr_t &multi_dev_hint)
if (not loopback_only) {
// if no address or node has been specified, send a broadcast
if ((not hint.has_key("addr")) and (not hint.has_key("node"))) {
- BOOST_FOREACH(const if_addrs_t &if_addrs, get_if_addrs())
+ for(const if_addrs_t &if_addrs: get_if_addrs())
{
// avoid the loopback device
if (is_loopback(if_addrs))
@@ -187,7 +187,7 @@ device_addrs_t e300_find(const device_addr_t &multi_dev_hint)
std::vector<std::string> ip_addrs = discover_ip_addrs(
hint["addr"], E300_SERVER_I2C_PORT);
- BOOST_FOREACH(const std::string &ip_addr, ip_addrs)
+ for(const std::string &ip_addr: ip_addrs)
{
device_addr_t new_addr;
new_addr["type"] = "e3x0";
@@ -468,14 +468,14 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr)
// and do the misc mboard sensors
////////////////////////////////////////////////////////////////////
_tree->create<int>(mb_path / "sensors");
- BOOST_FOREACH(const std::string &name, _sensor_manager->get_sensors())
+ for(const std::string &name: _sensor_manager->get_sensors())
{
_tree->create<sensor_value_t>(mb_path / "sensors" / name)
.set_publisher(boost::bind(&e300_sensor_manager::get_sensor, _sensor_manager, name));
}
#ifdef E300_GPSD
if (_gps) {
- BOOST_FOREACH(const std::string &name, _gps->get_sensors())
+ for(const std::string &name: _gps->get_sensors())
{
_tree->create<sensor_value_t>(mb_path / "sensors" / name)
.set_publisher(boost::bind(&gpsd_iface::get_sensor, _gps, name));
@@ -511,7 +511,7 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr)
this->_setup_radio(instance);
//now test each radio module's connection to the codec interface
- BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)
+ for(radio_perifs_t &perif: _radio_perifs)
{
_codec_mgr->loopback_self_test(
boost::bind(
@@ -524,7 +524,7 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr)
// internal gpios
////////////////////////////////////////////////////////////////////
gpio_atr_3000::sptr fp_gpio = gpio_atr_3000::make(_radio_perifs[0].ctrl, radio::sr_addr(radio::FP_GPIO), radio::RB32_FP_GPIO);
- BOOST_FOREACH(const gpio_attr_map_t::value_type attr, gpio_attr_map)
+ for(const gpio_attr_map_t::value_type attr: gpio_attr_map)
{
_tree->create<uint32_t>(mb_path / "gpio" / "INT0" / attr.second)
.add_coerced_subscriber(boost::bind(&gpio_atr_3000::set_gpio_attr, fp_gpio, attr.first, _1))
@@ -625,11 +625,11 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr)
// subdev spec contains full width of selections
subdev_spec_t rx_spec, tx_spec;
- BOOST_FOREACH(const std::string &fe, _tree->list(mb_path / "dboards" / "A" / "rx_frontends"))
+ for(const std::string &fe: _tree->list(mb_path / "dboards" / "A" / "rx_frontends"))
{
rx_spec.push_back(subdev_spec_pair_t("A", fe));
}
- BOOST_FOREACH(const std::string &fe, _tree->list(mb_path / "dboards" / "A" / "tx_frontends"))
+ for(const std::string &fe: _tree->list(mb_path / "dboards" / "A" / "tx_frontends"))
{
tx_spec.push_back(subdev_spec_pair_t("A", fe));
}
@@ -696,7 +696,7 @@ double e300_impl::_set_tick_rate(const double rate)
_tick_rate = _codec_ctrl->set_clock_rate(rate);
UHD_MSG(status) << "Actually got clock rate " << _tick_rate/1e6 << " MHz\n";
- BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)
+ for(radio_perifs_t &perif: _radio_perifs)
{
perif.time64->set_tick_rate(_tick_rate);
perif.time64->self_test();
@@ -811,7 +811,7 @@ void e300_impl::_update_time_source(const std::string &source)
void e300_impl::_set_time(const uhd::time_spec_t& t)
{
- BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)
+ for(radio_perifs_t &perif: _radio_perifs)
perif.time64->set_time_sync(t);
_misc.time_sync = 1;
_update_gpio_state();
@@ -1037,7 +1037,7 @@ void e300_impl::_setup_radio(const size_t dspno)
// create RF frontend interfacing
////////////////////////////////////////////////////////////////////
static const std::vector<direction_t> dirs = boost::assign::list_of(RX_DIRECTION)(TX_DIRECTION);
- BOOST_FOREACH(direction_t dir, dirs) {
+ for(direction_t dir: dirs) {
const std::string x = (dir == RX_DIRECTION) ? "rx" : "tx";
const std::string key = boost::to_upper_copy(x) + std::string(((dspno == FE0)? "1" : "2"));
const fs_path rf_fe_path
diff --git a/host/lib/usrp/e300/e300_io_impl.cpp b/host/lib/usrp/e300/e300_io_impl.cpp
index 2514b7f40..bcdb8077b 100644
--- a/host/lib/usrp/e300/e300_io_impl.cpp
+++ b/host/lib/usrp/e300/e300_io_impl.cpp
@@ -26,7 +26,6 @@
#include <boost/bind.hpp>
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/log.hpp>
-#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
using namespace uhd;
@@ -43,7 +42,7 @@ static const uint32_t HW_SEQ_NUM_MASK = 0xfff;
void e300_impl::_check_tick_rate_with_current_streamers(const double rate)
{
size_t max_tx_chan_count = 0, max_rx_chan_count = 0;
- BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)
+ for(radio_perifs_t &perif: _radio_perifs)
{
{
boost::shared_ptr<sph::recv_packet_streamer> rx_streamer =
@@ -73,7 +72,7 @@ void e300_impl::_update_tick_rate(const double rate)
{
_check_tick_rate_with_current_streamers(rate);
- BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)
+ for(radio_perifs_t &perif: _radio_perifs)
{
boost::shared_ptr<sph::recv_packet_streamer> my_streamer =
boost::dynamic_pointer_cast<sph::recv_packet_streamer>(perif.rx_streamer.lock());
@@ -81,7 +80,7 @@ void e300_impl::_update_tick_rate(const double rate)
my_streamer->set_tick_rate(rate);
perif.framer->set_tick_rate(_tick_rate);
}
- BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)
+ for(radio_perifs_t &perif: _radio_perifs)
{
boost::shared_ptr<sph::send_packet_streamer> my_streamer =
boost::dynamic_pointer_cast<sph::send_packet_streamer>(perif.tx_streamer.lock());
diff --git a/host/lib/usrp/gps_ctrl.cpp b/host/lib/usrp/gps_ctrl.cpp
index 447a13c33..b4b4ffa0f 100644
--- a/host/lib/usrp/gps_ctrl.cpp
+++ b/host/lib/usrp/gps_ctrl.cpp
@@ -31,7 +31,6 @@
#include <boost/thread/mutex.hpp>
#include "boost/tuple/tuple.hpp"
-#include "boost/foreach.hpp"
using namespace uhd;
using namespace boost::gregorian;
@@ -181,7 +180,7 @@ private:
boost::system_time time = boost::get_system_time();
// Update sentences with newly read data
- BOOST_FOREACH(std::string key, keys)
+ for(std::string key: keys)
{
if (not msgs[key].empty())
{
diff --git a/host/lib/usrp/mboard_eeprom.cpp b/host/lib/usrp/mboard_eeprom.cpp
index 0e6cb8574..ecae5e56d 100644
--- a/host/lib/usrp/mboard_eeprom.cpp
+++ b/host/lib/usrp/mboard_eeprom.cpp
@@ -22,7 +22,6 @@
#include <boost/asio/ip/address_v4.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/lexical_cast.hpp>
-#include <boost/foreach.hpp>
#include <algorithm>
#include <iostream>
#include <cstddef>
diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp
index 058925a9a..a86d05945 100644
--- a/host/lib/usrp/multi_usrp.cpp
+++ b/host/lib/usrp/multi_usrp.cpp
@@ -30,7 +30,6 @@
#include "legacy_compat.hpp"
#include <boost/assign/list_of.hpp>
#include <boost/thread.hpp>
-#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <boost/algorithm/string.hpp>
#include <algorithm>
@@ -190,7 +189,7 @@ static meta_range_t make_overall_tune_range(
const double bw
){
meta_range_t range;
- BOOST_FOREACH(const range_t &sub_range, fe_range){
+ for(const range_t &sub_range: fe_range){
range.push_back(range_t(
sub_range.start() + std::max(dsp_range.start(), -bw/2),
sub_range.stop() + std::min(dsp_range.stop(), bw/2),
@@ -873,7 +872,7 @@ public:
std::vector<std::string> get_rx_lo_names(size_t chan = 0){
std::vector<std::string> lo_names;
if (_tree->exists(rx_rf_fe_root(chan) / "los")) {
- BOOST_FOREACH(const std::string &name, _tree->list(rx_rf_fe_root(chan) / "los")) {
+ for(const std::string &name: _tree->list(rx_rf_fe_root(chan) / "los")) {
lo_names.push_back(name);
}
}
@@ -887,7 +886,7 @@ public:
//Special value ALL_LOS support atomically sets the source for all LOs
_tree->access<std::string>(rx_rf_fe_root(chan) / "los" / ALL_LOS / "source" / "value").set(src);
} else {
- BOOST_FOREACH(const std::string &n, _tree->list(rx_rf_fe_root(chan) / "los")) {
+ for(const std::string &n: _tree->list(rx_rf_fe_root(chan) / "los")) {
this->set_rx_lo_source(src, n, chan);
}
}
@@ -950,7 +949,7 @@ public:
//Special value ALL_LOS support atomically sets the source for all LOs
_tree->access<bool>(rx_rf_fe_root(chan) / "los" / ALL_LOS / "export").set(enabled);
} else {
- BOOST_FOREACH(const std::string &n, _tree->list(rx_rf_fe_root(chan) / "los")) {
+ for(const std::string &n: _tree->list(rx_rf_fe_root(chan) / "los")) {
this->set_rx_lo_export_enabled(enabled, n, chan);
}
}
@@ -1536,12 +1535,12 @@ public:
std::vector<std::string> banks;
if (_tree->exists(mb_root(mboard) / "gpio"))
{
- BOOST_FOREACH(const std::string &name, _tree->list(mb_root(mboard) / "gpio"))
+ for(const std::string &name: _tree->list(mb_root(mboard) / "gpio"))
{
banks.push_back(name);
}
}
- BOOST_FOREACH(const std::string &name, _tree->list(mb_root(mboard) / "dboards"))
+ for(const std::string &name: _tree->list(mb_root(mboard) / "dboards"))
{
banks.push_back("RX"+name);
banks.push_back("TX"+name);
@@ -1877,10 +1876,10 @@ private:
mboard_chan_pair mcp = rx_chan_to_mcp(chan);
const subdev_spec_pair_t spec = get_rx_subdev_spec(mcp.mboard).at(mcp.chan);
gain_group::sptr gg = gain_group::make();
- BOOST_FOREACH(const std::string &name, _tree->list(mb_root(mcp.mboard) / "rx_codecs" / spec.db_name / "gains")){
+ for(const std::string &name: _tree->list(mb_root(mcp.mboard) / "rx_codecs" / spec.db_name / "gains")){
gg->register_fcns("ADC-"+name, make_gain_fcns_from_subtree(_tree->subtree(mb_root(mcp.mboard) / "rx_codecs" / spec.db_name / "gains" / name)), 0 /* low prio */);
}
- BOOST_FOREACH(const std::string &name, _tree->list(rx_rf_fe_root(chan) / "gains")){
+ for(const std::string &name: _tree->list(rx_rf_fe_root(chan) / "gains")){
gg->register_fcns(name, make_gain_fcns_from_subtree(_tree->subtree(rx_rf_fe_root(chan) / "gains" / name)), 1 /* high prio */);
}
return gg;
@@ -1890,10 +1889,10 @@ private:
mboard_chan_pair mcp = tx_chan_to_mcp(chan);
const subdev_spec_pair_t spec = get_tx_subdev_spec(mcp.mboard).at(mcp.chan);
gain_group::sptr gg = gain_group::make();
- BOOST_FOREACH(const std::string &name, _tree->list(mb_root(mcp.mboard) / "tx_codecs" / spec.db_name / "gains")){
+ for(const std::string &name: _tree->list(mb_root(mcp.mboard) / "tx_codecs" / spec.db_name / "gains")){
gg->register_fcns("DAC-"+name, make_gain_fcns_from_subtree(_tree->subtree(mb_root(mcp.mboard) / "tx_codecs" / spec.db_name / "gains" / name)), 1 /* high prio */);
}
- BOOST_FOREACH(const std::string &name, _tree->list(tx_rf_fe_root(chan) / "gains")){
+ for(const std::string &name: _tree->list(tx_rf_fe_root(chan) / "gains")){
gg->register_fcns(name, make_gain_fcns_from_subtree(_tree->subtree(tx_rf_fe_root(chan) / "gains" / name)), 0 /* low prio */);
}
return gg;
@@ -1907,7 +1906,7 @@ private:
size_t bytes_per_sample = convert::get_bytes_per_item(args.otw_format.empty() ? "sc16" : args.otw_format);
double max_link_rate = 0;
double sum_rate = 0;
- BOOST_FOREACH(const size_t chan, args.channels) {
+ for(const size_t chan: args.channels) {
mboard_chan_pair mcp = is_tx ? tx_chan_to_mcp(chan) : rx_chan_to_mcp(chan);
if (_tree->exists(mb_root(mcp.mboard) / "link_max_rate")) {
max_link_rate = std::max(
diff --git a/host/lib/usrp/n230/n230_clk_pps_ctrl.cpp b/host/lib/usrp/n230/n230_clk_pps_ctrl.cpp
index 2bcfb0394..ff4289922 100644
--- a/host/lib/usrp/n230/n230_clk_pps_ctrl.cpp
+++ b/host/lib/usrp/n230/n230_clk_pps_ctrl.cpp
@@ -21,7 +21,6 @@
#include <uhd/utils/safe_call.hpp>
#include <stdint.h>
#include <boost/format.hpp>
-#include <boost/foreach.hpp>
#include <stdexcept>
#include <cmath>
#include <cstdlib>
@@ -60,7 +59,7 @@ public:
_tick_rate = _codec_ctrl->set_clock_rate(rate);
UHD_MSG(status) << "got " << _tick_rate/1e6 << " MHz\n";
- BOOST_FOREACH(time_core_3000::sptr& time_core, _time_cores) {
+ for(time_core_3000::sptr& time_core: _time_cores) {
time_core->set_tick_rate(_tick_rate);
time_core->self_test();
}
diff --git a/host/lib/usrp/n230/n230_impl.cpp b/host/lib/usrp/n230/n230_impl.cpp
index 015140fcc..325b90575 100644
--- a/host/lib/usrp/n230/n230_impl.cpp
+++ b/host/lib/usrp/n230/n230_impl.cpp
@@ -33,7 +33,6 @@
#include <uhd/usrp/dboard_eeprom.hpp>
#include <uhd/usrp/gps_ctrl.hpp>
#include <boost/format.hpp>
-#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/bind.hpp>
#include <boost/algorithm/string.hpp>
@@ -71,7 +70,7 @@ uhd::device_addrs_t n230_impl::n230_find(const uhd::device_addr_t &multi_dev_hin
if (hints.size() > 1){
device_addrs_t found_devices;
std::string error_msg;
- BOOST_FOREACH(const device_addr_t &hint_i, hints){
+ for(const device_addr_t &hint_i: hints){
device_addrs_t found_devices_i = n230_find(hint_i);
if (found_devices_i.size() != 1) error_msg += str(boost::format(
"Could not resolve device hint \"%s\" to a single device."
@@ -98,7 +97,7 @@ uhd::device_addrs_t n230_impl::n230_find(const uhd::device_addr_t &multi_dev_hin
//if no address was specified, send a broadcast on each interface
if (not hint.has_key("addr")) {
- BOOST_FOREACH(const if_addrs_t &if_addrs, get_if_addrs()) {
+ for(const if_addrs_t &if_addrs: get_if_addrs()) {
//avoid the loopback device
if (if_addrs.inet == asio::ip::address_v4::loopback().to_string()) continue;
@@ -119,7 +118,7 @@ uhd::device_addrs_t n230_impl::n230_find(const uhd::device_addr_t &multi_dev_hin
usrp3::usrp3_fw_ctrl_iface::discover_devices(
hint["addr"], BOOST_STRINGIZE(N230_FW_COMMS_UDP_PORT), N230_FW_PRODUCT_ID);
- BOOST_FOREACH(const std::string& addr, discovered_addrs)
+ for(const std::string& addr: discovered_addrs)
{
device_addr_t new_addr;
new_addr["type"] = "n230";
@@ -397,11 +396,11 @@ void n230_impl::_initialize_property_tree(const fs_path& mb_path)
// Initialize subdev specs
//------------------------------------------------------------------
subdev_spec_t rx_spec, tx_spec;
- BOOST_FOREACH(const std::string &fe, _tree->list(mb_path / "dboards" / "A" / "rx_frontends"))
+ for(const std::string &fe: _tree->list(mb_path / "dboards" / "A" / "rx_frontends"))
{
rx_spec.push_back(subdev_spec_pair_t("A", fe));
}
- BOOST_FOREACH(const std::string &fe, _tree->list(mb_path / "dboards" / "A" / "tx_frontends"))
+ for(const std::string &fe: _tree->list(mb_path / "dboards" / "A" / "tx_frontends"))
{
tx_spec.push_back(subdev_spec_pair_t("A", fe));
}
@@ -437,7 +436,7 @@ void n230_impl::_initialize_property_tree(const fs_path& mb_path)
//------------------------------------------------------------------
if (_resource_mgr->is_gpsdo_present()) {
uhd::gps_ctrl::sptr gps_ctrl = _resource_mgr->get_gps_ctrl();
- BOOST_FOREACH(const std::string &name, gps_ctrl->get_sensors())
+ for(const std::string &name: gps_ctrl->get_sensors())
{
_tree->create<sensor_value_t>(mb_path / "sensors" / name)
.set_publisher(boost::bind(&gps_ctrl::get_sensor, gps_ctrl, name));
@@ -499,7 +498,7 @@ void n230_impl::_initialize_radio_properties(const fs_path& mb_path, size_t inst
//RF Frontend Interfacing
static const std::vector<direction_t> data_directions = boost::assign::list_of(RX_DIRECTION)(TX_DIRECTION);
- BOOST_FOREACH(direction_t direction, data_directions) {
+ for(direction_t direction: data_directions) {
const std::string dir_str = (direction == RX_DIRECTION) ? "rx" : "tx";
const std::string key = boost::to_upper_copy(dir_str) + str(boost::format("%u") % (instance + 1));
const fs_path rf_fe_path = mb_path / "dboards" / "A" / (dir_str + "_frontends") / ((instance==0)?"A":"B");
diff --git a/host/lib/usrp/n230/n230_resource_manager.cpp b/host/lib/usrp/n230/n230_resource_manager.cpp
index b96de542a..e9bb9c2c5 100644
--- a/host/lib/usrp/n230/n230_resource_manager.cpp
+++ b/host/lib/usrp/n230/n230_resource_manager.cpp
@@ -85,7 +85,7 @@ n230_resource_manager::n230_resource_manager(
//Discover ethernet interfaces
bool dual_eth_expected = (ip_addrs.size() > 1);
- BOOST_FOREACH(const std::string& addr, ip_addrs) {
+ for(const std::string& addr: ip_addrs) {
n230_eth_conn_t conn_iface;
conn_iface.ip_addr = addr;
diff --git a/host/lib/usrp/n230/n230_stream_manager.cpp b/host/lib/usrp/n230/n230_stream_manager.cpp
index 0528212d0..7c936a184 100644
--- a/host/lib/usrp/n230/n230_stream_manager.cpp
+++ b/host/lib/usrp/n230/n230_stream_manager.cpp
@@ -24,7 +24,6 @@
#include <boost/bind.hpp>
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/log.hpp>
-#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
static const double N230_RX_SW_BUFF_FULL_FACTOR = 0.90; //Buffer should ideally be 90% full.
diff --git a/host/lib/usrp/subdev_spec.cpp b/host/lib/usrp/subdev_spec.cpp
index 6912afec8..e59160a71 100644
--- a/host/lib/usrp/subdev_spec.cpp
+++ b/host/lib/usrp/subdev_spec.cpp
@@ -20,7 +20,6 @@
#include <boost/algorithm/string.hpp> //for split
#include <boost/tokenizer.hpp>
#include <boost/format.hpp>
-#include <boost/foreach.hpp>
#include <sstream>
#include <vector>
@@ -45,7 +44,7 @@ bool usrp::operator==(const subdev_spec_pair_t &lhs, const subdev_spec_pair_t &r
}
subdev_spec_t::subdev_spec_t(const std::string &markup){
- BOOST_FOREACH(const std::string &pair, pair_tokenizer(markup)){
+ for(const std::string &pair: pair_tokenizer(markup)){
if (pair.empty()) continue;
std::vector<std::string> db_sd; boost::split(db_sd, pair, boost::is_any_of(":"));
switch(db_sd.size()){
@@ -62,7 +61,7 @@ std::string subdev_spec_t::to_pp_string(void) const{
std::stringstream ss;
size_t count = 0;
ss << "Subdevice Specification:" << std::endl;
- BOOST_FOREACH(const subdev_spec_pair_t &pair, *this){
+ for(const subdev_spec_pair_t &pair: *this){
ss << boost::format(
" Channel %d: Daughterboard %s, Subdevice %s"
) % (count++) % pair.db_name % pair.sd_name << std::endl;
@@ -73,7 +72,7 @@ std::string subdev_spec_t::to_pp_string(void) const{
std::string subdev_spec_t::to_string(void) const{
std::string markup;
size_t count = 0;
- BOOST_FOREACH(const subdev_spec_pair_t &pair, *this){
+ for(const subdev_spec_pair_t &pair: *this){
markup += ((count++)? " " : "") + pair.db_name + ":" + pair.sd_name;
}
return markup;
diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp
index 920023dad..3e0b23973 100644
--- a/host/lib/usrp/usrp1/io_impl.cpp
+++ b/host/lib/usrp/usrp1/io_impl.cpp
@@ -439,7 +439,7 @@ void usrp1_impl::update_rx_subdev_spec(const uhd::usrp::subdev_spec_t &spec){
//set the mux and set the number of rx channels
std::vector<mapping_pair_t> mapping;
- BOOST_FOREACH(const subdev_spec_pair_t &pair, spec){
+ for(const subdev_spec_pair_t &pair: spec){
const std::string conn = _tree->access<std::string>(str(boost::format(
"/mboards/0/dboards/%s/rx_frontends/%s/connection"
) % pair.db_name % pair.sd_name)).get();
@@ -459,7 +459,7 @@ void usrp1_impl::update_tx_subdev_spec(const uhd::usrp::subdev_spec_t &spec){
//set the mux and set the number of tx channels
std::vector<mapping_pair_t> mapping;
- BOOST_FOREACH(const subdev_spec_pair_t &pair, spec){
+ for(const subdev_spec_pair_t &pair: spec){
const std::string conn = _tree->access<std::string>(str(boost::format(
"/mboards/0/dboards/%s/tx_frontends/%s/connection"
) % pair.db_name % pair.sd_name)).get();
@@ -548,10 +548,10 @@ double usrp1_impl::update_tx_samp_rate(size_t dspno, const double samp_rate){
void usrp1_impl::update_rates(void){
const fs_path mb_path = "/mboards/0";
this->update_tick_rate(_master_clock_rate);
- BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "rx_dsps")){
+ for(const std::string &name: _tree->list(mb_path / "rx_dsps")){
_tree->access<double>(mb_path / "rx_dsps" / name / "rate" / "value").update();
}
- BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "tx_dsps")){
+ for(const std::string &name: _tree->list(mb_path / "tx_dsps")){
_tree->access<double>(mb_path / "tx_dsps" / name / "rate" / "value").update();
}
}
diff --git a/host/lib/usrp/usrp1/usrp1_calc_mux.hpp b/host/lib/usrp/usrp1/usrp1_calc_mux.hpp
index 3577a8042..0ae1c822f 100644
--- a/host/lib/usrp/usrp1/usrp1_calc_mux.hpp
+++ b/host/lib/usrp/usrp1/usrp1_calc_mux.hpp
@@ -71,7 +71,7 @@ static uint32_t calc_rx_mux(const std::vector<mapping_pair_t> &mapping){
//calculate the channel flags
int channel_flags = 0;
size_t num_reals = 0, num_quads = 0;
- BOOST_FOREACH(const mapping_pair_t &pair, uhd::reversed(mapping)){
+ for(const mapping_pair_t &pair: uhd::reversed(mapping)){
const std::string name = pair.first, conn = pair.second;
if (conn == "IQ" or conn == "QI") num_quads++;
if (conn == "I" or conn == "Q") num_reals++;
@@ -132,7 +132,7 @@ static uint32_t calc_tx_mux(const std::vector<mapping_pair_t> &mapping){
//calculate the channel flags
int channel_flags = 0, chan = 0;
uhd::dict<std::string, int> slot_to_chan_count = boost::assign::map_list_of("A", 0)("B", 0);
- BOOST_FOREACH(const mapping_pair_t &pair, mapping){
+ for(const mapping_pair_t &pair: mapping){
const std::string name = pair.first, conn = pair.second;
//combine the channel flags: shift for slot A vs B
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp
index 09352c5e0..8dee9b7e6 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.cpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.cpp
@@ -76,7 +76,7 @@ static device_addrs_t usrp1_find(const device_addr_t &hint)
//find the usrps and load firmware
size_t found = 0;
- BOOST_FOREACH(usb_device_handle::sptr handle, usb_device_handle::get_device_list(vid, pid)) {
+ for(usb_device_handle::sptr handle: usb_device_handle::get_device_list(vid, pid)) {
//extract the firmware path for the USRP1
std::string usrp1_fw_image;
try{
@@ -104,7 +104,7 @@ static device_addrs_t usrp1_find(const device_addr_t &hint)
//search for the device until found or timeout
while (boost::get_system_time() < timeout_time and usrp1_addrs.empty() and found != 0)
{
- BOOST_FOREACH(usb_device_handle::sptr handle, usb_device_handle::get_device_list(vid, pid))
+ for(usb_device_handle::sptr handle: usb_device_handle::get_device_list(vid, pid))
{
usb_control::sptr control;
try{control = usb_control::make(handle, 0);}
@@ -159,7 +159,7 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
//locate the matching handle in the device list
usb_device_handle::sptr handle;
- BOOST_FOREACH(usb_device_handle::sptr dev_handle, device_list) {
+ for(usb_device_handle::sptr dev_handle: device_list) {
if (dev_handle->get_serial() == device_addr["serial"]){
handle = dev_handle;
break;
@@ -251,7 +251,7 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
////////////////////////////////////////////////////////////////////
// create codec control objects
////////////////////////////////////////////////////////////////////
- BOOST_FOREACH(const std::string &db, _dbc.keys()){
+ for(const std::string &db: _dbc.keys()){
_dbc[db].codec = usrp1_codec_ctrl::make(_iface, (db == "A")? SPI_ENABLE_CODEC_A : SPI_ENABLE_CODEC_B);
const fs_path rx_codec_path = mb_path / "rx_codecs" / db;
const fs_path tx_codec_path = mb_path / "tx_codecs" / db;
@@ -284,7 +284,7 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
.set(subdev_spec_t())
.add_coerced_subscriber(boost::bind(&usrp1_impl::update_tx_subdev_spec, this, _1));
- BOOST_FOREACH(const std::string &db, _dbc.keys()){
+ for(const std::string &db: _dbc.keys()){
const fs_path rx_fe_path = mb_path / "rx_frontends" / db;
_tree->create<std::complex<double> >(rx_fe_path / "dc_offset" / "value")
.set_coercer(boost::bind(&usrp1_impl::set_rx_dc_offset, this, db, _1))
@@ -349,7 +349,7 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
////////////////////////////////////////////////////////////////////
// create dboard control objects
////////////////////////////////////////////////////////////////////
- BOOST_FOREACH(const std::string &db, _dbc.keys()){
+ for(const std::string &db: _dbc.keys()){
//read the dboard eeprom to extract the dboard ids
dboard_eeprom_t rx_db_eeprom, tx_db_eeprom, gdb_eeprom;
@@ -400,7 +400,7 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
this->update_rates();
//reset cordic rates and their properties to zero
- BOOST_FOREACH(const std::string &name, _tree->list(mb_path / "rx_dsps")){
+ for(const std::string &name: _tree->list(mb_path / "rx_dsps")){
_tree->access<double>(mb_path / "rx_dsps" / name / "freq" / "value").set(0.0);
}
diff --git a/host/lib/usrp/usrp1/usrp1_impl.hpp b/host/lib/usrp/usrp1/usrp1_impl.hpp
index 18c5c8bd3..1aa255f8d 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.hpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.hpp
@@ -31,7 +31,6 @@
#include <uhd/usrp/dboard_eeprom.hpp>
#include <uhd/usrp/dboard_manager.hpp>
#include <uhd/transport/usb_zero_copy.hpp>
-#include <boost/foreach.hpp>
#include <boost/weak_ptr.hpp>
#include <complex>
@@ -158,7 +157,7 @@ private:
void enable_tx(bool enb){
_tx_enabled = enb;
_fx2_ctrl->usrp_tx_enable(enb);
- BOOST_FOREACH(const std::string &key, _dbc.keys())
+ for(const std::string &key: _dbc.keys())
{
_dbc[key].codec->enable_tx_digital(enb);
}
diff --git a/host/lib/usrp/usrp2/codec_ctrl.cpp b/host/lib/usrp/usrp2/codec_ctrl.cpp
index a0e456708..043564727 100644
--- a/host/lib/usrp/usrp2/codec_ctrl.cpp
+++ b/host/lib/usrp/usrp2/codec_ctrl.cpp
@@ -23,7 +23,6 @@
#include <uhd/utils/safe_call.hpp>
#include <uhd/exception.hpp>
#include <stdint.h>
-#include <boost/foreach.hpp>
using namespace uhd;
diff --git a/host/lib/usrp/usrp2/dboard_iface.cpp b/host/lib/usrp/usrp2/dboard_iface.cpp
index 1dafe5721..49ad38eaf 100644
--- a/host/lib/usrp/usrp2/dboard_iface.cpp
+++ b/host/lib/usrp/usrp2/dboard_iface.cpp
@@ -134,7 +134,7 @@ usrp2_dboard_iface::usrp2_dboard_iface(
//reset the aux dacs
_dac_regs[UNIT_RX] = ad5623_regs_t();
_dac_regs[UNIT_TX] = ad5623_regs_t();
- BOOST_FOREACH(unit_t unit, _dac_regs.keys()){
+ for(unit_t unit: _dac_regs.keys()){
_dac_regs[unit].data = 1;
_dac_regs[unit].addr = ad5623_regs_t::ADDR_ALL;
_dac_regs[unit].cmd = ad5623_regs_t::CMD_RESET;
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp
index 224519944..3c10c6e79 100644
--- a/host/lib/usrp/usrp2/io_impl.cpp
+++ b/host/lib/usrp/usrp2/io_impl.cpp
@@ -231,7 +231,7 @@ void usrp2_impl::io_init(void){
_io_impl = UHD_PIMPL_MAKE(io_impl, ());
//init first so we dont have an access race
- BOOST_FOREACH(const std::string &mb, _mbc.keys()){
+ for(const std::string &mb: _mbc.keys()){
//init the tx xport and flow control monitor
_io_impl->tx_xports.push_back(_mbc[mb].tx_dsp_xport);
_io_impl->fc_mons.push_back(flow_control_monitor::sptr(new flow_control_monitor(
@@ -241,14 +241,14 @@ void usrp2_impl::io_init(void){
}
//allocate streamer weak ptrs containers
- BOOST_FOREACH(const std::string &mb, _mbc.keys()){
+ for(const std::string &mb: _mbc.keys()){
_mbc[mb].rx_streamers.resize(_mbc[mb].rx_dsps.size());
_mbc[mb].tx_streamers.resize(1/*known to be 1 dsp*/);
}
//create a new pirate thread for each zc if (yarr!!)
size_t index = 0;
- BOOST_FOREACH(const std::string &mb, _mbc.keys()){
+ for(const std::string &mb: _mbc.keys()){
//spawn a new pirate to plunder the recv booty
_io_impl->pirate_tasks.push_back(task::make(boost::bind(
&usrp2_impl::io_impl::recv_pirate_loop, _io_impl.get(),
@@ -261,7 +261,7 @@ void usrp2_impl::update_tick_rate(const double rate){
_io_impl->tick_rate = rate; //shadow for async msg
//update the tick rate on all existing streamers -> thread safe
- BOOST_FOREACH(const std::string &mb, _mbc.keys()){
+ for(const std::string &mb: _mbc.keys()){
for (size_t i = 0; i < _mbc[mb].rx_streamers.size(); i++){
boost::shared_ptr<sph::recv_packet_streamer> my_streamer =
boost::dynamic_pointer_cast<sph::recv_packet_streamer>(_mbc[mb].rx_streamers[i].lock());
@@ -298,15 +298,15 @@ void usrp2_impl::update_tx_samp_rate(const std::string &mb, const size_t dsp, co
}
void usrp2_impl::update_rates(void){
- BOOST_FOREACH(const std::string &mb, _mbc.keys()){
+ for(const std::string &mb: _mbc.keys()){
fs_path root = "/mboards/" + mb;
_tree->access<double>(root / "tick_rate").update();
//and now that the tick rate is set, init the host rates to something
- BOOST_FOREACH(const std::string &name, _tree->list(root / "rx_dsps")){
+ for(const std::string &name: _tree->list(root / "rx_dsps")){
_tree->access<double>(root / "rx_dsps" / name / "rate" / "value").update();
}
- BOOST_FOREACH(const std::string &name, _tree->list(root / "tx_dsps")){
+ for(const std::string &name: _tree->list(root / "tx_dsps")){
_tree->access<double>(root / "tx_dsps" / name / "rate" / "value").update();
}
}
@@ -330,7 +330,7 @@ void usrp2_impl::update_rx_subdev_spec(const std::string &which_mb, const subdev
//compute the new occupancy and resize
_mbc[which_mb].rx_chan_occ = spec.size();
size_t nchan = 0;
- BOOST_FOREACH(const std::string &mb, _mbc.keys()) nchan += _mbc[mb].rx_chan_occ;
+ for(const std::string &mb: _mbc.keys()) nchan += _mbc[mb].rx_chan_occ;
}
void usrp2_impl::update_tx_subdev_spec(const std::string &which_mb, const subdev_spec_t &spec){
@@ -346,7 +346,7 @@ void usrp2_impl::update_tx_subdev_spec(const std::string &which_mb, const subdev
//compute the new occupancy and resize
_mbc[which_mb].tx_chan_occ = spec.size();
size_t nchan = 0;
- BOOST_FOREACH(const std::string &mb, _mbc.keys()) nchan += _mbc[mb].tx_chan_occ;
+ for(const std::string &mb: _mbc.keys()) nchan += _mbc[mb].tx_chan_occ;
}
/***********************************************************************
@@ -454,7 +454,7 @@ rx_streamer::sptr usrp2_impl::get_rx_stream(const uhd::stream_args_t &args_){
for (size_t chan_i = 0; chan_i < args.channels.size(); chan_i++){
const size_t chan = args.channels[chan_i];
size_t num_chan_so_far = 0;
- BOOST_FOREACH(const std::string &mb, _mbc.keys()){
+ for(const std::string &mb: _mbc.keys()){
num_chan_so_far += _mbc[mb].rx_chan_occ;
if (chan < num_chan_so_far){
const size_t dsp = chan + _mbc[mb].rx_chan_occ - num_chan_so_far;
@@ -524,7 +524,7 @@ tx_streamer::sptr usrp2_impl::get_tx_stream(const uhd::stream_args_t &args_){
const size_t chan = args.channels[chan_i];
size_t num_chan_so_far = 0;
size_t abs = 0;
- BOOST_FOREACH(const std::string &mb, _mbc.keys()){
+ for(const std::string &mb: _mbc.keys()){
num_chan_so_far += _mbc[mb].tx_chan_occ;
if (chan < num_chan_so_far){
const size_t dsp = chan + _mbc[mb].tx_chan_occ - num_chan_so_far;
diff --git a/host/lib/usrp/usrp2/n200_image_loader.cpp b/host/lib/usrp/usrp2/n200_image_loader.cpp
index c68484600..01a8faa5e 100644
--- a/host/lib/usrp/usrp2/n200_image_loader.cpp
+++ b/host/lib/usrp/usrp2/n200_image_loader.cpp
@@ -225,7 +225,7 @@ static uhd::device_addr_t n200_find(const image_loader::image_loader_args_t &ima
* this query. If the user supplied specific arguments that
* led to a USRP2, throw an error.
*/
- BOOST_FOREACH(const uhd::device_addr_t &dev, found){
+ for(const uhd::device_addr_t &dev: found){
rev_xport = udp_simple::make_connected(
dev.get("addr"),
BOOST_STRINGIZE(N200_UDP_FW_UPDATE_PORT)
@@ -257,7 +257,7 @@ static uhd::device_addr_t n200_find(const image_loader::image_loader_args_t &ima
std::string err_msg = "Could not resolve given args to a single N-Series device.\n"
"Applicable devices:\n";
- BOOST_FOREACH(const uhd::device_addr_t &dev, n200_found){
+ for(const uhd::device_addr_t &dev: n200_found){
err_msg += str(boost::format("* %s (addr=%s)\n")
% dev.get("hw_rev")
% dev.get("addr"));
diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp
index 021f0e3e5..100cec867 100644
--- a/host/lib/usrp/usrp2/usrp2_iface.cpp
+++ b/host/lib/usrp/usrp2/usrp2_iface.cpp
@@ -27,7 +27,6 @@
#include <uhd/utils/safe_call.hpp>
#include <uhd/types/dict.hpp>
#include <boost/thread.hpp>
-#include <boost/foreach.hpp>
#include <boost/asio.hpp> //used for htonl and ntohl
#include <boost/assign/list_of.hpp>
#include <boost/format.hpp>
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index ee2434fab..24756f0ef 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -29,7 +29,6 @@
#include <uhd/utils/byteswap.hpp>
#include <uhd/utils/safe_call.hpp>
#include <boost/format.hpp>
-#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/bind.hpp>
#include <boost/assign/list_of.hpp>
@@ -54,7 +53,7 @@ device_addrs_t usrp2_find(const device_addr_t &hint_){
if (hints.size() > 1){
device_addrs_t found_devices;
std::string error_msg;
- BOOST_FOREACH(const device_addr_t &hint_i, hints){
+ for(const device_addr_t &hint_i: hints){
device_addrs_t found_devices_i = usrp2_find(hint_i);
if (found_devices_i.size() != 1) error_msg += str(boost::format(
"Could not resolve device hint \"%s\" to a single device."
@@ -81,7 +80,7 @@ device_addrs_t usrp2_find(const device_addr_t &hint_){
//if no address was specified, send a broadcast on each interface
if (not hint.has_key("addr")){
- BOOST_FOREACH(const if_addrs_t &if_addrs, get_if_addrs()){
+ for(const if_addrs_t &if_addrs: get_if_addrs()){
//avoid the loopback device
if (if_addrs.inet == asio::ip::address_v4::loopback().to_string()) continue;
@@ -284,7 +283,7 @@ static zero_copy_if::sptr make_xport(
//only copy hints that contain the filter word
device_addr_t filtered_hints;
- BOOST_FOREACH(const std::string &key, hints.keys()){
+ for(const std::string &key: hints.keys()){
if (key.find(filter) == std::string::npos) continue;
filtered_hints[key] = hints[key];
}
@@ -547,7 +546,7 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
}
if (_mbc[mb].gps and _mbc[mb].gps->gps_detected())
{
- BOOST_FOREACH(const std::string &name, _mbc[mb].gps->get_sensors())
+ for(const std::string &name: _mbc[mb].gps->get_sensors())
{
_tree->create<sensor_value_t>(mb_path / "sensors" / name)
.set_publisher(boost::bind(&gps_ctrl::get_sensor, _mbc[mb].gps, name));
@@ -743,12 +742,12 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
//bind frontend corrections to the dboard freq props
const fs_path db_tx_fe_path = mb_path / "dboards" / "A" / "tx_frontends";
- BOOST_FOREACH(const std::string &name, _tree->list(db_tx_fe_path)){
+ for(const std::string &name: _tree->list(db_tx_fe_path)){
_tree->access<double>(db_tx_fe_path / name / "freq" / "value")
.add_coerced_subscriber(boost::bind(&usrp2_impl::set_tx_fe_corrections, this, mb, _1));
}
const fs_path db_rx_fe_path = mb_path / "dboards" / "A" / "rx_frontends";
- BOOST_FOREACH(const std::string &name, _tree->list(db_rx_fe_path)){
+ for(const std::string &name: _tree->list(db_rx_fe_path)){
_tree->access<double>(db_rx_fe_path / name / "freq" / "value")
.add_coerced_subscriber(boost::bind(&usrp2_impl::set_rx_fe_corrections, this, mb, _1));
}
@@ -759,14 +758,14 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
//do some post-init tasks
this->update_rates();
- BOOST_FOREACH(const std::string &mb, _mbc.keys()){
+ for(const std::string &mb: _mbc.keys()){
fs_path root = "/mboards/" + mb;
//reset cordic rates and their properties to zero
- BOOST_FOREACH(const std::string &name, _tree->list(root / "rx_dsps")){
+ for(const std::string &name: _tree->list(root / "rx_dsps")){
_tree->access<double>(root / "rx_dsps" / name / "freq" / "value").set(0.0);
}
- BOOST_FOREACH(const std::string &name, _tree->list(root / "tx_dsps")){
+ for(const std::string &name: _tree->list(root / "tx_dsps")){
_tree->access<double>(root / "tx_dsps" / name / "freq" / "value").set(0.0);
}
@@ -787,7 +786,7 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
}
usrp2_impl::~usrp2_impl(void){UHD_SAFE_CALL(
- BOOST_FOREACH(const std::string &mb, _mbc.keys()){
+ for(const std::string &mb: _mbc.keys()){
_mbc[mb].tx_dsp->set_updates(0, 0);
}
)}
diff --git a/host/lib/usrp/usrp_c.cpp b/host/lib/usrp/usrp_c.cpp
index 943f96db0..4d144fcaa 100644
--- a/host/lib/usrp/usrp_c.cpp
+++ b/host/lib/usrp/usrp_c.cpp
@@ -23,7 +23,6 @@
#include <uhd/error.h>
#include <uhd/usrp/usrp.h>
-#include <boost/foreach.hpp>
#include <boost/thread/mutex.hpp>
#include <string.h>
@@ -259,7 +258,7 @@ uhd_error uhd_usrp_find(
uhd::device_addrs_t devs = uhd::device::find(std::string(args), uhd::device::USRP);
(*strings_out)->string_vector_cpp.clear();
- BOOST_FOREACH(const uhd::device_addr_t &dev, devs){
+ for(const uhd::device_addr_t &dev: devs){
(*strings_out)->string_vector_cpp.push_back(dev.to_string());
}
)
diff --git a/host/lib/usrp/x300/x300_adc_ctrl.cpp b/host/lib/usrp/x300/x300_adc_ctrl.cpp
index fed2ffaf7..d9d0cb168 100644
--- a/host/lib/usrp/x300/x300_adc_ctrl.cpp
+++ b/host/lib/usrp/x300/x300_adc_ctrl.cpp
@@ -21,7 +21,6 @@
#include <uhd/utils/log.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhd/exception.hpp>
-#include <boost/foreach.hpp>
using namespace uhd;
diff --git a/host/lib/usrp/x300/x300_dac_ctrl.cpp b/host/lib/usrp/x300/x300_dac_ctrl.cpp
index 162eeb143..eb36f0798 100644
--- a/host/lib/usrp/x300/x300_dac_ctrl.cpp
+++ b/host/lib/usrp/x300/x300_dac_ctrl.cpp
@@ -22,7 +22,6 @@
#include <uhd/utils/log.hpp>
#include <uhd/utils/safe_call.hpp>
#include <uhd/exception.hpp>
-#include <boost/foreach.hpp>
#include <boost/thread/thread.hpp> //sleep
#define X300_DAC_FRONTEND_SYNC_FAILURE_FATAL
diff --git a/host/lib/usrp/x300/x300_dboard_iface.cpp b/host/lib/usrp/x300/x300_dboard_iface.cpp
index 092c888b0..e492fe2b3 100644
--- a/host/lib/usrp/x300/x300_dboard_iface.cpp
+++ b/host/lib/usrp/x300/x300_dboard_iface.cpp
@@ -34,7 +34,7 @@ x300_dboard_iface::x300_dboard_iface(const x300_dboard_iface_config_t &config):
//reset the aux dacs
_dac_regs[UNIT_RX] = ad5623_regs_t();
_dac_regs[UNIT_TX] = ad5623_regs_t();
- BOOST_FOREACH(unit_t unit, _dac_regs.keys())
+ for(unit_t unit: _dac_regs.keys())
{
_dac_regs[unit].data = 1;
_dac_regs[unit].addr = ad5623_regs_t::ADDR_ALL;
diff --git a/host/lib/usrp/x300/x300_fw_uart.cpp b/host/lib/usrp/x300/x300_fw_uart.cpp
index a2cbcc908..593873569 100644
--- a/host/lib/usrp/x300/x300_fw_uart.cpp
+++ b/host/lib/usrp/x300/x300_fw_uart.cpp
@@ -22,7 +22,6 @@
#include <uhd/types/serial.hpp>
#include <uhd/exception.hpp>
#include <boost/format.hpp>
-#include <boost/foreach.hpp>
#include <boost/thread/thread.hpp>
using namespace uhd;
@@ -65,7 +64,7 @@ struct x300_uart_iface : uart_iface
void write_uart(const std::string &buff)
{
boost::mutex::scoped_lock(_write_mutex);
- BOOST_FOREACH(const char ch, buff)
+ for(const char ch: buff)
{
this->putchar(ch);
}
diff --git a/host/lib/usrp/x300/x300_image_loader.cpp b/host/lib/usrp/x300/x300_image_loader.cpp
index f08b21f9b..e8c2a1329 100644
--- a/host/lib/usrp/x300/x300_image_loader.cpp
+++ b/host/lib/usrp/x300/x300_image_loader.cpp
@@ -167,7 +167,7 @@ static void x300_setup_session(x300_session_t &session,
std::string err_msg = "Could not resolve given args to a single X-Series device.\n"
"Applicable devices:\n";
- BOOST_FOREACH(const uhd::device_addr_t &dev, devs){
+ for(const uhd::device_addr_t &dev: devs){
std::string identifier = dev.has_key("addr") ? "addr"
: "resource";
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index edf254130..116e1e6eb 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -28,7 +28,6 @@
#include <uhd/utils/safe_call.hpp>
#include <uhd/usrp/subdev_spec.hpp>
#include <uhd/transport/if_addrs.hpp>
-#include <boost/foreach.hpp>
#include <boost/bind.hpp>
#include <boost/make_shared.hpp>
#include <boost/functional/hash.hpp>
@@ -183,7 +182,7 @@ static device_addrs_t x300_find_pcie(const device_addr_t &hint, bool explicit_qu
nirio_status status = niusrprio_session::enumerate(rpc_port_name, dev_info_vtr);
if (explicit_query) nirio_status_to_exception(status, "x300_find_pcie: Error enumerating NI-RIO devices.");
- BOOST_FOREACH(niusrprio_session::device_info &dev_info, dev_info_vtr)
+ for(niusrprio_session::device_info &dev_info: dev_info_vtr)
{
device_addr_t new_addr;
new_addr["type"] = "x300";
@@ -278,7 +277,7 @@ device_addrs_t x300_find(const device_addr_t &hint_)
{
device_addrs_t found_devices;
std::string error_msg;
- BOOST_FOREACH(const device_addr_t &hint_i, hints)
+ for(const device_addr_t &hint_i: hints)
{
device_addrs_t found_devices_i = x300_find(hint_i);
if (found_devices_i.size() != 1) error_msg += str(boost::format(
@@ -322,7 +321,7 @@ device_addrs_t x300_find(const device_addr_t &hint_)
if (!hint.has_key("resource"))
{
//otherwise, no address was specified, send a broadcast on each interface
- BOOST_FOREACH(const if_addrs_t &if_addrs, get_if_addrs())
+ for(const if_addrs_t &if_addrs: get_if_addrs())
{
//avoid the loopback device
if (if_addrs.inet == asio::ip::address_v4::loopback().to_string()) continue;
@@ -396,9 +395,9 @@ static void thread_msg_handler(uhd::msg::type_t type, const std::string &msg)
if (msg == thread_final_msg)
{
- BOOST_FOREACH(const thread_map_t::value_type &thread_pair, thread_list)
+ for(const thread_map_t::value_type &thread_pair: thread_list)
{
- BOOST_FOREACH(const msg_pair_t &msg_pair, thread_pair.second)
+ for(const msg_pair_t &msg_pair: thread_pair.second)
{
// Forward the message to the default handler
uhd::msg::default_msg_handler(msg_pair.first, msg_pair.second);
@@ -469,7 +468,7 @@ void x300_impl::mboard_members_t::discover_eth(
mb_eeprom_addrs.push_back(mb_eeprom[key]);
}
- BOOST_FOREACH(const std::string& addr, ip_addrs) {
+ for(const std::string& addr: ip_addrs) {
x300_eth_conn_t conn_iface;
conn_iface.addr = addr;
conn_iface.type = X300_IFACE_NONE;
@@ -626,7 +625,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
_tree->create<double>(mb_path / "link_max_rate").set(X300_MAX_RATE_PCIE);
}
- BOOST_FOREACH(const std::string &key, dev_addr.keys())
+ for(const std::string &key: dev_addr.keys())
{
if (key.find("recv") != std::string::npos) mb.recv_args[key] = dev_addr[key];
if (key.find("send") != std::string::npos) mb.send_args[key] = dev_addr[key];
@@ -932,7 +931,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
}
if (mb.gps and mb.gps->gps_detected())
{
- BOOST_FOREACH(const std::string &name, mb.gps->get_sensors())
+ for(const std::string &name: mb.gps->get_sensors())
{
_tree->create<sensor_value_t>(mb_path / "sensors" / name)
.set_publisher(boost::bind(&gps_ctrl::get_sensor, mb.gps, name));
@@ -1015,7 +1014,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
radio_ids.resize(2);
}
- BOOST_FOREACH(const rfnoc::block_id_t &id, radio_ids) {
+ for(const rfnoc::block_id_t &id: radio_ids) {
rfnoc::x300_radio_ctrl_impl::sptr radio(get_block_ctrl<rfnoc::x300_radio_ctrl_impl>(id));
mb.radios.push_back(radio);
radio->setup_radio(
@@ -1063,7 +1062,7 @@ x300_impl::~x300_impl(void)
{
try
{
- BOOST_FOREACH(mboard_members_t &mb, _mb)
+ for(mboard_members_t &mb: _mb)
{
//kill the claimer task and unclaim the device
mb.claimer_task.reset();
@@ -1432,7 +1431,7 @@ void x300_impl::update_clock_source(mboard_members_t &mb, const std::string &sou
}
// Reset ADCs and DACs
- BOOST_FOREACH(rfnoc::x300_radio_ctrl_impl::sptr r, mb.radios) {
+ for(rfnoc::x300_radio_ctrl_impl::sptr r: mb.radios) {
r->reset_codec();
}
}
@@ -1464,7 +1463,7 @@ void x300_impl::update_time_source(mboard_members_t &mb, const std::string &sour
void x300_impl::sync_times(mboard_members_t &mb, const uhd::time_spec_t& t)
{
std::vector<rfnoc::block_id_t> radio_ids = find_blocks<rfnoc::x300_radio_ctrl_impl>("Radio");
- BOOST_FOREACH(const rfnoc::block_id_t &id, radio_ids) {
+ for(const rfnoc::block_id_t &id: radio_ids) {
get_block_ctrl<rfnoc::x300_radio_ctrl_impl>(id)->set_time_sync(t);
}
diff --git a/host/lib/usrp/x300/x300_io_impl.cpp b/host/lib/usrp/x300/x300_io_impl.cpp
index 1584cee24..4dd9dce8a 100644
--- a/host/lib/usrp/x300/x300_io_impl.cpp
+++ b/host/lib/usrp/x300/x300_io_impl.cpp
@@ -26,7 +26,6 @@
#include <uhd/utils/tasks.hpp>
#include <uhd/utils/log.hpp>
#include <uhd/utils/msg.hpp>
-#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
using namespace uhd;
@@ -73,7 +72,7 @@ void x300_impl::post_streamer_hooks(direction_t dir)
// Loop through all tx streamers. Find all radios connected to one
// streamer. Sync those.
- BOOST_FOREACH(const boost::weak_ptr<uhd::tx_streamer> &streamer_w, _tx_streamers.vals()) {
+ for(const boost::weak_ptr<uhd::tx_streamer> &streamer_w: _tx_streamers.vals()) {
const boost::shared_ptr<sph::send_packet_streamer> streamer =
boost::dynamic_pointer_cast<sph::send_packet_streamer>(streamer_w.lock());
if (not streamer) {
diff --git a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp
index 9bf61f998..31a977884 100644
--- a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp
+++ b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp
@@ -82,7 +82,7 @@ UHD_RFNOC_RADIO_BLOCK_CONSTRUCTOR(x300_radio_ctrl)
if (_radio_type==PRIMARY) {
_fp_gpio = gpio_atr::gpio_atr_3000::make(ctrl, regs::sr_addr(regs::FP_GPIO), regs::RB_FP_GPIO);
- BOOST_FOREACH(const gpio_atr::gpio_attr_map_t::value_type attr, gpio_atr::gpio_attr_map) {
+ for(const gpio_atr::gpio_attr_map_t::value_type attr: gpio_atr::gpio_attr_map) {
_tree->create<uint32_t>(fs_path("gpio") / "FP0" / attr.second)
.set(0)
.add_coerced_subscriber(boost::bind(&gpio_atr::gpio_atr_3000::set_gpio_attr, _fp_gpio, attr.first, _1));
@@ -149,7 +149,7 @@ x300_radio_ctrl_impl::~x300_radio_ctrl_impl()
_tree->remove(_root_path / "rx_fe_corrections");
_tree->remove(_root_path / "tx_fe_corrections");
if (_radio_type==PRIMARY) {
- BOOST_FOREACH(const gpio_atr::gpio_attr_map_t::value_type attr, gpio_atr::gpio_attr_map) {
+ for(const gpio_atr::gpio_attr_map_t::value_type attr: gpio_atr::gpio_attr_map) {
_tree->remove(fs_path("gpio") / "FP0" / attr.second);
}
_tree->remove(fs_path("gpio") / "FP0" / "READBACK");
@@ -380,7 +380,7 @@ void x300_radio_ctrl_impl::setup_radio(
);
size_t rx_chan = 0, tx_chan = 0;
- BOOST_FOREACH(const std::string& fe, _db_manager->get_rx_frontends()) {
+ for(const std::string& fe: _db_manager->get_rx_frontends()) {
if (rx_chan >= _get_num_radios()) {
break;
}
@@ -393,7 +393,7 @@ void x300_radio_ctrl_impl::setup_radio(
_rx_fe_map[rx_chan].core->set_fe_connection(usrp::fe_connection_t(conn, if_freq));
rx_chan++;
}
- BOOST_FOREACH(const std::string& fe, _db_manager->get_tx_frontends()) {
+ for(const std::string& fe: _db_manager->get_tx_frontends()) {
if (tx_chan >= _get_num_radios()) {
break;
}