From ebd2ecc6ff2b82cb06701bbcda17d4caaa4ba8c1 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 28 Jun 2011 19:10:55 -0700 Subject: uhd: work getting multi-usrp working --- host/include/uhd/property_tree.ipp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'host/include') 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 #include #include @@ -51,9 +52,10 @@ public: } property &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::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 property &property_tree::access(const path_type &path){ - return *boost::any_cast::sptr>(this->_access(path)); + try{ + return *boost::any_cast::sptr>(this->_access(path)); + } + catch(const boost::bad_any_cast &){ + throw uhd::type_error("Cannot cast the property at: " + path.string()); + } } } //namespace uhd -- cgit v1.2.3