diff options
author | Johannes Demel <demel@ant.uni-bremen.de> | 2020-05-09 15:28:58 +0200 |
---|---|---|
committer | Josh Morman <mormjb@gmail.com> | 2020-06-04 10:05:48 -0400 |
commit | 6f037812eda09459fbc0a2d9c9eaada16dc475b7 (patch) | |
tree | c657779e3f85756189d19440f71a74b0fb583324 | |
parent | 320aa710c42c884ec7395b5c8332f601ee1895fc (diff) |
msg_handler: Use lambdas in gr-qtgui
gr-qtgui uses lambdas instead of `boost::bind` to register message
handlers now. This component makes quite heavy use of message handlers.
-rw-r--r-- | gr-qtgui/lib/const_sink_c_impl.cc | 3 | ||||
-rw-r--r-- | gr-qtgui/lib/edit_box_msg_impl.cc | 2 | ||||
-rw-r--r-- | gr-qtgui/lib/freq_sink_c_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/freq_sink_f_impl.cc | 6 | ||||
-rw-r--r-- | gr-qtgui/lib/histogram_sink_f_impl.cc | 3 | ||||
-rw-r--r-- | gr-qtgui/lib/sink_c_impl.cc | 2 | ||||
-rw-r--r-- | gr-qtgui/lib/sink_f_impl.cc | 2 | ||||
-rw-r--r-- | gr-qtgui/lib/time_raster_sink_b_impl.cc | 3 | ||||
-rw-r--r-- | gr-qtgui/lib/time_raster_sink_f_impl.cc | 3 | ||||
-rw-r--r-- | gr-qtgui/lib/time_sink_c_impl.cc | 2 | ||||
-rw-r--r-- | gr-qtgui/lib/time_sink_f_impl.cc | 2 | ||||
-rw-r--r-- | gr-qtgui/lib/waterfall_sink_c_impl.cc | 9 | ||||
-rw-r--r-- | gr-qtgui/lib/waterfall_sink_f_impl.cc | 9 |
13 files changed, 21 insertions, 31 deletions
diff --git a/gr-qtgui/lib/const_sink_c_impl.cc b/gr-qtgui/lib/const_sink_c_impl.cc index 96d6e36d9c..a9dfe70d17 100644 --- a/gr-qtgui/lib/const_sink_c_impl.cc +++ b/gr-qtgui/lib/const_sink_c_impl.cc @@ -57,8 +57,7 @@ const_sink_c_impl::const_sink_c_impl(int size, // setup PDU handling input port message_port_register_in(pmt::mp("in")); - set_msg_handler(pmt::mp("in"), - boost::bind(&const_sink_c_impl::handle_pdus, this, _1)); + set_msg_handler(pmt::mp("in"), [this](pmt::pmt_t msg) { this->handle_pdus(msg); }); for (int i = 0; i < d_nconnections; i++) { d_residbufs_real.push_back( diff --git a/gr-qtgui/lib/edit_box_msg_impl.cc b/gr-qtgui/lib/edit_box_msg_impl.cc index cfc19201be..8f33adb322 100644 --- a/gr-qtgui/lib/edit_box_msg_impl.cc +++ b/gr-qtgui/lib/edit_box_msg_impl.cc @@ -149,7 +149,7 @@ edit_box_msg_impl::edit_box_msg_impl(data_type_t type, message_port_register_out(d_port); message_port_register_in(pmt::mp("val")); - set_msg_handler(pmt::mp("val"), boost::bind(&edit_box_msg_impl::set_value, this, _1)); + set_msg_handler(pmt::mp("val"), [this](pmt::pmt_t msg) { this->set_value(msg); }); } edit_box_msg_impl::~edit_box_msg_impl() diff --git a/gr-qtgui/lib/freq_sink_c_impl.cc b/gr-qtgui/lib/freq_sink_c_impl.cc index 6b6e2bda0e..63490e72ac 100644 --- a/gr-qtgui/lib/freq_sink_c_impl.cc +++ b/gr-qtgui/lib/freq_sink_c_impl.cc @@ -70,17 +70,17 @@ freq_sink_c_impl::freq_sink_c_impl(int fftsize, // setup bw input port message_port_register_in(d_port_bw); - set_msg_handler(d_port_bw, boost::bind(&freq_sink_c_impl::handle_set_bw, this, _1)); + set_msg_handler(d_port_bw, [this](pmt::pmt_t msg) { this->handle_set_bw(msg); }); // setup output message port to post frequency when display is // double-clicked message_port_register_out(d_port); message_port_register_in(d_port); - set_msg_handler(d_port, boost::bind(&freq_sink_c_impl::handle_set_freq, this, _1)); + set_msg_handler(d_port, [this](pmt::pmt_t msg) { this->handle_set_freq(msg); }); // setup PDU handling input port message_port_register_in(pmt::mp("in")); - set_msg_handler(pmt::mp("in"), boost::bind(&freq_sink_c_impl::handle_pdus, this, _1)); + set_msg_handler(pmt::mp("in"), [this](pmt::pmt_t msg) { this->handle_pdus(msg); }); d_main_gui = NULL; diff --git a/gr-qtgui/lib/freq_sink_f_impl.cc b/gr-qtgui/lib/freq_sink_f_impl.cc index 72eae1c7d2..0622fa2577 100644 --- a/gr-qtgui/lib/freq_sink_f_impl.cc +++ b/gr-qtgui/lib/freq_sink_f_impl.cc @@ -70,17 +70,17 @@ freq_sink_f_impl::freq_sink_f_impl(int fftsize, // setup bw input port message_port_register_in(d_port_bw); - set_msg_handler(d_port_bw, boost::bind(&freq_sink_f_impl::handle_set_bw, this, _1)); + set_msg_handler(d_port_bw, [this](pmt::pmt_t msg) { this->handle_set_bw(msg); }); // setup output message port to post frequency when display is // double-clicked message_port_register_out(d_port); message_port_register_in(d_port); - set_msg_handler(d_port, boost::bind(&freq_sink_f_impl::handle_set_freq, this, _1)); + set_msg_handler(d_port, [this](pmt::pmt_t msg) { this->handle_set_freq(msg); }); // setup PDU handling input port message_port_register_in(pmt::mp("in")); - set_msg_handler(pmt::mp("in"), boost::bind(&freq_sink_f_impl::handle_pdus, this, _1)); + set_msg_handler(pmt::mp("in"), [this](pmt::pmt_t msg) { this->handle_pdus(msg); }); d_main_gui = NULL; diff --git a/gr-qtgui/lib/histogram_sink_f_impl.cc b/gr-qtgui/lib/histogram_sink_f_impl.cc index 0b34bb1b32..06280b8397 100644 --- a/gr-qtgui/lib/histogram_sink_f_impl.cc +++ b/gr-qtgui/lib/histogram_sink_f_impl.cc @@ -69,8 +69,7 @@ histogram_sink_f_impl::histogram_sink_f_impl(int size, // setup PDU handling input port message_port_register_in(pmt::mp("in")); - set_msg_handler(pmt::mp("in"), - boost::bind(&histogram_sink_f_impl::handle_pdus, this, _1)); + set_msg_handler(pmt::mp("in"), [this](pmt::pmt_t msg) { this->handle_pdus(msg); }); // +1 for the PDU buffer for (int i = 0; i < d_nconnections + 1; i++) { diff --git a/gr-qtgui/lib/sink_c_impl.cc b/gr-qtgui/lib/sink_c_impl.cc index 42128a7d60..567f369e7e 100644 --- a/gr-qtgui/lib/sink_c_impl.cc +++ b/gr-qtgui/lib/sink_c_impl.cc @@ -84,7 +84,7 @@ sink_c_impl::sink_c_impl(int fftsize, // double-clicked message_port_register_out(d_port); message_port_register_in(d_port); - set_msg_handler(d_port, boost::bind(&sink_c_impl::handle_set_freq, this, _1)); + set_msg_handler(d_port, [this](pmt::pmt_t msg) { this->handle_set_freq(msg); }); d_main_gui = NULL; diff --git a/gr-qtgui/lib/sink_f_impl.cc b/gr-qtgui/lib/sink_f_impl.cc index 8bb4184b47..c7fb5d39f2 100644 --- a/gr-qtgui/lib/sink_f_impl.cc +++ b/gr-qtgui/lib/sink_f_impl.cc @@ -83,7 +83,7 @@ sink_f_impl::sink_f_impl(int fftsize, // double-clicked message_port_register_out(d_port); message_port_register_in(d_port); - set_msg_handler(d_port, boost::bind(&sink_f_impl::handle_set_freq, this, _1)); + set_msg_handler(d_port, [this](pmt::pmt_t msg) { this->handle_set_freq(msg); }); d_main_gui = NULL; diff --git a/gr-qtgui/lib/time_raster_sink_b_impl.cc b/gr-qtgui/lib/time_raster_sink_b_impl.cc index 0d401d3f0d..ddc5809111 100644 --- a/gr-qtgui/lib/time_raster_sink_b_impl.cc +++ b/gr-qtgui/lib/time_raster_sink_b_impl.cc @@ -71,8 +71,7 @@ time_raster_sink_b_impl::time_raster_sink_b_impl(double samp_rate, // setup PDU handling input port message_port_register_in(pmt::mp("in")); - set_msg_handler(pmt::mp("in"), - boost::bind(&time_raster_sink_b_impl::handle_pdus, this, _1)); + set_msg_handler(pmt::mp("in"), [this](pmt::pmt_t msg) { this->handle_pdus(msg); }); d_scale = 1.0f; diff --git a/gr-qtgui/lib/time_raster_sink_f_impl.cc b/gr-qtgui/lib/time_raster_sink_f_impl.cc index 242dd9910d..494860e37c 100644 --- a/gr-qtgui/lib/time_raster_sink_f_impl.cc +++ b/gr-qtgui/lib/time_raster_sink_f_impl.cc @@ -71,8 +71,7 @@ time_raster_sink_f_impl::time_raster_sink_f_impl(double samp_rate, // setup PDU handling input port message_port_register_in(pmt::mp("in")); - set_msg_handler(pmt::mp("in"), - boost::bind(&time_raster_sink_f_impl::handle_pdus, this, _1)); + set_msg_handler(pmt::mp("in"), [this](pmt::pmt_t msg) { this->handle_pdus(msg); }); d_icols = static_cast<int>(ceil(d_cols)); d_tmpflt = (float*)volk_malloc(d_icols * sizeof(float), volk_get_alignment()); diff --git a/gr-qtgui/lib/time_sink_c_impl.cc b/gr-qtgui/lib/time_sink_c_impl.cc index d295741db7..31e583583c 100644 --- a/gr-qtgui/lib/time_sink_c_impl.cc +++ b/gr-qtgui/lib/time_sink_c_impl.cc @@ -68,7 +68,7 @@ time_sink_c_impl::time_sink_c_impl(int size, // setup PDU handling input port message_port_register_in(pmt::mp("in")); - set_msg_handler(pmt::mp("in"), boost::bind(&time_sink_c_impl::handle_pdus, this, _1)); + set_msg_handler(pmt::mp("in"), [this](pmt::pmt_t msg) { this->handle_pdus(msg); }); // +2 for the PDU message buffers for (unsigned int n = 0; n < d_nconnections + 2; n++) { diff --git a/gr-qtgui/lib/time_sink_f_impl.cc b/gr-qtgui/lib/time_sink_f_impl.cc index c5dffdd3e4..1caf82368a 100644 --- a/gr-qtgui/lib/time_sink_f_impl.cc +++ b/gr-qtgui/lib/time_sink_f_impl.cc @@ -68,7 +68,7 @@ time_sink_f_impl::time_sink_f_impl(int size, // setup PDU handling input port message_port_register_in(pmt::mp("in")); - set_msg_handler(pmt::mp("in"), boost::bind(&time_sink_f_impl::handle_pdus, this, _1)); + set_msg_handler(pmt::mp("in"), [this](pmt::pmt_t msg) { this->handle_pdus(msg); }); // +1 for the PDU buffer for (unsigned int n = 0; n < d_nconnections + 1; n++) { diff --git a/gr-qtgui/lib/waterfall_sink_c_impl.cc b/gr-qtgui/lib/waterfall_sink_c_impl.cc index a459ef76d4..7ca1e62137 100644 --- a/gr-qtgui/lib/waterfall_sink_c_impl.cc +++ b/gr-qtgui/lib/waterfall_sink_c_impl.cc @@ -105,20 +105,17 @@ waterfall_sink_c_impl::waterfall_sink_c_impl(int fftsize, // setup bw input port message_port_register_in(d_port_bw); - set_msg_handler(d_port_bw, - boost::bind(&waterfall_sink_c_impl::handle_set_bw, this, _1)); + set_msg_handler(d_port_bw, [this](pmt::pmt_t msg) { this->handle_set_bw(msg); }); // setup output message port to post frequency when display is // double-clicked message_port_register_out(d_port); message_port_register_in(d_port); - set_msg_handler(d_port, - boost::bind(&waterfall_sink_c_impl::handle_set_freq, this, _1)); + set_msg_handler(d_port, [this](pmt::pmt_t msg) { this->handle_set_freq(msg); }); // setup PDU handling input port message_port_register_in(pmt::mp("in")); - set_msg_handler(pmt::mp("in"), - boost::bind(&waterfall_sink_c_impl::handle_pdus, this, _1)); + set_msg_handler(pmt::mp("in"), [this](pmt::pmt_t msg) { this->handle_pdus(msg); }); } waterfall_sink_c_impl::~waterfall_sink_c_impl() diff --git a/gr-qtgui/lib/waterfall_sink_f_impl.cc b/gr-qtgui/lib/waterfall_sink_f_impl.cc index ad6c4fdb73..d101a97f57 100644 --- a/gr-qtgui/lib/waterfall_sink_f_impl.cc +++ b/gr-qtgui/lib/waterfall_sink_f_impl.cc @@ -103,20 +103,17 @@ waterfall_sink_f_impl::waterfall_sink_f_impl(int fftsize, // setup bw input port message_port_register_in(d_port_bw); - set_msg_handler(d_port_bw, - boost::bind(&waterfall_sink_f_impl::handle_set_bw, this, _1)); + set_msg_handler(d_port_bw, [this](pmt::pmt_t msg) { this->handle_set_bw(msg); }); // setup output message port to post frequency when display is // double-clicked message_port_register_out(d_port); message_port_register_in(d_port); - set_msg_handler(d_port, - boost::bind(&waterfall_sink_f_impl::handle_set_freq, this, _1)); + set_msg_handler(d_port, [this](pmt::pmt_t msg) { this->handle_set_freq(msg); }); // setup PDU handling input port message_port_register_in(pmt::mp("in")); - set_msg_handler(pmt::mp("in"), - boost::bind(&waterfall_sink_f_impl::handle_pdus, this, _1)); + set_msg_handler(pmt::mp("in"), [this](pmt::pmt_t msg) { this->handle_pdus(msg); }); } waterfall_sink_f_impl::~waterfall_sink_f_impl() |