commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r4016 - gnuradio/branches/developers/jcorgan/hier/gnur


From: jcorgan
Subject: [Commit-gnuradio] r4016 - gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime
Date: Wed, 22 Nov 2006 11:20:33 -0700 (MST)

Author: jcorgan
Date: 2006-11-22 11:20:33 -0700 (Wed, 22 Nov 2006)
New Revision: 4016

Modified:
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.cc
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.h
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.h
   
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
Log:
Work in progress.

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.cc
   2006-11-22 17:43:26 UTC (rev 4015)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.cc
   2006-11-22 18:20:33 UTC (rev 4016)
@@ -65,7 +65,13 @@
 }
 
 void
-gr_hier_block2::flatten(gr_simple_flowgraph_sptr sfg, const std::string 
&prefix)
+gr_hier_block2::flatten_components(gr_simple_flowgraph_sptr sfg, const 
std::string &prefix)
 {
-    return d_detail->flatten(sfg, prefix);
+    d_detail->flatten_components(sfg, prefix);
 }
+
+void
+gr_hier_block2::flatten_edges(gr_simple_flowgraph_sptr sfg, const std::string 
&prefix)
+{
+    d_detail->flatten_edges(sfg, prefix);
+}

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.h
    2006-11-22 17:43:26 UTC (rev 4015)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2.h
    2006-11-22 18:20:33 UTC (rev 4016)
@@ -59,7 +59,8 @@
     void define_component(const std::string &name, gr_basic_block_sptr 
basic_block);
     void connect(const std::string &src_name, int src_port, 
                  const std::string &dst_name, int dst_port);
-    void flatten(gr_simple_flowgraph_sptr sfg, const std::string &prefix = "");
+    void flatten_components(gr_simple_flowgraph_sptr sfg, const std::string 
&prefix = "");
+    void flatten_edges(gr_simple_flowgraph_sptr sfg, const std::string &prefix 
= "");
 };
 
 #endif /* INCLUDED_GR_HIER_BLOCK2_H */

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc
    2006-11-22 17:43:26 UTC (rev 4015)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.cc
    2006-11-22 18:20:33 UTC (rev 4016)
@@ -149,13 +149,12 @@
 }
 
 void
-gr_hier_block2_detail::flatten(gr_simple_flowgraph_sptr sfg, const std::string 
&prefix)
+gr_hier_block2_detail::flatten_components(gr_simple_flowgraph_sptr sfg, const 
std::string &prefix)
 {
     if (GR_HIER_BLOCK2_DETAIL_DEBUG)
        std::cout << "Flattening hierarchy with prefix: " << prefix << 
std::endl;
 
-    // First, add my non-hierarchical components to the simple flowgraph, 
-    // appending the supplied prefix.
+    // Add my non-hierarchical components to the simple flowgraph, then recurse
     for (gr_hier_component_miter_t p = d_components.begin(); p != 
d_components.end(); p++) {
        std::string name(prefix + ((prefix == "") ? "":".") + p->first);
 
@@ -163,7 +162,14 @@
        gr_block_sptr block(boost::dynamic_pointer_cast<gr_block, 
gr_basic_block>(basic_block));
        if (block)      
            sfg->define_component(name, block);
+
+       gr_hier_block2_sptr 
hier_block2(boost::dynamic_pointer_cast<gr_hier_block2, 
gr_basic_block>(basic_block));
+       if (hier_block2)
+           hier_block2->flatten_components(sfg, name);
     }
+}
 
-    // More to follow...
+void
+gr_hier_block2_detail::flatten_edges(gr_simple_flowgraph_sptr sfg, const 
std::string &prefix)
+{
 }

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.h
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.h
     2006-11-22 17:43:26 UTC (rev 4015)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_hier_block2_detail.h
     2006-11-22 18:20:33 UTC (rev 4016)
@@ -53,7 +53,8 @@
     void check_type_match(gr_io_signature_sptr src_sig, int src_port,
                          gr_io_signature_sptr dst_sig, int dst_port);
 
-    void flatten(gr_simple_flowgraph_sptr sfg, const std::string &prefix = "");
+    void flatten_components(gr_simple_flowgraph_sptr sfg, const std::string 
&prefix = "");
+    void flatten_edges(gr_simple_flowgraph_sptr sfg, const std::string &prefix 
= "");
                                                     
 public:
     ~gr_hier_block2_detail();

Modified: 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
  2006-11-22 17:43:26 UTC (rev 4015)
+++ 
gnuradio/branches/developers/jcorgan/hier/gnuradio-core/src/lib/runtime/gr_runtime_impl.cc
  2006-11-22 18:20:33 UTC (rev 4016)
@@ -54,7 +54,8 @@
     else
        d_running = true;
 
-    d_top_block->flatten(d_sfg);
+    d_top_block->flatten_components(d_sfg);
+    d_top_block->flatten_edges(d_sfg);
 }
 
 void 





reply via email to

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