diff options
author | Thomas Habets <thomas@habets.se> | 2020-03-22 14:55:14 +0000 |
---|---|---|
committer | Martin Braun <martin@gnuradio.org> | 2020-03-27 08:45:52 -0700 |
commit | 5a9f864c9befdee426da6ddaec6e96c63e571bc3 (patch) | |
tree | e1529ddef962be3843eefb94d8619b79a79c8aca /gnuradio-runtime | |
parent | 414a495d639ffb817dd3c04d771719e938f50daf (diff) |
Replace BOOST_FOREACH with C++11 range for
Diffstat (limited to 'gnuradio-runtime')
-rw-r--r-- | gnuradio-runtime/include/gnuradio/basic_block.h | 5 | ||||
-rw-r--r-- | gnuradio-runtime/lib/prefs.cc | 5 | ||||
-rw-r--r-- | gnuradio-runtime/lib/tpb_thread_body.cc | 3 |
3 files changed, 5 insertions, 8 deletions
diff --git a/gnuradio-runtime/include/gnuradio/basic_block.h b/gnuradio-runtime/include/gnuradio/basic_block.h index 1f84a97c5b..90c9c2f8bc 100644 --- a/gnuradio-runtime/include/gnuradio/basic_block.h +++ b/gnuradio-runtime/include/gnuradio/basic_block.h @@ -18,7 +18,6 @@ #include <gnuradio/sptr_magic.h> #include <gnuradio/thread/thread.h> #include <boost/enable_shared_from_this.hpp> -#include <boost/foreach.hpp> #include <boost/function.hpp> #include <boost/thread/condition_variable.hpp> #include <deque> @@ -226,7 +225,7 @@ public: bool empty_p() { bool rv = true; - BOOST_FOREACH (msg_queue_map_t::value_type& i, msg_queue) { + for (const auto& i : msg_queue) { rv &= msg_queue[i.first].empty(); } return rv; @@ -240,7 +239,7 @@ public: bool empty_handled_p() { bool rv = true; - BOOST_FOREACH (msg_queue_map_t::value_type& i, msg_queue) { + for (const auto& i : msg_queue) { rv &= empty_handled_p(i.first); } return rv; diff --git a/gnuradio-runtime/lib/prefs.cc b/gnuradio-runtime/lib/prefs.cc index 6eefcfd569..f87bb7a10c 100644 --- a/gnuradio-runtime/lib/prefs.cc +++ b/gnuradio-runtime/lib/prefs.cc @@ -23,7 +23,6 @@ #include <boost/filesystem/fstream.hpp> #include <boost/filesystem/operations.hpp> #include <boost/filesystem/path.hpp> -#include <boost/foreach.hpp> #include <boost/program_options.hpp> namespace fs = boost::filesystem; namespace po = boost::program_options; @@ -73,13 +72,13 @@ std::vector<std::string> prefs::_sys_prefs_filenames() void prefs::_read_files(const std::vector<std::string>& filenames) { - BOOST_FOREACH (std::string fname, filenames) { + for (const auto& fname : filenames) { std::ifstream infile(fname.c_str()); if (infile.good()) { try { po::basic_parsed_options<char_t> parsed = po::parse_config_file(infile, po::options_description(), true); - BOOST_FOREACH (po::basic_option<char_t> o, (parsed.options)) { + for (const auto& o : parsed.options) { std::string okey = o.string_key; size_t pos = okey.find("."); std::string section, key; diff --git a/gnuradio-runtime/lib/tpb_thread_body.cc b/gnuradio-runtime/lib/tpb_thread_body.cc index d262427b35..fd5b278cb9 100644 --- a/gnuradio-runtime/lib/tpb_thread_body.cc +++ b/gnuradio-runtime/lib/tpb_thread_body.cc @@ -15,7 +15,6 @@ #include "tpb_thread_body.h" #include <gnuradio/prefs.h> #include <pmt/pmt.h> -#include <boost/foreach.hpp> #include <boost/thread.hpp> #include <iostream> @@ -87,7 +86,7 @@ tpb_thread_body::tpb_thread_body(block_sptr block, d->d_tpb.clear_changed(); // handle any queued up messages - BOOST_FOREACH (basic_block::msg_queue_map_t::value_type& i, block->msg_queue) { + for (const auto& i : block->msg_queue) { // Check if we have a message handler attached before getting // any messages. This is mostly a protection for the unknown // startup sequence of the threads. |