2 * Copyright 2006,2007 Free Software Foundation, Inc.
4 * This file is part of GNU Radio
6 * GNU Radio is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3, or (at your option)
11 * GNU Radio is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GNU Radio; see the file COPYING. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street,
19 * Boston, MA 02110-1301, USA.
21 #ifndef INCLUDED_GR_HIER_BLOCK2_DETAIL_H
22 #define INCLUDED_GR_HIER_BLOCK2_DETAIL_H
24 #include <gr_hier_block2.h>
25 #include <gr_flat_flowgraph.h>
26 #include <boost/utility.hpp>
28 class gr_hier_block2_detail : boost::noncopyable
31 gr_hier_block2_detail(gr_hier_block2 *owner);
32 ~gr_hier_block2_detail();
34 void connect(gr_basic_block_sptr block);
35 void connect(gr_basic_block_sptr src, int src_port,
36 gr_basic_block_sptr dst, int dst_port);
37 void disconnect(gr_basic_block_sptr block);
38 void disconnect(gr_basic_block_sptr, int src_port,
39 gr_basic_block_sptr, int dst_port);
40 void disconnect_all();
43 void flatten_aux(gr_flat_flowgraph_sptr sfg) const;
47 // Private implementation data
48 gr_hier_block2 *d_owner;
49 gr_hier_block2_detail *d_parent_detail;
50 gr_flowgraph_sptr d_fg;
51 gr_endpoint_vector_t d_inputs;
52 gr_endpoint_vector_t d_outputs;
53 gr_basic_block_vector_t d_blocks;
55 void connect_input(int my_port, int port, gr_basic_block_sptr block);
56 void connect_output(int my_port, int port, gr_basic_block_sptr block);
57 void disconnect_input(int my_port, int port, gr_basic_block_sptr block);
58 void disconnect_output(int my_port, int port, gr_basic_block_sptr block);
59 gr_endpoint resolve_port(int port, bool is_input);
60 gr_endpoint resolve_endpoint(const gr_endpoint &endp, bool is_input) const;
63 #endif /* INCLUDED_GR_HIER_BLOCK2_DETAIL_H */