diff options
author | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2007-04-28 02:20:28 +0000 |
---|---|---|
committer | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2007-04-28 02:20:28 +0000 |
commit | b26ea69676c09f5366a9e2f33b11ae5a7521ffe5 (patch) | |
tree | 0641c1c25d6e827f70941e07f4611d0a2b6b83cd /gnuradio-core/src/lib/runtime/gr_runtime.h | |
parent | 00696b9f754338de9362932c1ecfb1e144a38786 (diff) |
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
Diffstat (limited to 'gnuradio-core/src/lib/runtime/gr_runtime.h')
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_runtime.h | 54 |
1 files changed, 45 insertions, 9 deletions
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 */ |