UHD  003.004.002-0-unknown
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions
uhd::device_addr_t Class Reference

#include <device_addr.hpp>

Inheritance diagram for uhd::device_addr_t:
uhd::dict< std::string, std::string >

List of all members.

Public Member Functions

 device_addr_t (const std::string &args="")
std::string to_pp_string (void) const
std::string to_string (void) const
template<typename T >
cast (const std::string &key, const T &def) const
- Public Member Functions inherited from uhd::dict< std::string, std::string >
 dict (void)
 dict (InputIterator first, InputIterator last)
std::size_t size (void) const
std::vector< std::string > keys (void) const
std::vector< std::string > vals (void) const
bool has_key (const std::string &key) const
const std::string & get (const std::string &key, const std::string &other) const
const std::string & get (const std::string &key) const
void set (const std::string &key, const std::string &val)
const std::string & operator[] (const std::string &key) const
std::string & operator[] (const std::string &key)
std::string pop (const std::string &key)

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...).

To narrow down the discovery process to a particular device, specify a transport key/value pair specific to your device.

The device address 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

uhd::device_addr_t::device_addr_t ( const std::string &  args = "")

Create a device address from an args string.

Parameters:
argsthe arguments string

Member Function Documentation

template<typename T >
T uhd::device_addr_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:
keythe key as one of the address parameters
defthe value to use when key is not present
Returns:
the casted value as type T or the default
Exceptions:
errorwhen the parameter cannot be casted
std::string uhd::device_addr_t::to_pp_string ( void  ) const

Convert a device address into a pretty print string.

Returns:
a printable string representing the device address
std::string uhd::device_addr_t::to_string ( void  ) const

Convert the device address 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: