diff options
author | Josh Blum <josh@joshknows.com> | 2010-01-26 11:29:14 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-01-26 11:29:14 -0800 |
commit | a98e387578a3aceb15e2bcce4a9cc54d78c30dda (patch) | |
tree | b5e34c422c36a16a3f2379698e81af4c00a66ee3 /include/usrp_uhd/usrp | |
parent | 998aebf83c2796fdfabc2efd804ca14103adcaaf (diff) | |
download | uhd-a98e387578a3aceb15e2bcce4a9cc54d78c30dda.tar.gz uhd-a98e387578a3aceb15e2bcce4a9cc54d78c30dda.tar.bz2 uhd-a98e387578a3aceb15e2bcce4a9cc54d78c30dda.zip |
Switched from indexed properties to named properties.
Added some new properties for getting a list of antenna names,
pps sources, ref sources...
Diffstat (limited to 'include/usrp_uhd/usrp')
-rw-r--r-- | include/usrp_uhd/usrp/dboard/base.hpp | 8 | ||||
-rw-r--r-- | include/usrp_uhd/usrp/dboard/manager.hpp | 19 | ||||
-rw-r--r-- | include/usrp_uhd/usrp/mboard/test.hpp | 4 | ||||
-rw-r--r-- | include/usrp_uhd/usrp/usrp.hpp | 4 |
4 files changed, 18 insertions, 17 deletions
diff --git a/include/usrp_uhd/usrp/dboard/base.hpp b/include/usrp_uhd/usrp/dboard/base.hpp index 0c207f564..2b839a6fc 100644 --- a/include/usrp_uhd/usrp/dboard/base.hpp +++ b/include/usrp_uhd/usrp/dboard/base.hpp @@ -20,10 +20,10 @@ namespace usrp_uhd{ namespace usrp{ namespace dboard{ class base : boost::noncopyable{ public: typedef boost::shared_ptr<base> sptr; - //the constructor args consist of a subdev index and an interface + //the constructor args consist of a subdev name and an interface //derived classes should pass the args into the base class ctor //but should not have to deal with the internals of the args - typedef boost::tuple<size_t, interface::sptr> ctor_args_t; + typedef boost::tuple<std::string, interface::sptr> ctor_args_t; //structors base(ctor_args_t const&); @@ -36,11 +36,11 @@ public: virtual void tx_set(const wax::type &key, const wax::type &val) = 0; protected: - size_t get_subdev_index(void); + std::string get_subdev_name(void); interface::sptr get_interface(void); private: - size_t _subdev_index; + std::string _subdev_name; interface::sptr _dboard_interface; }; diff --git a/include/usrp_uhd/usrp/dboard/manager.hpp b/include/usrp_uhd/usrp/dboard/manager.hpp index d977fa527..4eaa9f889 100644 --- a/include/usrp_uhd/usrp/dboard/manager.hpp +++ b/include/usrp_uhd/usrp/dboard/manager.hpp @@ -5,8 +5,9 @@ #ifndef INCLUDED_USRP_UHD_USRP_DBOARD_MANAGER_HPP #define INCLUDED_USRP_UHD_USRP_DBOARD_MANAGER_HPP -#include <vector> +#include <map> #include <usrp_uhd/wax.hpp> +#include <usrp_uhd/props.hpp> #include <boost/utility.hpp> #include <boost/shared_ptr.hpp> #include <usrp_uhd/usrp/dboard/base.hpp> @@ -32,12 +33,12 @@ public: * * \param dboard_id the dboard id (rx or tx) * \param dboard_ctor the dboard constructor function pointer - * \param num_subdevs the number of subdevs in this dboard + * \param subdev_names the names of the subdevs on this dboard */ static void register_subdevs( dboard_id_t dboard_id, dboard_ctor_t dboard_ctor, - size_t num_subdevs + const prop_names_t &subdev_names ); public: @@ -51,16 +52,16 @@ public: ~manager(void); //interface - size_t get_num_rx_subdevs(void); - size_t get_num_tx_subdevs(void); - wax::obj::sptr get_rx_subdev(size_t subdev_index); - wax::obj::sptr get_tx_subdev(size_t subdev_index); + prop_names_t get_rx_subdev_names(void); + prop_names_t get_tx_subdev_names(void); + wax::obj::sptr get_rx_subdev(const std::string &subdev_name); + wax::obj::sptr get_tx_subdev(const std::string &subdev_name); private: //list of rx and tx dboards in this manager //each dboard here is actually a subdevice - std::vector<base::sptr> _rx_dboards; - std::vector<base::sptr> _tx_dboards; + std::map<std::string, base::sptr> _rx_dboards; + std::map<std::string, base::sptr> _tx_dboards; }; }}} //namespace diff --git a/include/usrp_uhd/usrp/mboard/test.hpp b/include/usrp_uhd/usrp/mboard/test.hpp index 10b46c7fc..4b28bba29 100644 --- a/include/usrp_uhd/usrp/mboard/test.hpp +++ b/include/usrp_uhd/usrp/mboard/test.hpp @@ -8,7 +8,7 @@ #include <usrp_uhd/usrp/mboard/base.hpp> #include <usrp_uhd/device_addr.hpp> #include <usrp_uhd/usrp/dboard/manager.hpp> -#include <vector> +#include <map> namespace usrp_uhd{ namespace usrp{ namespace mboard{ @@ -25,7 +25,7 @@ private: void get(const wax::type &, wax::type &); void set(const wax::type &, const wax::type &); - std::vector<dboard::manager::sptr> _dboard_managers; + std::map<std::string, dboard::manager::sptr> _dboard_managers; }; }}} //namespace diff --git a/include/usrp_uhd/usrp/usrp.hpp b/include/usrp_uhd/usrp/usrp.hpp index 7506f798f..239f8b494 100644 --- a/include/usrp_uhd/usrp/usrp.hpp +++ b/include/usrp_uhd/usrp/usrp.hpp @@ -4,7 +4,7 @@ #include <usrp_uhd/device.hpp> #include <usrp_uhd/usrp/mboard/base.hpp> -#include <vector> +#include <map> #ifndef INCLUDED_USRP_UHD_USRP_USRP_HPP #define INCLUDED_USRP_UHD_USRP_USRP_HPP @@ -29,7 +29,7 @@ private: void get(const wax::type &, wax::type &); void set(const wax::type &, const wax::type &); - std::vector<mboard::base::sptr> _mboards; + std::map<std::string, mboard::base::sptr> _mboards; boost::function<void(const device::send_args_t &)> _send_raw_cb; boost::function<void(const device::recv_args_t &)> _recv_raw_cb; }; |