3 * Copyright 2006,2007,2009 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.
22 #ifndef INCLUDED_GR_HIER_BLOCK2_DETAIL_H
23 #define INCLUDED_GR_HIER_BLOCK2_DETAIL_H
25 #include <gr_hier_block2.h>
26 #include <gr_flat_flowgraph.h>
27 #include <boost/utility.hpp>
32 class gr_hier_block2_detail : boost::noncopyable
35 gr_hier_block2_detail(gr_hier_block2 *owner);
36 ~gr_hier_block2_detail();
38 void connect(gr_basic_block_sptr block);
39 void connect(gr_basic_block_sptr src, int src_port,
40 gr_basic_block_sptr dst, int dst_port);
41 void disconnect(gr_basic_block_sptr block);
42 void disconnect(gr_basic_block_sptr, int src_port,
43 gr_basic_block_sptr, int dst_port);
44 void disconnect_all();
47 void flatten_aux(gr_flat_flowgraph_sptr sfg) const;
51 // Private implementation data
52 gr_hier_block2 *d_owner;
53 gr_hier_block2_detail *d_parent_detail;
54 gr_flowgraph_sptr d_fg;
55 std::vector<gr_endpoint_vector_t> d_inputs; // Multiple internal endpoints per external input
56 gr_endpoint_vector_t d_outputs; // Single internal endpoint per external output
57 gr_basic_block_vector_t d_blocks;
59 void connect_input(int my_port, int port, gr_basic_block_sptr block);
60 void connect_output(int my_port, int port, gr_basic_block_sptr block);
61 void disconnect_input(int my_port, int port, gr_basic_block_sptr block);
62 void disconnect_output(int my_port, int port, gr_basic_block_sptr block);
64 gr_endpoint_vector_t resolve_port(int port, bool is_input);
65 gr_endpoint_vector_t resolve_endpoint(const gr_endpoint &endp, bool is_input) const;
68 #endif /* INCLUDED_GR_HIER_BLOCK2_DETAIL_H */