device_addr_t uhd::combine_device_addrs(const device_addrs_t &dev_addrs){ device_addr_t dev_addr; for (size_t i = 0; i < dev_addrs.size(); i++){ for(const std::string &key: dev_addrs[i].keys()){ dev_addr[str(boost::format("%s%d") % key % i)] = dev_addrs[i][key]; } } return dev_addr; }
//! combine a vector in device addresses into an indexed device address device_addr_t combine_dev_addr_vector(const device_addrs_t &dev_addrs){ device_addr_t dev_addr; for (size_t i = 0; i < dev_addrs.size(); i++){ BOOST_FOREACH(const std::string &key, dev_addrs[i].keys()){ dev_addr[str(boost::format("%s%d") % key % i)] = dev_addrs[i][key]; } } return dev_addr; }