aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/db_wbx.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-08-15 10:51:25 -0700
committerJosh Blum <josh@joshknows.com>2010-08-15 10:51:25 -0700
commit98ba0cc067489d417342314a7e7408d2dbbc8250 (patch)
tree7fdcaf08c5bbf150bd03711c9909ed5ca77f1818 /host/lib/usrp/dboard/db_wbx.cpp
parent6c3d37caa3a47ca534c5e3a110adad0137d5d06d (diff)
downloaduhd-98ba0cc067489d417342314a7e7408d2dbbc8250.tar.gz
uhd-98ba0cc067489d417342314a7e7408d2dbbc8250.tar.bz2
uhd-98ba0cc067489d417342314a7e7408d2dbbc8250.zip
uhd: extract named prop returns a named prop (not a tuple)
simplifies the code after the property set/get declaration
Diffstat (limited to 'host/lib/usrp/dboard/db_wbx.cpp')
-rw-r--r--host/lib/usrp/dboard/db_wbx.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/host/lib/usrp/dboard/db_wbx.cpp b/host/lib/usrp/dboard/db_wbx.cpp
index 3038ce30b..ccd897674 100644
--- a/host/lib/usrp/dboard/db_wbx.cpp
+++ b/host/lib/usrp/dboard/db_wbx.cpp
@@ -467,8 +467,7 @@ double wbx_xcvr::set_lo_freq(
* RX Get and Set
**********************************************************************/
void wbx_xcvr::rx_get(const wax::obj &key_, wax::obj &val){
- wax::obj key; std::string name;
- boost::tie(key, name) = extract_named_prop(key_);
+ named_prop_t key = named_prop_t::extract(key_);
//handle the get request conditioned on the key
switch(key.as<subdev_prop_t>()){
@@ -481,13 +480,13 @@ void wbx_xcvr::rx_get(const wax::obj &key_, wax::obj &val){
return;
case SUBDEV_PROP_GAIN:
- assert_has(_rx_gains.keys(), name, "wbx rx gain name");
- val = _rx_gains[name];
+ assert_has(_rx_gains.keys(), key.name, "wbx rx gain name");
+ val = _rx_gains[key.name];
return;
case SUBDEV_PROP_GAIN_RANGE:
- assert_has(wbx_rx_gain_ranges.keys(), name, "wbx rx gain name");
- val = wbx_rx_gain_ranges[name];
+ assert_has(wbx_rx_gain_ranges.keys(), key.name, "wbx rx gain name");
+ val = wbx_rx_gain_ranges[key.name];
return;
case SUBDEV_PROP_GAIN_NAMES:
@@ -527,8 +526,7 @@ void wbx_xcvr::rx_get(const wax::obj &key_, wax::obj &val){
}
void wbx_xcvr::rx_set(const wax::obj &key_, const wax::obj &val){
- wax::obj key; std::string name;
- boost::tie(key, name) = extract_named_prop(key_);
+ named_prop_t key = named_prop_t::extract(key_);
//handle the get request conditioned on the key
switch(key.as<subdev_prop_t>()){
@@ -538,7 +536,7 @@ void wbx_xcvr::rx_set(const wax::obj &key_, const wax::obj &val){
return;
case SUBDEV_PROP_GAIN:
- this->set_rx_gain(val.as<float>(), name);
+ this->set_rx_gain(val.as<float>(), key.name);
return;
case SUBDEV_PROP_ANTENNA:
@@ -553,8 +551,7 @@ void wbx_xcvr::rx_set(const wax::obj &key_, const wax::obj &val){
* TX Get and Set
**********************************************************************/
void wbx_xcvr::tx_get(const wax::obj &key_, wax::obj &val){
- wax::obj key; std::string name;
- boost::tie(key, name) = extract_named_prop(key_);
+ named_prop_t key = named_prop_t::extract(key_);
//handle the get request conditioned on the key
switch(key.as<subdev_prop_t>()){
@@ -567,13 +564,13 @@ void wbx_xcvr::tx_get(const wax::obj &key_, wax::obj &val){
return;
case SUBDEV_PROP_GAIN:
- assert_has(_tx_gains.keys(), name, "wbx tx gain name");
- val = _tx_gains[name];
+ assert_has(_tx_gains.keys(), key.name, "wbx tx gain name");
+ val = _tx_gains[key.name];
return;
case SUBDEV_PROP_GAIN_RANGE:
- assert_has(wbx_tx_gain_ranges.keys(), name, "wbx tx gain name");
- val = wbx_tx_gain_ranges[name];
+ assert_has(wbx_tx_gain_ranges.keys(), key.name, "wbx tx gain name");
+ val = wbx_tx_gain_ranges[key.name];
return;
case SUBDEV_PROP_GAIN_NAMES:
@@ -613,8 +610,7 @@ void wbx_xcvr::tx_get(const wax::obj &key_, wax::obj &val){
}
void wbx_xcvr::tx_set(const wax::obj &key_, const wax::obj &val){
- wax::obj key; std::string name;
- boost::tie(key, name) = extract_named_prop(key_);
+ named_prop_t key = named_prop_t::extract(key_);
//handle the get request conditioned on the key
switch(key.as<subdev_prop_t>()){
@@ -624,7 +620,7 @@ void wbx_xcvr::tx_set(const wax::obj &key_, const wax::obj &val){
return;
case SUBDEV_PROP_GAIN:
- this->set_tx_gain(val.as<float>(), name);
+ this->set_tx_gain(val.as<float>(), key.name);
return;
case SUBDEV_PROP_ANTENNA: