diff options
author | Johannes Demel <demel@ant.uni-bremen.de> | 2020-05-09 14:25:32 +0200 |
---|---|---|
committer | Josh Morman <mormjb@gmail.com> | 2020-06-04 10:05:48 -0400 |
commit | d584e7e9be13b500a8bc9a85f37d1cd51b0e0be5 (patch) | |
tree | 9e30cecfdeed04cb32263f7b9509291e0d6fbf40 /gr-blocks/lib/message_debug_impl.cc | |
parent | a6a1954f83478aff0c4fc53d0e8f51b49d51cc1e (diff) |
msg_handler: Use lambdas to set msg handlers
With this commit, all calls to `set_msg_handler` in `gr-blocks` use
lambdas. This helps to use `std::function` instead of `boost::function`.
Diffstat (limited to 'gr-blocks/lib/message_debug_impl.cc')
-rw-r--r-- | gr-blocks/lib/message_debug_impl.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gr-blocks/lib/message_debug_impl.cc b/gr-blocks/lib/message_debug_impl.cc index 55352f6e62..eb47fee299 100644 --- a/gr-blocks/lib/message_debug_impl.cc +++ b/gr-blocks/lib/message_debug_impl.cc @@ -78,17 +78,14 @@ message_debug_impl::message_debug_impl() : block("message_debug", io_signature::make(0, 0, 0), io_signature::make(0, 0, 0)) { message_port_register_in(pmt::mp("print")); - set_msg_handler(pmt::mp("print"), - std::bind(&message_debug_impl::print, this, std::placeholders::_1)); + set_msg_handler(pmt::mp("print"), [this](pmt::pmt_t msg) { this->print(msg); }); message_port_register_in(pmt::mp("store")); - set_msg_handler(pmt::mp("store"), - std::bind(&message_debug_impl::store, this, std::placeholders::_1)); + set_msg_handler(pmt::mp("store"), [this](pmt::pmt_t msg) { this->store(msg); }); message_port_register_in(pmt::mp("print_pdu")); - set_msg_handler( - pmt::mp("print_pdu"), - std::bind(&message_debug_impl::print_pdu, this, std::placeholders::_1)); + set_msg_handler(pmt::mp("print_pdu"), + [this](pmt::pmt_t msg) { this->print_pdu(msg); }); } message_debug_impl::~message_debug_impl() {} |