commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 07/11: runtime: accessor for message port m


From: git
Subject: [Commit-gnuradio] [gnuradio] 07/11: runtime: accessor for message port map & printing more informative error when a msg port is not found
Date: Fri, 13 Jun 2014 22:44:33 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 229fd982c66df1755f439ae7835ad56a8cccd346
Author: Balint Seeber <address@hidden>
Date:   Sun May 25 20:32:16 2014 -0400

    runtime: accessor for message port map & printing more informative error 
when a msg port is not found
---
 gnuradio-runtime/include/gnuradio/basic_block.h | 4 ++++
 gnuradio-runtime/lib/flowgraph.cc               | 8 +++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnuradio-runtime/include/gnuradio/basic_block.h 
b/gnuradio-runtime/include/gnuradio/basic_block.h
index 28552a4..b413274 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 3d8dfea..abe51f7 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]