15c8548c67494df4eecbc2b52acc12e4d00990c8
[debian/gnuradio] / gnuradio-core / src / lib / runtime / gr_hier_block2_detail.h
1 /*
2  * Copyright 2006,2007 Free Software Foundation, Inc.
3  * 
4  * This file is part of GNU Radio
5  * 
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 2, or (at your option)
9  * any later version.
10  * 
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.
15  * 
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.
20  */
21 #ifndef INCLUDED_GR_HIER_BLOCK2_DETAIL_H
22 #define INCLUDED_GR_HIER_BLOCK2_DETAIL_H
23
24 #include <gr_hier_block2.h>
25 #include <gr_simple_flowgraph_detail.h>
26 #include <boost/utility.hpp>
27
28 class gr_hier_block2_detail : boost::noncopyable
29 {
30 private:
31     friend class gr_hier_block2;
32     friend class gr_runtime_impl;
33     
34     // Constructor--it's private, only friends can instantiate
35     gr_hier_block2_detail(gr_hier_block2 *owner);
36
37     // Private implementation data
38     gr_hier_block2 *d_owner;
39     gr_simple_flowgraph_sptr d_fg;
40     gr_endpoint_vector_t d_inputs;
41     gr_endpoint_vector_t d_outputs;
42         
43     // Private implementation methods
44     void connect(gr_basic_block_sptr src, int src_port, 
45                  gr_basic_block_sptr dst, int dst_port);
46     void disconnect(gr_basic_block_sptr, int src_port, 
47                     gr_basic_block_sptr, int dst_port);
48     void connect_input(int my_port, int port, gr_basic_block_sptr block);
49     void connect_output(int my_port, int port, gr_basic_block_sptr block);
50     void disconnect_input(int my_port, int port, gr_basic_block_sptr block);
51     void disconnect_output(int my_port, int port, gr_basic_block_sptr block);
52     void flatten(gr_simple_flowgraph_sptr sfg);
53     gr_endpoint resolve_port(int port, bool is_input);
54     gr_endpoint resolve_endpoint(const gr_endpoint &endp, bool is_input);
55
56 public:
57     ~gr_hier_block2_detail();
58 };
59
60 #endif /* INCLUDED_GR_HIER_BLOCK2_DETAIL_H */