UHD 003.000.001

include/uhd/usrp/dboard_manager.hpp

Go to the documentation of this file.
00001 //
00002 // Copyright 2010 Ettus Research LLC
00003 //
00004 // This program is free software: you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation, either version 3 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 //
00017 
00018 #ifndef INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP
00019 #define INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP
00020 
00021 #include <uhd/config.hpp>
00022 #include <uhd/utils/props.hpp>
00023 #include <uhd/usrp/dboard_base.hpp>
00024 #include <uhd/usrp/dboard_id.hpp>
00025 #include <boost/utility.hpp>
00026 #include <boost/shared_ptr.hpp>
00027 
00028 namespace uhd{ namespace usrp{
00029 
00035 class UHD_API dboard_manager : boost::noncopyable{
00036 public:
00037     typedef boost::shared_ptr<dboard_manager> sptr;
00038 
00039     //dboard constructor (each dboard should have a ::make with this signature)
00040     typedef dboard_base::sptr(*dboard_ctor_t)(dboard_base::ctor_args_t);
00041 
00050     static void register_dboard(
00051         const dboard_id_t &dboard_id,
00052         dboard_ctor_t dboard_ctor,
00053         const std::string &name,
00054         const prop_names_t &subdev_names = prop_names_t(1, "0")
00055     );
00056 
00066     static void register_dboard(
00067         const dboard_id_t &rx_dboard_id,
00068         const dboard_id_t &tx_dboard_id,
00069         dboard_ctor_t dboard_ctor,
00070         const std::string &name,
00071         const prop_names_t &subdev_names = prop_names_t(1, "0")
00072     );
00073 
00081     static sptr make(
00082         dboard_id_t rx_dboard_id,
00083         dboard_id_t tx_dboard_id,
00084         dboard_iface::sptr iface
00085     );
00086 
00087     //dboard manager interface
00088     virtual prop_names_t get_rx_subdev_names(void) = 0;
00089     virtual prop_names_t get_tx_subdev_names(void) = 0;
00090     virtual wax::obj get_rx_subdev(const std::string &subdev_name) = 0;
00091     virtual wax::obj get_tx_subdev(const std::string &subdev_name) = 0;
00092 };
00093 
00094 }} //namespace
00095 
00096 #endif /* INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines