Imported Upstream version 3.2.2
[debian/gnuradio] / gnuradio-core / src / lib / swig / gnuradio.i
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2003,2004,2009 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 3, 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 ////////////////////////////////////////////////////////////////////////
24 // gnuradio.i
25 // SWIG interface definition
26 ////////////////////////////////////////////////////////////////////////
27
28 ////////////////////////////////////////////////////////////////////////
29 // Headers
30
31 %{
32 #include "gnuradio_swig_bug_workaround.h"       // mandatory bug fix
33 #include <gr_types.h>
34 #include <stddef.h>             // size_t
35 %}
36
37 %feature("autodoc","1");
38
39 // local file
40 %include <gr_shared_ptr.i>
41
42 // non-local SWIG files
43 %include <stl.i>
44 %include <std_complex.i>
45 %include <std_except.i>
46
47 typedef std::complex<float>             gr_complex;
48 typedef std::complex<double>            gr_complexd;
49
50
51 // instantiate the required template specializations
52
53 namespace std {
54   %template()     vector<unsigned char>;
55   %template()     vector<char>;
56   %template()     vector<short>;
57   %template()     vector<int>;
58   %template()     vector<float>;
59   %template()     vector<double>;
60
61   %template()     vector< std::complex<float> >;
62   %template()     vector< std::vector< unsigned char > >;
63   %template()     vector< std::vector< char > >;
64   %template()     vector< std::vector< short > >;
65   %template()     vector< std::vector< int > >;
66   %template()     vector< std::vector< float > >;
67   %template()     vector< std::vector< double > >;
68   %template()     vector< std::vector< std::complex<float> > >;
69 };
70
71 ////////////////////////////////////////////////////////////////////////
72
73 %constant int sizeof_char       = sizeof(char);
74 %constant int sizeof_short      = sizeof(short);
75 %constant int sizeof_int        = sizeof(int);
76 %constant int sizeof_float      = sizeof(float);
77 %constant int sizeof_double     = sizeof(double);
78 %constant int sizeof_gr_complex = sizeof(gr_complex);
79
80 ////////////////////////////////////////////////////////////////////////
81
82 #ifndef SW_RUNTIME
83 // import runtime.i for all but sw_runtime, since it needs to %include
84 %import <runtime.i>
85 #endif
86
87 ////////////////////////////////////////////////////////////////////////