3 * Copyright 2006,2007 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
23 #ifndef INCLUDED_GR_RUNTIME_H
24 #define INCLUDED_GR_RUNTIME_H
26 #include <gr_runtime_types.h>
28 class gr_runtime_impl;
30 gr_runtime_sptr gr_make_runtime(gr_hier_block2_sptr top_block);
33 *\brief Runtime object that controls simple flow graph operation
35 * This class is instantiated with a top-level gr_hier_block2. The
36 * runtime then flattens the hierarchical block into a gr_simple_flowgraph,
37 * and allows control through start(), stop(), wait(), and run().
43 gr_runtime(gr_hier_block2_sptr top_block);
44 friend gr_runtime_sptr gr_make_runtime(gr_hier_block2_sptr top_block);
46 gr_runtime_impl *d_impl;
52 * Start the flow graph. Creates an undetached scheduler thread for
53 * each flow graph partition. Returns to caller once created.
58 * Stop a running flow graph. Tells each created scheduler thread
59 * to exit, then returns to caller.
64 * Wait for a stopped flow graph to complete. Joins each completed
70 * Calls start(), then wait(). Used to run a flow graph that will stop
71 * on its own, or to run a flow graph indefinitely until SIGTERM is
77 * Restart a running flow graph, after topology changes have
78 * been made to its top_block (or children). Causes each created
79 * scheduler thread to end, recalculates the flow graph, and
80 * recreates new threads (possibly a different number from before.)
85 * Lock a flow graph in preparation for reconfiguration. When an equal
86 * number of calls to lock() and unlock() have occurred, the flow graph
87 * will be restarted automatically.
89 * N.B. lock() and unlock() cannot be called from a flow graph thread or
90 * deadlock will occur when reconfiguration happens.
95 * Lock a flow graph in preparation for reconfiguration. When an equal
96 * number of calls to lock() and unlock() have occurred, the flow graph
97 * will be restarted automatically.
99 * N.B. lock() and unlock() cannot be called from a flow graph thread or
100 * deadlock will occur when reconfiguration happens.
105 #endif /* INCLUDED_GR_RUNTIME_H */