diff options
author | Josh Blum <josh@joshknows.com> | 2010-05-02 16:03:46 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-05-02 16:03:46 -0700 |
commit | fd0d9b7dcca13b4d8a4e1912682f58eb6b6ab634 (patch) | |
tree | ee9d35f8ba020c8abc629433fea412f282b0a719 /host/lib/usrp/dboard_base.cpp | |
parent | 4a19b43176fe3402d5aefd588d2bf6446877de18 (diff) | |
download | uhd-fd0d9b7dcca13b4d8a4e1912682f58eb6b6ab634.tar.gz uhd-fd0d9b7dcca13b4d8a4e1912682f58eb6b6ab634.tar.bz2 uhd-fd0d9b7dcca13b4d8a4e1912682f58eb6b6ab634.zip |
Replaced the dboard base constructor args with an opaque type.
Diffstat (limited to 'host/lib/usrp/dboard_base.cpp')
-rw-r--r-- | host/lib/usrp/dboard_base.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/host/lib/usrp/dboard_base.cpp b/host/lib/usrp/dboard_base.cpp index bc94ca9ac..523da696a 100644 --- a/host/lib/usrp/dboard_base.cpp +++ b/host/lib/usrp/dboard_base.cpp @@ -15,6 +15,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // +#include "dboard_ctor_args.hpp" #include <uhd/usrp/dboard_base.hpp> #include <boost/format.hpp> #include <stdexcept> @@ -25,14 +26,12 @@ using namespace uhd::usrp; * dboard_base dboard dboard_base class **********************************************************************/ struct dboard_base::dboard_base_impl{ - std::string sd_name; - dboard_iface::sptr db_iface; - dboard_id_t rx_id, tx_id; + ctor_args_impl args; + dboard_base_impl(ctor_args_t args) : args(*args){} }; -dboard_base::dboard_base(ctor_args_t const& args){ - _impl = new dboard_base_impl; - boost::tie(_impl->sd_name, _impl->db_iface, _impl->rx_id, _impl->tx_id) = args; +dboard_base::dboard_base(ctor_args_t args){ + _impl = new dboard_base_impl(args); } dboard_base::~dboard_base(void){ @@ -40,25 +39,25 @@ dboard_base::~dboard_base(void){ } std::string dboard_base::get_subdev_name(void){ - return _impl->sd_name; + return _impl->args.sd_name; } dboard_iface::sptr dboard_base::get_iface(void){ - return _impl->db_iface; + return _impl->args.db_iface; } dboard_id_t dboard_base::get_rx_id(void){ - return _impl->rx_id; + return _impl->args.rx_id; } dboard_id_t dboard_base::get_tx_id(void){ - return _impl->tx_id; + return _impl->args.tx_id; } /*********************************************************************** * xcvr dboard dboard_base class **********************************************************************/ -xcvr_dboard_base::xcvr_dboard_base(ctor_args_t const& args) : dboard_base(args){ +xcvr_dboard_base::xcvr_dboard_base(ctor_args_t args) : dboard_base(args){ if (get_rx_id() == dboard_id::NONE){ throw std::runtime_error(str(boost::format( "cannot create xcvr board when the rx id is \"%s\"" @@ -78,7 +77,7 @@ xcvr_dboard_base::~xcvr_dboard_base(void){ /*********************************************************************** * rx dboard dboard_base class **********************************************************************/ -rx_dboard_base::rx_dboard_base(ctor_args_t const& args) : dboard_base(args){ +rx_dboard_base::rx_dboard_base(ctor_args_t args) : dboard_base(args){ if (get_tx_id() != dboard_id::NONE){ throw std::runtime_error(str(boost::format( "cannot create rx board when the tx id is \"%s\"" @@ -102,7 +101,7 @@ void rx_dboard_base::tx_set(const wax::obj &, const wax::obj &){ /*********************************************************************** * tx dboard dboard_base class **********************************************************************/ -tx_dboard_base::tx_dboard_base(ctor_args_t const& args) : dboard_base(args){ +tx_dboard_base::tx_dboard_base(ctor_args_t args) : dboard_base(args){ if (get_rx_id() != dboard_id::NONE){ throw std::runtime_error(str(boost::format( "cannot create tx board when the rx id is \"%s\"" |