diff options
author | Tom Rondeau <trondeau@vt.edu> | 2013-04-17 13:43:52 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2013-04-29 14:52:56 -0400 |
commit | f3e2e07201c50033bf6c9d0c6a6f068557b4f17f (patch) | |
tree | 140b3c2d20a951ffd4abd564c3378ee2e2f9fc7c /gnuradio-runtime/lib/hier_block2_detail.h | |
parent | 35303ae975a5b1bdecc2492bc96e2b8e89b62a3d (diff) |
runtime: converting runtime core to gr namespace, gnuradio include dir.
Diffstat (limited to 'gnuradio-runtime/lib/hier_block2_detail.h')
-rw-r--r-- | gnuradio-runtime/lib/hier_block2_detail.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/gnuradio-runtime/lib/hier_block2_detail.h b/gnuradio-runtime/lib/hier_block2_detail.h new file mode 100644 index 0000000000..99bf6e8ef1 --- /dev/null +++ b/gnuradio-runtime/lib/hier_block2_detail.h @@ -0,0 +1,77 @@ +/* -*- c++ -*- */ +/* + * Copyright 2006,2007,2009,2013 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_GR_RUNTIME_HIER_BLOCK2_DETAIL_H +#define INCLUDED_GR_RUNTIME_HIER_BLOCK2_DETAIL_H + +#include <gnuradio/api.h> +#include <gnuradio/hier_block2.h> +#include <flat_flowgraph.h> +#include <boost/utility.hpp> + +namespace gr { + + /*! + * \ingroup internal + */ + class GR_RUNTIME_API hier_block2_detail : boost::noncopyable + { + public: + hier_block2_detail(hier_block2 *owner); + ~hier_block2_detail(); + + void connect(basic_block_sptr block); + void connect(basic_block_sptr src, int src_port, + basic_block_sptr dst, int dst_port); + void msg_connect(basic_block_sptr src, pmt::pmt_t srcport, + basic_block_sptr dst, pmt::pmt_t dstport); + void msg_disconnect(basic_block_sptr src, pmt::pmt_t srcport, + basic_block_sptr dst, pmt::pmt_t dstport); + void disconnect(basic_block_sptr block); + void disconnect(basic_block_sptr, int src_port, + basic_block_sptr, int dst_port); + void disconnect_all(); + void lock(); + void unlock(); + void flatten_aux(flat_flowgraph_sptr sfg) const; + + private: + // Private implementation data + hier_block2 *d_owner; + hier_block2_detail *d_parent_detail; + flowgraph_sptr d_fg; + std::vector<endpoint_vector_t> d_inputs; // Multiple internal endpoints per external input + endpoint_vector_t d_outputs; // Single internal endpoint per external output + basic_block_vector_t d_blocks; + + void connect_input(int my_port, int port, basic_block_sptr block); + void connect_output(int my_port, int port, basic_block_sptr block); + void disconnect_input(int my_port, int port, basic_block_sptr block); + void disconnect_output(int my_port, int port, basic_block_sptr block); + + endpoint_vector_t resolve_port(int port, bool is_input); + endpoint_vector_t resolve_endpoint(const endpoint &endp, bool is_input) const; + }; + +} /* namespace gr */ + +#endif /* INCLUDED_GR_RUNTIME_HIER_BLOCK2_DETAIL_H */ |