diff options
author | Ashish Chaudhari <ashish@ettus.com> | 2017-04-04 19:00:30 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-04-05 17:16:31 -0700 |
commit | 15d9c6850c23c867c8ec823dedd20c7ec09d7e6b (patch) | |
tree | ec6f8a30fd40325df793a41de0969f4848a070b9 /host/lib/usrp | |
parent | 81db2fcacf3f17e599c05c3066a127c686798a68 (diff) | |
download | uhd-15d9c6850c23c867c8ec823dedd20c7ec09d7e6b.tar.gz uhd-15d9c6850c23c867c8ec823dedd20c7ec09d7e6b.tar.bz2 uhd-15d9c6850c23c867c8ec823dedd20c7ec09d7e6b.zip |
multi_usrp: Removed ordering req. from prop_tree path access
- Path getters for mboard, rx_dsp and tx_dsp concat the numeric
channel to the tree path instead of indexing a list. This allows
for easier multi threaded tree construction because values
can be placed in the tree in a random order.
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/multi_usrp.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp index d64ff8ebd..9ae628eb7 100644 --- a/host/lib/usrp/multi_usrp.cpp +++ b/host/lib/usrp/multi_usrp.cpp @@ -1754,8 +1754,12 @@ private: { try { - const std::string name = _tree->list("/mboards").at(mboard); - return "/mboards/" + name; + const std::string tree_path = "/mboards/" + boost::lexical_cast<std::string>(mboard); + if (_tree->exists(tree_path)) { + return tree_path; + } else { + throw uhd::index_error(str(boost::format("multi_usrp::mb_root(%u) - path not found") % mboard)); + } } catch(const std::exception &e) { @@ -1778,8 +1782,12 @@ private: try { - const std::string name = _tree->list(mb_root(mcp.mboard) / "rx_dsps").at(mcp.chan); - return mb_root(mcp.mboard) / "rx_dsps" / name; + const std::string tree_path = mb_root(mcp.mboard) / "rx_dsps" / boost::lexical_cast<std::string>(mcp.chan); + if (_tree->exists(tree_path)) { + return tree_path; + } else { + throw uhd::index_error(str(boost::format("multi_usrp::rx_dsp_root(%u) - mcp(%u) - path not found") % chan % mcp.chan)); + } } catch(const std::exception &e) { @@ -1801,8 +1809,12 @@ private: } try { - const std::string name = _tree->list(mb_root(mcp.mboard) / "tx_dsps").at(mcp.chan); - return mb_root(mcp.mboard) / "tx_dsps" / name; + const std::string tree_path = mb_root(mcp.mboard) / "tx_dsps" / boost::lexical_cast<std::string>(mcp.chan); + if (_tree->exists(tree_path)) { + return tree_path; + } else { + throw uhd::index_error(str(boost::format("multi_usrp::tx_dsp_root(%u) - mcp(%u) - path not found") % chan % mcp.chan)); + } } catch(const std::exception &e) { |