3 * Copyright 2004 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
23 class gr_block_detail;
24 typedef boost::shared_ptr<gr_block_detail> gr_block_detail_sptr;
25 %template(gr_block_detail_sptr) boost::shared_ptr<gr_block_detail>;
26 %rename(block_detail) gr_make_block_detail;
27 %ignore gr_block_detail;
29 gr_block_detail_sptr gr_make_block_detail (unsigned int ninputs, unsigned int noutputs);
31 class gr_block_detail {
36 int ninputs () const { return d_ninputs; }
37 int noutputs () const { return d_noutputs; }
38 bool sink_p () const { return d_noutputs == 0; }
39 bool source_p () const { return d_ninputs == 0; }
41 void set_input (unsigned int which, gr_buffer_reader_sptr reader);
42 gr_buffer_reader_sptr input (unsigned int which)
44 if (which >= d_ninputs)
45 throw std::invalid_argument ("gr_block_detail::input");
46 return d_input[which];
49 void set_output (unsigned int which, gr_buffer_sptr buffer);
50 gr_buffer_sptr output (unsigned int which)
52 if (which >= d_noutputs)
53 throw std::invalid_argument ("gr_block_detail::output");
54 return d_output[which];
57 // ----------------------------------------------------------------------------
60 gr_block_detail (unsigned int ninputs, unsigned int noutputs);
65 %rename(block_detail_ncurrently_allocated) gr_block_detail_ncurrently_allocated;
66 long gr_block_detail_ncurrently_allocated ();