diff options
author | jcorgan | 2009-03-03 02:10:36 +0000 |
---|---|---|
committer | jcorgan | 2009-03-03 02:10:36 +0000 |
commit | 4c400067338be2d8c2d76b0773dd4087d61b159b (patch) | |
tree | bc10354c799544b7e62a4bfca6690ac6d092d857 /gnuradio-core/src | |
parent | 771f4e5e434fdc1d0b1fdd4191b28e6843d87094 (diff) | |
download | gnuradio-4c400067338be2d8c2d76b0773dd4087d61b159b.tar.gz gnuradio-4c400067338be2d8c2d76b0773dd4087d61b159b.tar.bz2 gnuradio-4c400067338be2d8c2d76b0773dd4087d61b159b.zip |
Merged r10539:10546 from michaelld/two_mods into trunk. Trunk passes distcheck.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10551 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r-- | gnuradio-core/src/lib/gengen/Makefile.am | 3 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/Makefile.gen | 9 | ||||
-rwxr-xr-x | gnuradio-core/src/lib/gengen/generate_common.py | 3 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/gengen_generated.i | 6 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/gr_and_const_XX.cc.t | 72 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/gr_and_const_XX.h.t | 57 | ||||
-rw-r--r-- | gnuradio-core/src/lib/gengen/gr_and_const_XX.i.t | 37 |
7 files changed, 186 insertions, 1 deletions
diff --git a/gnuradio-core/src/lib/gengen/Makefile.am b/gnuradio-core/src/lib/gengen/Makefile.am index 85ab94f38..e969eb900 100644 --- a/gnuradio-core/src/lib/gengen/Makefile.am +++ b/gnuradio-core/src/lib/gengen/Makefile.am @@ -107,6 +107,9 @@ core_generator = \ gr_and_XX.cc.t \ gr_and_XX.h.t \ gr_and_XX.i.t \ + gr_and_const_XX.cc.t \ + gr_and_const_XX.h.t \ + gr_and_const_XX.i.t \ gr_or_XX.cc.t \ gr_or_XX.h.t \ gr_or_XX.i.t \ diff --git a/gnuradio-core/src/lib/gengen/Makefile.gen b/gnuradio-core/src/lib/gengen/Makefile.gen index 7ee92a25a..9ffb00ed2 100644 --- a/gnuradio-core/src/lib/gengen/Makefile.gen +++ b/gnuradio-core/src/lib/gengen/Makefile.gen @@ -20,6 +20,9 @@ GENERATED_H = \ gr_add_vii.h \ gr_add_vss.h \ gr_and_bb.h \ + gr_and_const_bb.h \ + gr_and_const_ii.h \ + gr_and_const_ss.h \ gr_and_ii.h \ gr_and_ss.h \ gr_argmax_fs.h \ @@ -130,6 +133,9 @@ GENERATED_I = \ gr_add_vii.i \ gr_add_vss.i \ gr_and_bb.i \ + gr_and_const_bb.i \ + gr_and_const_ii.i \ + gr_and_const_ss.i \ gr_and_ii.i \ gr_and_ss.i \ gr_argmax_fs.i \ @@ -240,6 +246,9 @@ GENERATED_CC = \ gr_add_vii.cc \ gr_add_vss.cc \ gr_and_bb.cc \ + gr_and_const_bb.cc \ + gr_and_const_ii.cc \ + gr_and_const_ss.cc \ gr_and_ii.cc \ gr_and_ss.cc \ gr_argmax_fs.cc \ diff --git a/gnuradio-core/src/lib/gengen/generate_common.py b/gnuradio-core/src/lib/gengen/generate_common.py index 182b74070..992e2c0da 100755 --- a/gnuradio-core/src/lib/gengen/generate_common.py +++ b/gnuradio-core/src/lib/gengen/generate_common.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2006,2007,2008 Free Software Foundation, Inc. +# Copyright 2004,2006,2007,2008,2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -62,6 +62,7 @@ others = ( ('gr_packed_to_unpacked_XX', ('bb','ss','ii')), ('gr_xor_XX', ('bb','ss','ii')), ('gr_and_XX', ('bb','ss','ii')), + ('gr_and_const_XX', ('bb','ss','ii')), ('gr_or_XX', ('bb','ss','ii')), ('gr_not_XX', ('bb','ss','ii')), ('gr_sample_and_hold_XX', ('bb','ss','ii','ff')), diff --git a/gnuradio-core/src/lib/gengen/gengen_generated.i b/gnuradio-core/src/lib/gengen/gengen_generated.i index f1be17f7a..d9471a041 100644 --- a/gnuradio-core/src/lib/gengen/gengen_generated.i +++ b/gnuradio-core/src/lib/gengen/gengen_generated.i @@ -20,6 +20,9 @@ #include <gr_add_vii.h> #include <gr_add_vss.h> #include <gr_and_bb.h> +#include <gr_and_const_bb.h> +#include <gr_and_const_ii.h> +#include <gr_and_const_ss.h> #include <gr_and_ii.h> #include <gr_and_ss.h> #include <gr_argmax_fs.h> @@ -130,6 +133,9 @@ %include <gr_add_vii.i> %include <gr_add_vss.i> %include <gr_and_bb.i> +%include <gr_and_const_bb.i> +%include <gr_and_const_ii.i> +%include <gr_and_const_ss.i> %include <gr_and_ii.i> %include <gr_and_ss.i> %include <gr_argmax_fs.i> diff --git a/gnuradio-core/src/lib/gengen/gr_and_const_XX.cc.t b/gnuradio-core/src/lib/gengen/gr_and_const_XX.cc.t new file mode 100644 index 000000000..ec725b23d --- /dev/null +++ b/gnuradio-core/src/lib/gengen/gr_and_const_XX.cc.t @@ -0,0 +1,72 @@ +/* -*- c++ -*- */ +/* + * Copyright 2009 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. + */ + +// @WARNING@ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <@NAME@.h> +#include <gr_io_signature.h> + +@SPTR_NAME@ +gr_make_@BASE_NAME@ (@I_TYPE@ k) +{ + return @SPTR_NAME@ (new @NAME@ (k)); +}; + +@NAME@::@NAME@ (@I_TYPE@ k) + : gr_sync_block ("@BASE_NAME@", + gr_make_io_signature (1, 1, sizeof (@I_TYPE@)), + gr_make_io_signature (1, 1, sizeof (@O_TYPE@))), + d_k (k) +{ +} + +int +@NAME@::work (int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) +{ + @I_TYPE@ *iptr = (@I_TYPE@ *) input_items[0]; + @O_TYPE@ *optr = (@O_TYPE@ *) output_items[0]; + + int size = noutput_items; + + while (size >= 8) { + *optr++ = *iptr++ & d_k; + *optr++ = *iptr++ & d_k; + *optr++ = *iptr++ & d_k; + *optr++ = *iptr++ & d_k; + *optr++ = *iptr++ & d_k; + *optr++ = *iptr++ & d_k; + *optr++ = *iptr++ & d_k; + *optr++ = *iptr++ & d_k; + size -= 8; + } + + while (size-- > 0) + *optr++ = *iptr++ & d_k; + + return (noutput_items); +} diff --git a/gnuradio-core/src/lib/gengen/gr_and_const_XX.h.t b/gnuradio-core/src/lib/gengen/gr_and_const_XX.h.t new file mode 100644 index 000000000..c979b131c --- /dev/null +++ b/gnuradio-core/src/lib/gengen/gr_and_const_XX.h.t @@ -0,0 +1,57 @@ +/* -*- c++ -*- */ +/* + * Copyright 2009 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. + */ + +// @WARNING@ + +#ifndef @GUARD_NAME@ +#define @GUARD_NAME@ + +#include <gr_sync_block.h> + +class @NAME@; +typedef boost::shared_ptr<@NAME@> @SPTR_NAME@; + +@SPTR_NAME@ gr_make_@BASE_NAME@ (@O_TYPE@ k); + +/*! + * \brief output_N = input_N & value + * \ingroup math + * + * bitwise boolean and of const to the data stream. + */ +class @NAME@ : public gr_sync_block +{ + friend @SPTR_NAME@ gr_make_@BASE_NAME@ (@O_TYPE@ k); + + @O_TYPE@ d_k; // the constant + @NAME@ (@O_TYPE@ k); + + public: + @O_TYPE@ k () const { return d_k; } + void set_k (@O_TYPE@ k) { d_k = k; } + + int work (int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); +}; + +#endif diff --git a/gnuradio-core/src/lib/gengen/gr_and_const_XX.i.t b/gnuradio-core/src/lib/gengen/gr_and_const_XX.i.t new file mode 100644 index 000000000..548431e66 --- /dev/null +++ b/gnuradio-core/src/lib/gengen/gr_and_const_XX.i.t @@ -0,0 +1,37 @@ +/* -*- c++ -*- */ +/* + * Copyright 2009 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. + */ + +// @WARNING@ + +GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@) + +@SPTR_NAME@ gr_make_@BASE_NAME@ (@O_TYPE@ k); + +class @NAME@ : public gr_sync_block +{ + private: + @NAME@ (@O_TYPE@ k); + + public: + @O_TYPE@ k () const { return d_k; } + void set_k (@O_TYPE@ k) { d_k = k; } +}; |