diff options
author | Johannes Demel <demel@ant.uni-bremen.de> | 2020-05-02 15:36:51 +0200 |
---|---|---|
committer | Josh Morman <mormjb@gmail.com> | 2020-06-04 10:05:48 -0400 |
commit | a6a1954f83478aff0c4fc53d0e8f51b49d51cc1e (patch) | |
tree | 933ed1043c7c379e7d3f220aae96fdccd052c1fe /gnuradio-runtime | |
parent | 3165f73d7c6224523957fa69beade6069efea6ef (diff) |
msg_handler: Switch from boost::function to std::function
This commit is a first stab at moving from `boost::function` to `std::function`.
For now, it does only update gr-blocks. Also, this requires more testing.
If others can confirm that this change works, I'll continue to update all modules.
Diffstat (limited to 'gnuradio-runtime')
-rw-r--r-- | gnuradio-runtime/include/gnuradio/basic_block.h | 4 | ||||
-rw-r--r-- | gnuradio-runtime/lib/block.cc | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/gnuradio-runtime/include/gnuradio/basic_block.h b/gnuradio-runtime/include/gnuradio/basic_block.h index 651fda2136..47d939a5bc 100644 --- a/gnuradio-runtime/include/gnuradio/basic_block.h +++ b/gnuradio-runtime/include/gnuradio/basic_block.h @@ -18,9 +18,9 @@ #include <gnuradio/runtime_types.h> #include <gnuradio/sptr_magic.h> #include <gnuradio/thread/thread.h> -#include <boost/function.hpp> #include <boost/thread/condition_variable.hpp> #include <deque> +#include <functional> #include <map> #include <string> @@ -42,7 +42,7 @@ namespace gr { class GR_RUNTIME_API basic_block : public msg_accepter, public std::enable_shared_from_this<basic_block> { - typedef boost::function<void(pmt::pmt_t)> msg_handler_t; + typedef std::function<void(pmt::pmt_t)> msg_handler_t; private: typedef std::map<pmt::pmt_t, msg_handler_t, pmt::comparator> d_msg_handlers_t; diff --git a/gnuradio-runtime/lib/block.cc b/gnuradio-runtime/lib/block.cc index ebfeba23ba..b10ae97072 100644 --- a/gnuradio-runtime/lib/block.cc +++ b/gnuradio-runtime/lib/block.cc @@ -49,7 +49,8 @@ block::block(const std::string& name, { global_block_registry.register_primitive(alias(), this); message_port_register_in(d_system_port); - set_msg_handler(d_system_port, boost::bind(&block::system_handler, this, _1)); + set_msg_handler(d_system_port, + std::bind(&block::system_handler, this, std::placeholders::_1)); } block::~block() { global_block_registry.unregister_primitive(symbol_name()); } |