UHD 003.002.003

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/property_tree.hpp>
00023 #include <uhd/utils/props.hpp>
00024 #include <uhd/usrp/dboard_base.hpp>
00025 #include <uhd/usrp/dboard_id.hpp>
00026 #include <boost/utility.hpp>
00027 #include <boost/shared_ptr.hpp>
00028 
00029 namespace uhd{ namespace usrp{
00030 
00036 class UHD_API dboard_manager : boost::noncopyable{
00037 public:
00038     typedef boost::shared_ptr<dboard_manager> sptr;
00039 
00041     static void populate_prop_tree_from_subdev(
00042         property_tree::sptr subtree, wax::obj subdev
00043     );
00044 
00045     //dboard constructor (each dboard should have a ::make with this signature)
00046     typedef dboard_base::sptr(*dboard_ctor_t)(dboard_base::ctor_args_t);
00047 
00056     static void register_dboard(
00057         const dboard_id_t &dboard_id,
00058         dboard_ctor_t dboard_ctor,
00059         const std::string &name,
00060         const prop_names_t &subdev_names = prop_names_t(1, "0")
00061     );
00062 
00072     static void register_dboard(
00073         const dboard_id_t &rx_dboard_id,
00074         const dboard_id_t &tx_dboard_id,
00075         dboard_ctor_t dboard_ctor,
00076         const std::string &name,
00077         const prop_names_t &subdev_names = prop_names_t(1, "0")
00078     );
00079 
00087     static sptr make(
00088         dboard_id_t rx_dboard_id,
00089         dboard_id_t tx_dboard_id,
00090         dboard_iface::sptr iface
00091     );
00092 
00093     //dboard manager interface
00094     virtual prop_names_t get_rx_subdev_names(void) = 0;
00095     virtual prop_names_t get_tx_subdev_names(void) = 0;
00096     virtual wax::obj get_rx_subdev(const std::string &subdev_name) = 0;
00097     virtual wax::obj get_tx_subdev(const std::string &subdev_name) = 0;
00098 };
00099 
00100 }} //namespace
00101 
00102 #endif /* INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines