From c14944c357c2d548632472d06e101ca95a7a12b6 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 9 Aug 2018 16:54:12 -0500 Subject: b200: Remove superfluous fake lambda No functional changes. Cleanup only. A little less Boost. --- host/lib/usrp/b200/b200_impl.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 239bd97b1..a173c68f8 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -795,15 +795,6 @@ b200_impl::~b200_impl(void) /*********************************************************************** * setup radio control objects **********************************************************************/ - -void lambda_set_bool_prop(boost::weak_ptr tree_wptr, fs_path path, bool value, double) -{ - property_tree::sptr tree = tree_wptr.lock(); - if (tree) { - tree->access(path).set(value); - } -} - void b200_impl::setup_radio(const size_t dspno) { radio_perifs_t &perif = _radio_perifs[dspno]; @@ -862,7 +853,11 @@ void b200_impl::setup_radio(const size_t dspno) _tree->create(rx_dsp_path / "rate" / "set").set(false); _tree->access(rx_dsp_path / "rate" / "value") .set_coercer(boost::bind(&b200_impl::coerce_rx_samp_rate, this, perif.ddc, dspno, _1)) - .add_coerced_subscriber(boost::bind(&lambda_set_bool_prop, boost::weak_ptr(_tree), rx_dsp_path / "rate" / "set", true, _1)) + .add_coerced_subscriber([this](const double){ + if (this->_tree) { + _tree->access(rx_dsp_path / "rate" / "set").set(true); + } + }) .add_coerced_subscriber(boost::bind(&b200_impl::update_rx_samp_rate, this, dspno, _1)) ; _tree->create(rx_dsp_path / "stream_cmd") @@ -880,7 +875,11 @@ void b200_impl::setup_radio(const size_t dspno) _tree->create(tx_dsp_path / "rate" / "set").set(false); _tree->access(tx_dsp_path / "rate" / "value") .set_coercer(boost::bind(&b200_impl::coerce_tx_samp_rate, this, perif.duc, dspno, _1)) - .add_coerced_subscriber(boost::bind(&lambda_set_bool_prop, boost::weak_ptr(_tree), tx_dsp_path / "rate" / "set", true, _1)) + .add_coerced_subscriber([this](const double){ + if (this->_tree) { + tree->access(tx_dsp_path / "rate" / "set").set(true); + } + }) .add_coerced_subscriber(boost::bind(&b200_impl::update_tx_samp_rate, this, dspno, _1)) ; _tree->access(mb_path / "tick_rate") -- cgit v1.2.3