diff options
Diffstat (limited to 'host/lib/usrp/subdev_spec.cpp')
-rw-r--r-- | host/lib/usrp/subdev_spec.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/host/lib/usrp/subdev_spec.cpp b/host/lib/usrp/subdev_spec.cpp index 6912afec8..b7eb64f87 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> @@ -44,8 +43,16 @@ bool usrp::operator==(const subdev_spec_pair_t &lhs, const subdev_spec_pair_t &r return (lhs.db_name == rhs.db_name) and (lhs.sd_name == rhs.sd_name); } +bool subdev_spec_pair_t::operator==(const subdev_spec_pair_t &other){ + return (other.db_name == db_name) and (other.sd_name == sd_name); +} + +bool subdev_spec_pair_t::operator!=(const subdev_spec_pair_t &other){ + return (other.db_name != db_name) or (other.sd_name != sd_name); +} + 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 +69,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 +80,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; |