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_SIMPLE_FLOWGRAPH_H
24 #define INCLUDED_GR_SIMPLE_FLOWGRAPH_H
27 #include <boost/shared_ptr.hpp>
30 gr_simple_flowgraph_sptr gr_make_simple_flowgraph();
32 class gr_simple_flowgraph_detail;
37 friend class gr_hier_block2_detail;
38 gr_basic_block_sptr d_block;
42 gr_endpoint() : d_block(), d_port(0) { } // Internal use only
43 gr_endpoint(gr_basic_block_sptr block, int port) { d_block = block; d_port = port; }
44 gr_basic_block_sptr block() const { return d_block; }
45 int port() const { return d_port; }
48 typedef std::vector<gr_endpoint> gr_endpoint_vector_t;
51 *\brief Class representing a low-level, "flattened" flow graph
53 * This class holds the results of the call to gr.hier_block2.flatten(),
54 * which is a graph that has only the connected blocks and edges of
55 * the original hier_block2, with all the hierarchy removed.
57 * While this class is exported to Python via SWIG for ease of QA
58 * testing, it is not used by application developers, and there is
59 * no way to feed this to a gr.runtime() instance.
61 class gr_simple_flowgraph
64 friend class gr_runtime_impl;
65 friend class gr_simple_flowgraph_detail;
66 friend class gr_hier_block2_detail;
67 friend gr_simple_flowgraph_sptr gr_make_simple_flowgraph();
68 gr_simple_flowgraph();
70 gr_simple_flowgraph_detail *d_detail;
73 ~gr_simple_flowgraph();
75 void connect(gr_basic_block_sptr src_block, int src_port,
76 gr_basic_block_sptr dst_block, int dst_port);
77 void connect(const gr_endpoint &src, const gr_endpoint &dst);
78 void disconnect(gr_basic_block_sptr src_block, int src_port,
79 gr_basic_block_sptr dst_block, int dst_port);
83 #endif /* INCLUDED_GR_SIMPLE_FLOWGRAPH_H */