diff options
Diffstat (limited to 'host/lib/device.cpp')
-rw-r--r-- | host/lib/device.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/host/lib/device.cpp b/host/lib/device.cpp index 386588a08..0002bee6e 100644 --- a/host/lib/device.cpp +++ b/host/lib/device.cpp @@ -17,7 +17,7 @@ #include <uhd/device.hpp> #include <uhd/types/dict.hpp> -#include <uhd/utils/assert.hpp> +#include <uhd/exception.hpp> #include <uhd/utils/static.hpp> #include <uhd/utils/algorithm.hpp> #include <boost/foreach.hpp> @@ -25,7 +25,6 @@ #include <boost/weak_ptr.hpp> #include <boost/functional/hash.hpp> #include <boost/tuple/tuple.hpp> -#include <stdexcept> #include <iostream> using namespace uhd; @@ -44,7 +43,7 @@ static size_t hash_device_addr( ){ //combine the hashes of sorted keys/value pairs size_t hash = 0; - BOOST_FOREACH(const std::string &key, std::sorted(dev_addr.keys())){ + BOOST_FOREACH(const std::string &key, uhd::sorted(dev_addr.keys())){ boost::hash_combine(hash, key); boost::hash_combine(hash, dev_addr[key]); } @@ -106,14 +105,14 @@ device::sptr device::make(const device_addr_t &hint, size_t which){ //check that we found any devices if (dev_addr_makers.size() == 0){ - throw std::runtime_error(str( + throw uhd::key_error(str( boost::format("No devices found for ----->\n%s") % hint.to_pp_string() )); } //check that the which index is valid if (dev_addr_makers.size() <= which){ - throw std::runtime_error(str( + throw uhd::index_error(str( boost::format("No device at index %d for ----->\n%s") % which % hint.to_pp_string() )); } @@ -140,7 +139,7 @@ device::sptr device::make(const device_addr_t &hint, size_t which){ return hash_to_device[dev_hash].lock(); } //create and register a new device - catch(const uhd::assert_error &){ + catch(const uhd::assertion_error &){ device::sptr dev = maker(dev_addr); hash_to_device[dev_hash] = dev; return dev; |