aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/device3
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/device3
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/device3')
-rw-r--r--host/lib/usrp/device3/device3_impl.cpp4
-rw-r--r--host/lib/usrp/device3/device3_io_impl.cpp12
2 files changed, 8 insertions, 8 deletions
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);
}
}