summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib/flat_flowgraph.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-runtime/lib/flat_flowgraph.cc')
-rw-r--r--gnuradio-runtime/lib/flat_flowgraph.cc27
1 files changed, 23 insertions, 4 deletions
diff --git a/gnuradio-runtime/lib/flat_flowgraph.cc b/gnuradio-runtime/lib/flat_flowgraph.cc
index 56123fcc88..479943353b 100644
--- a/gnuradio-runtime/lib/flat_flowgraph.cc
+++ b/gnuradio-runtime/lib/flat_flowgraph.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2007,2013 Free Software Foundation, Inc.
+ * Copyright 2015 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -94,7 +94,9 @@ namespace gr {
block_sptr grblock = cast_to_block_sptr(block);
if(!grblock)
- throw std::runtime_error("allocate_block_detail found non-gr::block");
+ throw std::runtime_error(
+ (boost::format("allocate_block_detail found non-gr::block (%s)")%
+ block->alias()).str());
if(FLAT_FLOWGRAPH_DEBUG)
std::cout << "Creating block detail for " << block << std::endl;
@@ -415,6 +417,23 @@ namespace gr {
}
void
+ flat_flowgraph::clear_hier()
+ {
+ if(FLAT_FLOWGRAPH_DEBUG)
+ std::cout << "Clear_hier()" << std::endl;
+ for(size_t i=0; i<d_msg_edges.size(); i++) {
+ if(FLAT_FLOWGRAPH_DEBUG)
+ std::cout << "edge: " << d_msg_edges[i].src() << "-->" << d_msg_edges[i].dst() << std::endl;
+ if(d_msg_edges[i].src().is_hier() || d_msg_edges[i].dst().is_hier()){
+ if(FLAT_FLOWGRAPH_DEBUG)
+ std::cout << "is hier" << std::endl;
+ d_msg_edges.erase(d_msg_edges.begin() + i);
+ i--;
+ }
+ }
+ }
+
+ void
flat_flowgraph::replace_endpoint(const msg_endpoint &e, const msg_endpoint &r, bool is_src)
{
size_t n_replr(0);
@@ -425,7 +444,7 @@ namespace gr {
if(d_msg_edges[i].src() == e) {
if(FLAT_FLOWGRAPH_DEBUG)
std::cout << boost::format("flat_flowgraph::replace_endpoint() flattening to ( %s, %s )\n") \
- % r.block()% d_msg_edges[i].dst().block();
+ % r% d_msg_edges[i].dst();
d_msg_edges.push_back( msg_edge(r, d_msg_edges[i].dst() ) );
n_replr++;
}
@@ -434,7 +453,7 @@ namespace gr {
if(d_msg_edges[i].dst() == e) {
if(FLAT_FLOWGRAPH_DEBUG)
std::cout << boost::format("flat_flowgraph::replace_endpoint() flattening to ( %s, %s )\n") \
- % r.block()% d_msg_edges[i].dst().block();
+ % r% d_msg_edges[i].src();
d_msg_edges.push_back( msg_edge(d_msg_edges[i].src(), r ) );
n_replr++;
}