diff options
author | Josh Blum <josh@joshknows.com> | 2010-04-25 22:05:50 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-04-25 22:05:50 -0700 |
commit | 61ec6711bb4bbae7a8a26cc631eeb88fb3e7d688 (patch) | |
tree | 12cfaf308bcbd779dd5a1254b12a6104088629cc /host/lib/usrp/usrp2/dsp_impl.cpp | |
parent | d1d6c859f0dbae5f044519d589d5ad3fcbb8643e (diff) | |
download | uhd-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/usrp2/dsp_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/dsp_impl.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/host/lib/usrp/usrp2/dsp_impl.cpp b/host/lib/usrp/usrp2/dsp_impl.cpp index 204277ba7..379276f7d 100644 --- a/host/lib/usrp/usrp2/dsp_impl.cpp +++ b/host/lib/usrp/usrp2/dsp_impl.cpp @@ -117,6 +117,8 @@ void usrp2_impl::ddc_get(const wax::obj &key, wax::obj &val){ case DSP_PROP_HOST_RATE: val = get_master_clock_freq()/_ddc_decim; return; + + default: UHD_THROW_PROP_WRITE_ONLY(); } } @@ -139,8 +141,7 @@ void usrp2_impl::ddc_set(const wax::obj &key, const wax::obj &val){ } return; - default: - throw std::runtime_error("Error: trying to set read-only property on usrp2 ddc0"); + default: UHD_THROW_PROP_READ_ONLY(); } } @@ -200,6 +201,8 @@ void usrp2_impl::duc_get(const wax::obj &key, wax::obj &val){ case DSP_PROP_HOST_RATE: val = get_master_clock_freq()/_duc_interp; return; + + default: UHD_THROW_PROP_WRITE_ONLY(); } } @@ -222,7 +225,6 @@ void usrp2_impl::duc_set(const wax::obj &key, const wax::obj &val){ } return; - default: - throw std::runtime_error("Error: trying to set read-only property on usrp2 duc0"); + default: UHD_THROW_PROP_READ_ONLY(); } } |