diff options
author | Roy Thompson | 2013-01-31 13:16:12 -0700 |
---|---|---|
committer | Ben Reynwar | 2013-01-31 13:16:12 -0700 |
commit | 5ab960295f00991fa9447819b3ff9eaf8d88d28e (patch) | |
tree | 2d55ed9476e2c3efcc055a22ab7e3c4d17d56e31 /gnuradio-core/src/lib/runtime | |
parent | 4435082f6167f0b5b519deaa1609572d596757dc (diff) | |
download | gnuradio-5ab960295f00991fa9447819b3ff9eaf8d88d28e.tar.gz gnuradio-5ab960295f00991fa9447819b3ff9eaf8d88d28e.tar.bz2 gnuradio-5ab960295f00991fa9447819b3ff9eaf8d88d28e.zip |
core: Enabling msg_connect within python blocks.
Diffstat (limited to 'gnuradio-core/src/lib/runtime')
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_basic_block.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_basic_block.h b/gnuradio-core/src/lib/runtime/gr_basic_block.h index 9cc2ad775..b4935d8ac 100644 --- a/gnuradio-core/src/lib/runtime/gr_basic_block.h +++ b/gnuradio-core/src/lib/runtime/gr_basic_block.h @@ -54,18 +54,6 @@ class GR_CORE_API gr_basic_block : public gr_msg_accepter, public boost::enable_ typedef boost::function<void(pmt::pmt_t)> msg_handler_t; private: - /* - * This function is called by the runtime system to dispatch messages. - * - * The thread-safety guarantees mentioned in set_msg_handler are implemented - * by the callers of this method. - */ - void dispatch_msg(pmt::pmt_t which_port, pmt::pmt_t msg) - { - // AA Update this - if (d_msg_handlers.find(which_port) != d_msg_handlers.end()) // Is there a handler? - d_msg_handlers[which_port](msg); // Yes, invoke it. - }; //msg_handler_t d_msg_handler; typedef std::map<pmt::pmt_t , msg_handler_t, pmt::pmt_comperator> d_msg_handlers_t; @@ -117,6 +105,19 @@ class GR_CORE_API gr_basic_block : public gr_msg_accepter, public boost::enable_ */ void set_color(vcolor color) { d_color = color; } vcolor color() const { return d_color; } + + /* + * This function is called by the runtime system to dispatch messages. + * + * The thread-safety guarantees mentioned in set_msg_handler are implemented + * by the callers of this method. + */ + virtual void dispatch_msg(pmt::pmt_t which_port, pmt::pmt_t msg) + { + // AA Update this + if (d_msg_handlers.find(which_port) != d_msg_handlers.end()) // Is there a handler? + d_msg_handlers[which_port](msg); // Yes, invoke it. + }; // Message passing interface pmt::pmt_t message_subscribers; |