diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-10-17 16:01:22 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 12:21:32 -0800 |
commit | 72b45bb8def087f2eff09ed671de788978853e2a (patch) | |
tree | 87fc86059b61e5dc43ba19332056075bef845f6d /host/lib/device.cpp | |
parent | d3a16b702230534f7265613a73204bdb051a458e (diff) | |
download | uhd-72b45bb8def087f2eff09ed671de788978853e2a.tar.gz uhd-72b45bb8def087f2eff09ed671de788978853e2a.tar.bz2 uhd-72b45bb8def087f2eff09ed671de788978853e2a.zip |
uhd: Remove all usages of boost::tuple and friends
This replaces all of the following with standard C++ features:
- boost::tuple
- boost::make_tuple
- boost::tuple::get
- #include <boost/tuple/tuple.hpp>
All usages were replaced with search-and-replace scripts (the usages of
get could be automatically replaced with a vim macro, the rest was
straightforward search-and-replace).
Diffstat (limited to 'host/lib/device.cpp')
-rw-r--r-- | host/lib/device.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/host/lib/device.cpp b/host/lib/device.cpp index c17713bbd..1749f4a60 100644 --- a/host/lib/device.cpp +++ b/host/lib/device.cpp @@ -16,11 +16,11 @@ #include <boost/format.hpp> #include <boost/functional/hash.hpp> -#include <boost/tuple/tuple.hpp> #include <boost/thread/mutex.hpp> #include <future> #include <memory> +#include <tuple> using namespace uhd; @@ -70,7 +70,7 @@ static size_t hash_device_addr( /*********************************************************************** * Registration **********************************************************************/ -typedef boost::tuple<device::find_t, device::make_t, device::device_filter_t> dev_fcn_reg_t; +typedef std::tuple<device::find_t, device::make_t, device::device_filter_t> dev_fcn_reg_t; // instantiate the device function registry container UHD_SINGLETON_FCN(std::vector<dev_fcn_reg_t>, get_dev_fcn_regs) @@ -97,10 +97,10 @@ device_addrs_t device::find(const device_addr_t &hint, device_filter_t filter){ device_addrs_t device_addrs; std::vector<std::future<device_addrs_t>> find_tasks; for (const auto& fcn : get_dev_fcn_regs()) { - if (filter == ANY or fcn.get<2>() == filter) { + if (filter == ANY or std::get<2>(fcn) == filter) { find_tasks.emplace_back(std::async(std::launch::async, [fcn, hint](){ - return fcn.get<0>()(hint); + return std::get<0>(fcn)(hint); } )); } @@ -128,15 +128,15 @@ device_addrs_t device::find(const device_addr_t &hint, device_filter_t filter){ device::sptr device::make(const device_addr_t &hint, device_filter_t filter, size_t which){ boost::mutex::scoped_lock lock(_device_mutex); - typedef boost::tuple<device_addr_t, make_t> dev_addr_make_t; + typedef std::tuple<device_addr_t, make_t> dev_addr_make_t; std::vector<dev_addr_make_t> dev_addr_makers; for(const dev_fcn_reg_t &fcn: get_dev_fcn_regs()){ try{ - if(filter == ANY or fcn.get<2>() == filter){ - for(device_addr_t dev_addr: fcn.get<0>()(hint)){ + if(filter == ANY or std::get<2>(fcn) == filter){ + for(device_addr_t dev_addr: std::get<0>(fcn)(hint)){ //append the discovered address and its factory function - dev_addr_makers.push_back(dev_addr_make_t(dev_addr, fcn.get<1>())); + dev_addr_makers.push_back(dev_addr_make_t(dev_addr, std::get<1>(fcn))); } } } @@ -161,7 +161,7 @@ device::sptr device::make(const device_addr_t &hint, device_filter_t filter, siz //create a unique hash for the device address device_addr_t dev_addr; make_t maker; - boost::tie(dev_addr, maker) = dev_addr_makers.at(which); + std::tie(dev_addr, maker) = dev_addr_makers.at(which); size_t dev_hash = hash_device_addr(dev_addr); UHD_LOGGER_TRACE("UHD") << boost::format("Device hash: %u") % dev_hash ; |