aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/db_rfx.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-04-25 22:05:50 -0700
committerJosh Blum <josh@joshknows.com>2010-04-25 22:05:50 -0700
commit61ec6711bb4bbae7a8a26cc631eeb88fb3e7d688 (patch)
tree12cfaf308bcbd779dd5a1254b12a6104088629cc /host/lib/usrp/dboard/db_rfx.cpp
parentd1d6c859f0dbae5f044519d589d5ad3fcbb8643e (diff)
downloaduhd-61ec6711bb4bbae7a8a26cc631eeb88fb3e7d688.tar.gz
uhd-61ec6711bb4bbae7a8a26cc631eeb88fb3e7d688.tar.bz2
uhd-61ec6711bb4bbae7a8a26cc631eeb88fb3e7d688.zip
Work on exceptions.
Added props exception macro to make the set/get prop switch statements easier. Made use of boost throw exception macro for throw-site information in throw assert.
Diffstat (limited to 'host/lib/usrp/dboard/db_rfx.cpp')
-rw-r--r--host/lib/usrp/dboard/db_rfx.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp
index 76b2c6d7a..49ec9412c 100644
--- a/host/lib/usrp/dboard/db_rfx.cpp
+++ b/host/lib/usrp/dboard/db_rfx.cpp
@@ -396,6 +396,8 @@ void rfx_xcvr::rx_get(const wax::obj &key_, wax::obj &val){
case SUBDEV_PROP_USE_LO_OFFSET:
val = false;
return;
+
+ default: UHD_THROW_PROP_WRITE_ONLY();
}
}
@@ -419,10 +421,7 @@ void rfx_xcvr::rx_set(const wax::obj &key_, const wax::obj &val){
set_rx_ant(val.as<std::string>());
return;
- default:
- throw std::runtime_error(str(boost::format(
- "Error: trying to set read-only property on %s subdev"
- ) % dboard_id::to_string(get_rx_id())));
+ default: UHD_THROW_PROP_READ_ONLY();
}
}
@@ -486,6 +485,8 @@ void rfx_xcvr::tx_get(const wax::obj &key_, wax::obj &val){
case SUBDEV_PROP_USE_LO_OFFSET:
val = true;
return;
+
+ default: UHD_THROW_PROP_WRITE_ONLY();
}
}
@@ -509,9 +510,6 @@ void rfx_xcvr::tx_set(const wax::obj &key_, const wax::obj &val){
ASSERT_THROW(val.as<std::string>() == "TX/RX");
return;
- default:
- throw std::runtime_error(str(boost::format(
- "Error: trying to set read-only property on %s subdev"
- ) % dboard_id::to_string(get_tx_id())));
+ default: UHD_THROW_PROP_READ_ONLY();
}
}