From b26ea69676c09f5366a9e2f33b11ae5a7521ffe5 Mon Sep 17 00:00:00 2001
From: jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>
Date: Sat, 28 Apr 2007 02:20:28 +0000
Subject: Merged -r 5137:5174 from developer branch jcorgan/hb.  Trunk passes
 distcheck. Converts gr.hier_block2 API to not use 'define_component'
 methodology anymore.

git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5177 221aa14e-8319-0410-a670-987f0aec2ac5
---
 gnuradio-core/src/lib/runtime/gr_runtime.h | 54 +++++++++++++++++++++++++-----
 1 file changed, 45 insertions(+), 9 deletions(-)

(limited to 'gnuradio-core/src/lib/runtime/gr_runtime.h')

diff --git a/gnuradio-core/src/lib/runtime/gr_runtime.h b/gnuradio-core/src/lib/runtime/gr_runtime.h
index fc58da456b..5aec6dcf06 100644
--- a/gnuradio-core/src/lib/runtime/gr_runtime.h
+++ b/gnuradio-core/src/lib/runtime/gr_runtime.h
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2007 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -29,21 +29,57 @@ class gr_runtime_impl;
 
 gr_runtime_sptr gr_make_runtime(gr_hier_block2_sptr top_block);
 
+/*!
+ *\brief Runtime object that controls simple flow graph operation
+ *
+ * This class is instantiated with a top-level gr_hier_block2. The
+ * runtime then flattens the hierarchical block into a gr_simple_flowgraph,
+ * and allows control through start(), stop(), wait(), and run().
+ * 
+ */
 class gr_runtime
 {
 private:
-    gr_runtime(gr_hier_block2_sptr top_block);
-    friend gr_runtime_sptr gr_make_runtime(gr_hier_block2_sptr top_block);
+  gr_runtime(gr_hier_block2_sptr top_block);
+  friend gr_runtime_sptr gr_make_runtime(gr_hier_block2_sptr top_block);
 
-    gr_runtime_impl *d_impl;
+  gr_runtime_impl *d_impl;
     
 public:
-    ~gr_runtime();
+  ~gr_runtime();
+
+  /*!
+   * Start the flow graph.  Creates an undetached scheduler thread for
+   * each flow graph partition. Returns to caller once created.
+   */
+  void start();
+  
+  /*!
+   * Stop a running flow graph.  Tells each created scheduler thread
+   * to exit, then returns to caller.
+   */
+  void stop();
+
+  /*!
+   * Wait for a stopped flow graph to complete.  Joins each completed
+   * thread.
+   */
+  void wait();
+
+  /*!
+   * Calls start(), then wait().  Used to run a flow graph that will stop
+   * on its own, or to run a flow graph indefinitely until SIGTERM is
+   * received().
+   */
+  void run();
 
-    void start();
-    void stop();
-    void wait();
-    void run();
+  /*!
+   * Restart a running flow graph, after topology changes have
+   * been made to its top_block (or children). Causes each created 
+   * scheduler thread to end, recalculates the flow graph, and 
+   * recreates new threads (possibly a different number from before.)
+   */
+  void restart();
 };
 
 #endif /* INCLUDED_GR_RUNTIME_H */
-- 
cgit v1.2.3