GNU Radio's TEST Package

Public Member Functions | List of all members
osmosdr::device_t Class Reference

`#include <device.h>`

Inheritance diagram for osmosdr::device_t:

## Public Member Functions
| device_t (const std::string &args="")
std::string | to_pp_string (void) const
std::string | to_string (void) const
template<typename T >
T | cast (const std::string &key, const T &def) const

## Detailed Description

Mapping of key/value pairs for locating devices on the system. When left empty, the device discovery routines will search all available transports on the system (ethernet, usb...).

The logical device can also be used to pass arguments into the transport layer control to set (for example) buffer sizes.

An arguments string, is a way to represent a device address using a single string with delimiter characters.

## Constructor & Destructor Documentation

## ◆ device_t()

osmosdr::device_t::device_t | ( | const std::string & | args = `""` | ) |

Create a logical device from an args string.

Parameters

  args | the arguments string

## Member Function Documentation

## ◆ cast()

template<typename T >

T osmosdr::device_t::cast | ( | const std::string & | key,
|  | const T & | def
| ) |  | const
| inline

Lexically cast a parameter to the specified type, or use the default value if the key is not found.

Parameters

  key | the key as one of the parameters
  def | the value to use when key is not present

Returns
  the casted value as type T or the default

Exceptions

  error | when the parameter cannot be casted

## ◆ to_pp_string()

std::string osmosdr::device_t::to_pp_string | ( | void |  | ) | const

Convert a logical device into a pretty print string.

Returns
  a printable string representing the device

## ◆ to_string()

std::string osmosdr::device_t::to_string | ( | void |  | ) | const

Convert the logical device into an args string. The args string contains delimiter symbols.

Returns
  a string with delimiter markup

The documentation for this class was generated from the following file:

- device.h