8 #ifndef INCLUDED_UHD_TYPES_DEVICE_ADDR_HPP 9 #define INCLUDED_UHD_TYPES_DEVICE_ADDR_HPP 13 #include <boost/lexical_cast.hpp> 56 std::string to_pp_string(
void)
const;
63 std::string to_string(
void)
const;
73 template <
typename T> T
cast(
const std::string &key,
const T &def)
const{
74 if (not this->has_key(key))
return def;
76 return boost::lexical_cast<T>((*this)[key]);
78 catch(
const boost::bad_lexical_cast &){
79 throw std::runtime_error(
"cannot cast " + key +
" = " + (*
this)[key]);
UHD_API device_addr_t combine_device_addrs(const device_addrs_t &dev_addrs)
Combine a vector of device addresses into an indexed device address.
Definition: build_info.hpp:14
UHD_API device_addrs_t separate_device_addr(const device_addr_t &dev_addr)
Separate an indexed device address into a vector of device addresses.
T cast(const std::string &key, const T &def) const
Definition: device_addr.hpp:73
std::vector< device_addr_t > device_addrs_t
A typedef for a vector of device addresses.
Definition: device_addr.hpp:85
#define UHD_API
Definition: config.h:63
Definition: device_addr.hpp:38