diff options
author | Balint Seeber <balint@ettus.com> | 2014-05-25 20:32:16 -0400 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2014-06-13 14:47:43 -0700 |
commit | 229fd982c66df1755f439ae7835ad56a8cccd346 (patch) | |
tree | cb4f604abbc6053e5bcc5131686d3c410eeb19c8 | |
parent | f5aafacd7416822cd0ec7017dd9604cfdb1533dc (diff) |
runtime: accessor for message port map & printing more informative error when a msg port is not found
-rw-r--r-- | gnuradio-runtime/include/gnuradio/basic_block.h | 4 | ||||
-rw-r--r-- | gnuradio-runtime/lib/flowgraph.cc | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gnuradio-runtime/include/gnuradio/basic_block.h b/gnuradio-runtime/include/gnuradio/basic_block.h index 28552a483d..b413274ded 100644 --- a/gnuradio-runtime/include/gnuradio/basic_block.h +++ b/gnuradio-runtime/include/gnuradio/basic_block.h @@ -275,6 +275,10 @@ namespace gr { } return false; } + + const msg_queue_map_t& get_msg_map(void) const { + return msg_queue; + } #ifdef GR_CTRLPORT /*! diff --git a/gnuradio-runtime/lib/flowgraph.cc b/gnuradio-runtime/lib/flowgraph.cc index 3d8dfea65a..abe51f741d 100644 --- a/gnuradio-runtime/lib/flowgraph.cc +++ b/gnuradio-runtime/lib/flowgraph.cc @@ -155,8 +155,14 @@ namespace gr { if(FLOWGRAPH_DEBUG) std::cout << "check_valid_port( " << e.block() << ", " << e.port() << ")\n"; - if(!e.block()->has_msg_port(e.port())) + if(!e.block()->has_msg_port(e.port())) { + const gr::basic_block::msg_queue_map_t& msg_map = e.block()->get_msg_map(); + std::cout << "Could not find port: " << e.port() << " in:" << std::endl; + for (gr::basic_block::msg_queue_map_t::const_iterator it = msg_map.begin(); it != msg_map.end(); ++it) + std::cout << it->first << std::endl; + std::cout << std::endl; throw std::invalid_argument("invalid msg port in connect() or disconnect()"); + } } void |