From fd0d9b7dcca13b4d8a4e1912682f58eb6b6ab634 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 2 May 2010 16:03:46 -0700 Subject: Replaced the dboard base constructor args with an opaque type. --- host/lib/usrp/dboard_base.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'host/lib/usrp/dboard_base.cpp') 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 . // +#include "dboard_ctor_args.hpp" #include #include #include @@ -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\"" -- cgit v1.2.3