diff options
author | Josh Blum <josh@joshknows.com> | 2010-08-05 16:41:51 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-08-06 12:15:05 -0700 |
commit | 5ec42578fa9f69e92ae935c16717957a6ea66324 (patch) | |
tree | db54b506b9dccb857723b7b07ce236986e070e8b /host/include | |
parent | a333a01ac0d1d0cb011d52f04bed2534a708f944 (diff) | |
download | uhd-5ec42578fa9f69e92ae935c16717957a6ea66324.tar.gz uhd-5ec42578fa9f69e92ae935c16717957a6ea66324.tar.bz2 uhd-5ec42578fa9f69e92ae935c16717957a6ea66324.zip |
uhd: created subdevice pair struct for subdev spec (easier than first/second)
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/usrp/subdev_spec.hpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/host/include/uhd/usrp/subdev_spec.hpp b/host/include/uhd/usrp/subdev_spec.hpp index d874a9bd9..4d8f03b77 100644 --- a/host/include/uhd/usrp/subdev_spec.hpp +++ b/host/include/uhd/usrp/subdev_spec.hpp @@ -19,13 +19,32 @@ #define INCLUDED_UHD_USRP_SUBDEV_SPEC_HPP #include <uhd/config.hpp> -#include <utility> //std::pair #include <vector> #include <string> namespace uhd{ namespace usrp{ /*! + * A subdevice specification (daughterboard, subdevice) name pairing. + */ + struct UHD_API subdev_spec_pair_t{ + //! The daughterboard name + std::string db_name; + + //! The subdevice name + std::string sd_name; + + /*! + * Create a new subdevice specification pair from dboard and subdev names. + * \param db_name the name of a daughterboard slot + * \param sd_name the name of a subdevice on that daughterboard + */ + subdev_spec_pair_t( + const std::string &db_name, const std::string &sd_name + ); + }; + + /*! * A list of (daughterboard name, subdevice name) pairs: * * A subdevice specification represents a list of subdevices on a motherboard. @@ -48,9 +67,8 @@ namespace uhd{ namespace usrp{ * An empty subdevice specification can be used to automatically * select the first subdevice on the first present daughterboard. */ - class UHD_API subdev_spec_t : public std::vector<std::pair<std::string, std::string> >{ + class UHD_API subdev_spec_t : public std::vector<subdev_spec_pair_t>{ public: - typedef std::pair<std::string, std::string> pair_t; /*! * Create a subdev specification from a markup string. |