diff options
author | Tom Rondeau | 2010-11-04 12:38:52 -0400 |
---|---|---|
committer | Tom Rondeau | 2010-11-04 12:38:52 -0400 |
commit | 54803ebc0450e9ee46e66b15d3b29249e44c55ed (patch) | |
tree | fb3f1866dd96d692f6cba23aee7fbb630c291390 /gnuradio-core | |
parent | 309b05cbb38125a910b6199f7adc4ff93bc98064 (diff) | |
download | gnuradio-54803ebc0450e9ee46e66b15d3b29249e44c55ed.tar.gz gnuradio-54803ebc0450e9ee46e66b15d3b29249e44c55ed.tar.bz2 gnuradio-54803ebc0450e9ee46e66b15d3b29249e44c55ed.zip |
Adding shell block for a random annotator. This will be used only for testing the stream tags, which is why its sitting in runtime.
Diffstat (limited to 'gnuradio-core')
-rw-r--r-- | gnuradio-core/src/lib/runtime/Makefile.am | 3 | ||||
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_random_annotator.cc | 53 | ||||
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_random_annotator.h | 51 | ||||
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_random_annotator.i | 32 | ||||
-rw-r--r-- | gnuradio-core/src/lib/runtime/runtime.i | 2 |
5 files changed, 141 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/runtime/Makefile.am b/gnuradio-core/src/lib/runtime/Makefile.am index 4c52f3ab0..1af91d80d 100644 --- a/gnuradio-core/src/lib/runtime/Makefile.am +++ b/gnuradio-core/src/lib/runtime/Makefile.am @@ -49,6 +49,7 @@ libruntime_la_SOURCES = \ gr_msg_queue.cc \ gr_pagesize.cc \ gr_preferences.cc \ + gr_random_annotator.cc \ gr_realtime.cc \ gr_scheduler.cc \ gr_scheduler_sts.cc \ @@ -103,6 +104,7 @@ grinclude_HEADERS = \ gr_msg_queue.h \ gr_pagesize.h \ gr_preferences.h \ + gr_random_annotator.h \ gr_realtime.h \ gr_runtime_types.h \ gr_scheduler.h \ @@ -153,6 +155,7 @@ swiginclude_HEADERS = \ gr_message.i \ gr_msg_handler.i \ gr_msg_queue.i \ + gr_random_annotator.i \ gr_realtime.i \ gr_single_threaded_scheduler.i \ gr_sync_block.i \ diff --git a/gnuradio-core/src/lib/runtime/gr_random_annotator.cc b/gnuradio-core/src/lib/runtime/gr_random_annotator.cc new file mode 100644 index 000000000..85995fde1 --- /dev/null +++ b/gnuradio-core/src/lib/runtime/gr_random_annotator.cc @@ -0,0 +1,53 @@ +/* -*- c++ -*- */ +/* + * Copyright 2010 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gr_random_annotator.h> +#include <gr_io_signature.h> + +gr_random_annotator::gr_random_annotator (size_t sizeof_stream_item) + : gr_sync_block ("random_annotator", + gr_make_io_signature (1, 1, sizeof_stream_item), + gr_make_io_signature (1, 1, sizeof_stream_item)) +{ +} + +gr_random_annotator::~gr_random_annotator () +{ +} + +gr_random_annotator_sptr +gr_make_random_annotator (size_t sizeof_stream_item) +{ + return gnuradio::get_initial_sptr (new gr_random_annotator (sizeof_stream_item)); +} + +int +gr_random_annotator::work (int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items) +{ + return noutput_items; +} diff --git a/gnuradio-core/src/lib/runtime/gr_random_annotator.h b/gnuradio-core/src/lib/runtime/gr_random_annotator.h new file mode 100644 index 000000000..cf894c640 --- /dev/null +++ b/gnuradio-core/src/lib/runtime/gr_random_annotator.h @@ -0,0 +1,51 @@ +/* -*- c++ -*- */ +/* + * Copyright 2010 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. + */ + +#ifndef INCLUDED_GR_RANDOM_ANNOTATOR_H +#define INCLUDED_GR_RANDOM_ANNOTATOR_H + +#include <gr_sync_block.h> + +class gr_random_annotator; +typedef boost::shared_ptr<gr_random_annotator> gr_random_annotator_sptr; + +// public constructor +gr_random_annotator_sptr +gr_make_random_annotator (size_t sizeof_stream_item); + +class gr_random_annotator : public gr_sync_block +{ + public: + ~gr_random_annotator (); + int work (int noutput_items, + gr_vector_const_void_star &input_items, + gr_vector_void_star &output_items); + +protected: + gr_random_annotator (size_t sizeof_stream_item); + + private: + friend gr_random_annotator_sptr + gr_make_random_annotator (size_t sizeof_stream_item); +}; + +#endif diff --git a/gnuradio-core/src/lib/runtime/gr_random_annotator.i b/gnuradio-core/src/lib/runtime/gr_random_annotator.i new file mode 100644 index 000000000..f8765a294 --- /dev/null +++ b/gnuradio-core/src/lib/runtime/gr_random_annotator.i @@ -0,0 +1,32 @@ +/* -*- c++ -*- */ +/* + * Copyright 2010 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. + */ + +GR_SWIG_BLOCK_MAGIC(gr,random_annotator); + +gr_random_annotator_sptr gr_make_random_annotator (size_t sizeof_stream_item); + +class gr_random_annotator : public gr_sync_block +{ +private: + gr_random_annotator (size_t sizeof_stream_item); +}; + diff --git a/gnuradio-core/src/lib/runtime/runtime.i b/gnuradio-core/src/lib/runtime/runtime.i index 20cf68a03..51b32de17 100644 --- a/gnuradio-core/src/lib/runtime/runtime.i +++ b/gnuradio-core/src/lib/runtime/runtime.i @@ -33,6 +33,7 @@ #include <gr_msg_queue.h> #include <gr_dispatcher.h> #include <gr_error_handler.h> +#include <gr_random_annotator.h> #include <gr_realtime.h> #include <gr_sync_block.h> #include <gr_sync_decimator.h> @@ -53,6 +54,7 @@ %include <gr_msg_queue.i> %include <gr_dispatcher.i> %include <gr_error_handler.i> +%include <gr_random_annotator.i> %include <gr_realtime.i> %include <gr_sync_block.i> %include <gr_sync_decimator.i> |