Updated license from GPL version 2 or later to GPL version 3 or later.
[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 3, 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_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;
44
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; }
58     void lock();
59     void unlock();
60
61 public:
62     ~gr_hier_block2_detail();
63 };
64
65 #endif /* INCLUDED_GR_HIER_BLOCK2_DETAIL_H */