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_simple_flowgraph_detail.h>
26 #include <boost/utility.hpp>
28 class gr_hier_block2_detail : boost::noncopyable
31 friend class gr_hier_block2;
32 friend class gr_runtime_impl;
34 // Constructor--it's private, only friends can instantiate
35 gr_hier_block2_detail(gr_hier_block2 *owner);
37 // Private implementation data
38 gr_hier_block2 *d_owner;
39 gr_hier_block2_detail *d_parent_detail;
40 gr_simple_flowgraph_sptr d_fg;
41 gr_endpoint_vector_t d_inputs;
42 gr_endpoint_vector_t d_outputs;
43 gr_runtime *d_runtime;
45 // Private implementation methods
46 void connect(gr_basic_block_sptr src, int src_port,
47 gr_basic_block_sptr dst, int dst_port);
48 void disconnect(gr_basic_block_sptr, int src_port,
49 gr_basic_block_sptr, int dst_port);
50 void connect_input(int my_port, int port, gr_basic_block_sptr block);
51 void connect_output(int my_port, int port, gr_basic_block_sptr block);
52 void disconnect_input(int my_port, int port, gr_basic_block_sptr block);
53 void disconnect_output(int my_port, int port, gr_basic_block_sptr block);
54 void flatten(gr_simple_flowgraph_sptr sfg);
55 gr_endpoint resolve_port(int port, bool is_input);
56 gr_endpoint resolve_endpoint(const gr_endpoint &endp, bool is_input);
57 void set_runtime(gr_runtime *runtime) { d_runtime = runtime; }
62 ~gr_hier_block2_detail();
65 #endif /* INCLUDED_GR_HIER_BLOCK2_DETAIL_H */