aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-06-28 19:10:55 -0700
committerJosh Blum <josh@joshknows.com>2011-06-28 19:10:55 -0700
commitebd2ecc6ff2b82cb06701bbcda17d4caaa4ba8c1 (patch)
tree458881f9c6fda810b0dc51a5ee12b89c24624b82 /host/include
parentcbbae2f5b4a429458892267254bdf6e25864f375 (diff)
downloaduhd-ebd2ecc6ff2b82cb06701bbcda17d4caaa4ba8c1.tar.gz
uhd-ebd2ecc6ff2b82cb06701bbcda17d4caaa4ba8c1.tar.bz2
uhd-ebd2ecc6ff2b82cb06701bbcda17d4caaa4ba8c1.zip
uhd: work getting multi-usrp working
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/property_tree.ipp13
1 files changed, 10 insertions, 3 deletions
diff --git a/host/include/uhd/property_tree.ipp b/host/include/uhd/property_tree.ipp
index 6bd88929d..e4520df58 100644
--- a/host/include/uhd/property_tree.ipp
+++ b/host/include/uhd/property_tree.ipp
@@ -18,6 +18,7 @@
#ifndef INCLUDED_UHD_PROPERTY_TREE_IPP
#define INCLUDED_UHD_PROPERTY_TREE_IPP
+#include <uhd/exception.hpp>
#include <boost/foreach.hpp>
#include <vector>
@@ -51,9 +52,10 @@ public:
}
property<T> &set(const T &value){
- _value = _master.empty()? value : _master(value);
+ T new_value(_master.empty()? value : _master(value));
+ _value = new_value; //shadow it
BOOST_FOREACH(typename property<T>::subscriber_type &subscriber, _subscribers){
- subscriber(this->get()); //let errors propagate
+ subscriber(new_value); //let errors propagate
}
return *this;
}
@@ -88,7 +90,12 @@ namespace uhd{
}
template <typename T> property<T> &property_tree::access(const path_type &path){
- return *boost::any_cast<typename property<T>::sptr>(this->_access(path));
+ try{
+ return *boost::any_cast<typename property<T>::sptr>(this->_access(path));
+ }
+ catch(const boost::bad_any_cast &){
+ throw uhd::type_error("Cannot cast the property at: " + path.string());
+ }
}
} //namespace uhd