21 #ifndef INCLUDED_OSMOSDR_DEVICE_H 22 #define INCLUDED_OSMOSDR_DEVICE_H 26 #include <boost/noncopyable.hpp> 27 #include <boost/lexical_cast.hpp> 55 device_t(
const std::string &args =
"");
61 std::string to_pp_string(
void)
const;
68 std::string to_string(
void)
const;
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));
T cast(const std::string &key, const T &def) const
Definition: device.h:78
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
#define OSMOSDR_API
Definition: api.h:30