Imported Upstream version 3.0
[debian/gnuradio] / gnuradio-core / src / lib / general / gr_test.i
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2006 Free Software Foundation, Inc.
4  * 
5  * This file is part of GNU Radio
6  * 
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)
10  * any later version.
11  * 
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.
16  * 
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.
21  */
22
23 GR_SWIG_BLOCK_MAGIC(gr,test);
24
25
26 class gr_test;
27 typedef boost::shared_ptr<gr_test> gr_test_sptr;
28
29
30 // public constructor
31 gr_test_sptr gr_make_test (const std::string &name=std::string("gr_test"),
32         int min_inputs=1, int max_inputs=1, unsigned int sizeof_input_item=1,
33         int min_outputs=1, int max_outputs=1, unsigned int sizeof_output_item=1,
34         unsigned int history=1,unsigned int output_multiple=1,double relative_rate=1.0,
35         bool fixed_rate=true,gr_consume_type_t cons_type=CONSUME_NOUTPUT_ITEMS, gr_produce_type_t prod_type=PRODUCE_NOUTPUT_ITEMS);
36
37
38 class gr_test : public gr_block {
39
40  public:
41   
42   ~gr_test ();
43   void forecast (int noutput_items,
44                          gr_vector_int &ninput_items_required);
45   void set_check_topology (bool check_topology);
46   bool check_topology (int ninputs, int noutputs);
47   int fixed_rate_ninput_to_noutput(int ninput);
48   int fixed_rate_noutput_to_ninput(int noutput);
49   void set_fixed_rate_public(bool fixed_rate);
50   void set_consume_type (gr_consume_type_t cons_type);
51   void set_consume_limit (unsigned int limit);
52   void set_produce_type (gr_produce_type_t prod_type);
53   void set_produce_limit (unsigned int limit);
54
55  protected:
56   gr_test (const std::string &name,int min_inputs, int max_inputs, unsigned int sizeof_input_item,
57                                    int min_outputs, int max_outputs, unsigned int sizeof_output_item,
58                                    unsigned int history,unsigned int output_multiple,double relative_rate,
59                                    bool fixed_rate,gr_consume_type_t cons_type, gr_produce_type_t prod_type);
60
61 };
62
63
64