21 #ifndef INCLUDED_OSMOSDR_DEVICE_H
22 #define INCLUDED_OSMOSDR_DEVICE_H
26 #include <boost/noncopyable.hpp>
27 #include <boost/lexical_cast.hpp>
78 template <
typename T> T
cast(
const std::string &key,
const T &def)
const
80 if (!this->count(key))
return def;
81 try {
return boost::lexical_cast<T>(this->at(key)); }
82 catch(
const boost::bad_lexical_cast &) {
83 throw std::runtime_error(
"cannot cast " + key +
" = " + this->at(key));
#define OSMOSDR_API
Definition: api.h:30
device_t(const std::string &args="")
std::string to_pp_string(void) const
T cast(const std::string &key, const T &def) const
Definition: device.h:78
std::string to_string(void) const
static devices_t find(const device_t &hint=osmosdr::device_t())
Find logical radio devices attached to the host.
std::map< std::string, std::string > string_string_dict_t
Definition: device.h:33
std::vector< device_t > devices_t
A typedef for a vector of logical devices.
Definition: device.h:89