summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-04-05 18:11:32 -0700
committerJosh Blum <josh@joshknows.com>2010-04-05 18:11:32 -0700
commited5cb33eb402c5d34c330d1b9dcb99658c628a72 (patch)
treebb0a96351c4ce770b5f468558c1b8ff056f05e8e
parent57f1f769e5e5bb07a5385955eee9390d0e1de908 (diff)
downloaduhd-ed5cb33eb402c5d34c330d1b9dcb99658c628a72.tar.gz
uhd-ed5cb33eb402c5d34c330d1b9dcb99658c628a72.tar.bz2
uhd-ed5cb33eb402c5d34c330d1b9dcb99658c628a72.zip
renamed dict get key and value methods
-rw-r--r--host/include/uhd/types/dict.hpp4
-rw-r--r--host/lib/device.cpp4
-rw-r--r--host/lib/types.cpp4
-rw-r--r--host/lib/usrp/dboard_manager.cpp4
-rw-r--r--host/test/addr_test.cpp8
-rw-r--r--host/test/gain_handler_test.cpp2
6 files changed, 13 insertions, 13 deletions
diff --git a/host/include/uhd/types/dict.hpp b/host/include/uhd/types/dict.hpp
index 22f702575..c8fbc5a9f 100644
--- a/host/include/uhd/types/dict.hpp
+++ b/host/include/uhd/types/dict.hpp
@@ -73,7 +73,7 @@ namespace uhd{
* Key order depends on insertion precedence.
* \return vector of keys
*/
- std::vector<Key> get_keys(void) const{
+ const std::vector<Key> keys(void) const{
std::vector<Key> keys;
BOOST_FOREACH(const pair_t &p, _map){
keys.push_back(p.first);
@@ -86,7 +86,7 @@ namespace uhd{
* Value order depends on insertion precedence.
* \return vector of values
*/
- std::vector<Val> get_vals(void) const{
+ const std::vector<Val> vals(void) const{
std::vector<Val> vals;
BOOST_FOREACH(const pair_t &p, _map){
vals.push_back(p.second);
diff --git a/host/lib/device.cpp b/host/lib/device.cpp
index 27a365d34..0197a6232 100644
--- a/host/lib/device.cpp
+++ b/host/lib/device.cpp
@@ -42,7 +42,7 @@ static size_t hash_device_addr(
const device_addr_t &dev_addr
){
//sort the keys of the device address
- std::vector<std::string> keys = dev_addr.get_keys();
+ std::vector<std::string> keys = dev_addr.keys();
std::sort(keys.begin(), keys.end());
//combine the hashes of sorted keys/value pairs
@@ -99,7 +99,7 @@ device::sptr device::make(const device_addr_t &hint, size_t which){
BOOST_FOREACH(device_addr_t dev_addr, fcn.get<0>()(hint)){
//copy keys that were in hint but not in dev_addr
//this way, we can pass additional transport arguments
- BOOST_FOREACH(const std::string &key, hint.get_keys()){
+ BOOST_FOREACH(const std::string &key, hint.keys()){
if (not dev_addr.has_key(key)) dev_addr[key] = hint[key];
}
//append the discovered address and its factory function
diff --git a/host/lib/types.cpp b/host/lib/types.cpp
index d87238161..61a63b710 100644
--- a/host/lib/types.cpp
+++ b/host/lib/types.cpp
@@ -122,7 +122,7 @@ time_spec_t::time_spec_t(boost::posix_time::ptime time, double tick_rate){
std::string device_addr_t::to_string(void) const{
const device_addr_t &device_addr = *this;
std::stringstream ss;
- BOOST_FOREACH(std::string key, device_addr.get_keys()){
+ BOOST_FOREACH(std::string key, device_addr.keys()){
ss << boost::format("%s: %s") % key % device_addr[key] << std::endl;
}
return ss.str();
@@ -138,7 +138,7 @@ static std::string trim(const std::string &in){
std::string device_addr_t::to_args_str(void) const{
std::string args_str;
const device_addr_t &device_addr = *this;
- BOOST_FOREACH(const std::string &key, device_addr.get_keys()){
+ BOOST_FOREACH(const std::string &key, device_addr.keys()){
args_str += key + pair_delim + device_addr[key] + arg_delim;
}
return args_str;
diff --git a/host/lib/usrp/dboard_manager.cpp b/host/lib/usrp/dboard_manager.cpp
index 3a5cf3a35..4cf2e5820 100644
--- a/host/lib/usrp/dboard_manager.cpp
+++ b/host/lib/usrp/dboard_manager.cpp
@@ -250,11 +250,11 @@ dboard_manager_impl::~dboard_manager_impl(void){
}
prop_names_t dboard_manager_impl::get_rx_subdev_names(void){
- return _rx_dboards.get_keys();
+ return _rx_dboards.keys();
}
prop_names_t dboard_manager_impl::get_tx_subdev_names(void){
- return _tx_dboards.get_keys();
+ return _tx_dboards.keys();
}
wax::obj dboard_manager_impl::get_rx_subdev(const std::string &subdev_name){
diff --git a/host/test/addr_test.cpp b/host/test/addr_test.cpp
index a5d2d4c06..2ec6de14b 100644
--- a/host/test/addr_test.cpp
+++ b/host/test/addr_test.cpp
@@ -50,16 +50,16 @@ BOOST_AUTO_TEST_CASE(test_device_addr){
BOOST_CHECK_EQUAL(dev_addr.size(), new_dev_addr.size());
//the keys should match
- std::vector<std::string> old_dev_addr_keys = dev_addr.get_keys();
- std::vector<std::string> new_dev_addr_keys = new_dev_addr.get_keys();
+ std::vector<std::string> old_dev_addr_keys = dev_addr.keys();
+ std::vector<std::string> new_dev_addr_keys = new_dev_addr.keys();
BOOST_CHECK_EQUAL_COLLECTIONS(
old_dev_addr_keys.begin(), old_dev_addr_keys.end(),
new_dev_addr_keys.begin(), new_dev_addr_keys.end()
);
//the vals should match
- std::vector<std::string> old_dev_addr_vals = dev_addr.get_vals();
- std::vector<std::string> new_dev_addr_vals = new_dev_addr.get_vals();
+ std::vector<std::string> old_dev_addr_vals = dev_addr.vals();
+ std::vector<std::string> new_dev_addr_vals = new_dev_addr.vals();
BOOST_CHECK_EQUAL_COLLECTIONS(
old_dev_addr_vals.begin(), old_dev_addr_vals.end(),
new_dev_addr_vals.begin(), new_dev_addr_vals.end()
diff --git a/host/test/gain_handler_test.cpp b/host/test/gain_handler_test.cpp
index 72d26e1c2..bf2ec5db7 100644
--- a/host/test/gain_handler_test.cpp
+++ b/host/test/gain_handler_test.cpp
@@ -70,7 +70,7 @@ private:
return;
case PROP_GAIN_NAMES:
- val = _gain_values.get_keys();
+ val = _gain_values.keys();
return;
}
}