summaryrefslogtreecommitdiff
path: root/gr-blocks/lib
diff options
context:
space:
mode:
authorJohnathan Corgan2012-07-04 07:11:51 -0700
committerJohnathan Corgan2012-07-04 07:11:51 -0700
commit4c85f46aee089432b090b988dedbc42091084ba3 (patch)
tree77753a2ddc0384e1552a8ba74b2614c4fa2f5bd0 /gr-blocks/lib
parent312de88604d052142f91ae4eb292ccd25fac7963 (diff)
downloadgnuradio-4c85f46aee089432b090b988dedbc42091084ba3.tar.gz
gnuradio-4c85f46aee089432b090b988dedbc42091084ba3.tar.bz2
gnuradio-4c85f46aee089432b090b988dedbc42091084ba3.zip
blocks: added gr::blocks::or_XX (bb ss ii)
Diffstat (limited to 'gr-blocks/lib')
-rw-r--r--gr-blocks/lib/CMakeLists.txt1
-rw-r--r--gr-blocks/lib/or_XX_impl.cc.t69
-rw-r--r--gr-blocks/lib/or_XX_impl.h.t48
3 files changed, 118 insertions, 0 deletions
diff --git a/gr-blocks/lib/CMakeLists.txt b/gr-blocks/lib/CMakeLists.txt
index 3bf1db750..3e3650d67 100644
--- a/gr-blocks/lib/CMakeLists.txt
+++ b/gr-blocks/lib/CMakeLists.txt
@@ -96,6 +96,7 @@ expand_cc_h_impl(multiply_XX ss ii)
expand_cc_h_impl(multiply_const_XX ss ii)
expand_cc_h_impl(multiply_const_vXX ss ii ff cc)
expand_cc_h_impl(not_XX bb ss ii)
+expand_cc_h_impl(or_XX bb ss ii)
expand_cc_h_impl(sub_XX ss ii ff cc)
########################################################################
diff --git a/gr-blocks/lib/or_XX_impl.cc.t b/gr-blocks/lib/or_XX_impl.cc.t
new file mode 100644
index 000000000..15f6fa0b8
--- /dev/null
+++ b/gr-blocks/lib/or_XX_impl.cc.t
@@ -0,0 +1,69 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2012 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_IMPL@.h>
+#include <gr_io_signature.h>
+
+namespace gr {
+ namespace blocks {
+
+ @NAME@::sptr @NAME@::make(size_t vlen)
+ {
+ return gnuradio::get_initial_sptr(new @NAME_IMPL@(vlen));
+ }
+
+ @NAME_IMPL@::@NAME_IMPL@(size_t vlen)
+ : gr_sync_block ("@NAME@",
+ gr_make_io_signature (1, -1, sizeof (@I_TYPE@)*vlen),
+ gr_make_io_signature (1, 1, sizeof (@O_TYPE@)*vlen)),
+ d_vlen(vlen)
+ {
+ }
+
+ int
+ @NAME_IMPL@::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+ {
+ @O_TYPE@ *optr = (@O_TYPE@ *) output_items[0];
+
+ int ninputs = input_items.size ();
+
+ for (size_t i = 0; i < noutput_items*d_vlen; i++){
+ @I_TYPE@ acc = ((@I_TYPE@ *) input_items[0])[i];
+ for (int j = 1; j < ninputs; j++)
+ acc |= ((@I_TYPE@ *) input_items[j])[i];
+
+ *optr++ = (@O_TYPE@) acc;
+ }
+
+ return noutput_items;
+ }
+
+ } /* namespace blocks */
+} /* namespace gr */
diff --git a/gr-blocks/lib/or_XX_impl.h.t b/gr-blocks/lib/or_XX_impl.h.t
new file mode 100644
index 000000000..25f0da0c8
--- /dev/null
+++ b/gr-blocks/lib/or_XX_impl.h.t
@@ -0,0 +1,48 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2012 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_IMPL@
+#define @GUARD_NAME_IMPL@
+
+#include <blocks/@NAME@.h>
+
+namespace gr {
+ namespace blocks {
+
+ class BLOCKS_API @NAME_IMPL@ : public @NAME@
+ {
+ size_t d_vlen;
+
+ public:
+ @NAME_IMPL@(size_t vlen);
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+ };
+
+ } /* namespace blocks */
+} /* namespace gr */
+
+#endif /* @GUARD_NAME_IMPL@ */