4 # Copyright 2003 Free Software Foundation, Inc.
6 # This file is part of GNU Radio
8 # GNU Radio is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
13 # GNU Radio is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Radio; see the file COPYING. If not, write to
20 # the Free Software Foundation, Inc., 51 Franklin Street,
21 # Boston, MA 02110-1301, USA.
24 from generate_utils import *
27 # ----------------------------------------------------------------
29 def make_gr_fir_sysconfig_generic_h ():
30 out = open_and_log_name ('gr_fir_sysconfig_generic.h', 'w')
36 * WARNING: This file is automatically generated by
37 * generate_gr_fir_sysconfig_generic.py.
39 * Any changes made to this file will be overwritten.
42 #ifndef _GR_FIR_SYSCONFIG_GENERIC_H_
43 #define _GR_FIR_SYSCONFIG_GENERIC_H_
45 #include <gr_fir_sysconfig.h>
51 class gr_fir_sysconfig_generic : public gr_fir_sysconfig {
55 for sig in fir_signatures:
56 out.write ((' virtual gr_fir_%s *create_gr_fir_%s (const std::vector<%s> &taps);\n' %
57 (sig, sig, tap_type (sig))))
61 for sig in fir_signatures:
62 out.write ((' virtual void get_gr_fir_%s_info (std::vector<gr_fir_%s_info> *info);\n' %
70 #endif /* _GR_FIR_SYSCONFIG_GENERIC_H_ */
75 # ----------------------------------------------------------------
77 def make_constructor (sig, out):
80 make_gr_fir_%s (const std::vector<%s> &taps)
82 return new gr_fir_%s_generic (taps);
84 ''' % (sig, sig, tap_type (sig), sig))
87 def make_creator (sig, out):
90 gr_fir_sysconfig_generic::create_gr_fir_%s (const std::vector<%s> &taps)
92 return make_gr_fir_%s (taps);
94 ''' % (sig, sig, tap_type (sig), sig))
97 def make_info (sig, out):
100 gr_fir_sysconfig_generic::get_gr_fir_%s_info (std::vector<gr_fir_%s_info> *info)
103 (*info)[0].name = "generic";
104 (*info)[0].create = make_gr_fir_%s;
106 ''' % (sig, sig, sig))
109 # ----------------------------------------------------------------
111 def make_gr_fir_sysconfig_generic_cc ():
112 out = open_and_log_name ('gr_fir_sysconfig_generic.cc', 'w')
113 out.write (copyright)
118 * WARNING: This file is automatically generated by
119 * generate_gr_fir_sysconfig_generic.py.
121 * Any changes made to this file will be overwritten.
127 #include <gr_fir_sysconfig_generic.h>
131 for sig in fir_signatures:
132 out.write ('#include <gr_fir_%s_generic.h>\n' % (sig))
137 * ----------------------------------------------------------------
138 * static functions that serve as constructors returned by info
139 * ----------------------------------------------------------------
143 for sig in fir_signatures:
144 make_constructor (sig, out)
149 * ----------------------------------------------------------------
150 * return instances of the generic C++ versions of these classes.
151 * ----------------------------------------------------------------
155 for sig in fir_signatures:
156 make_creator (sig, out)
161 * Return info about available implementations.
163 * This is the bottom of the concrete hierarchy, so we set the
164 * size of the vector to 1, and install our info. Classes derived
165 * from us invoke us first, then append their own info.
169 for sig in fir_signatures:
175 # ----------------------------------------------------------------
178 make_gr_fir_sysconfig_generic_h ()
179 make_gr_fir_sysconfig_generic_cc ()
181 if __name__ == '__main__':