diff options
author | Tom Rondeau <trondeau@vt.edu> | 2013-03-16 19:30:59 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2013-03-16 23:52:20 -0400 |
commit | a792bb88f3c3caa347506503de973aafaf78e0af (patch) | |
tree | a0332d76356df331134f340a2ce527e884c1bdd3 /gr-blocks/include | |
parent | dd5e9df6bf93b676ffa8051b68bd2dbb8d71c15c (diff) |
blocks: moving copy, endian_swap, head, skiphead, vector_source/sink/insert to gr-blocks.
Diffstat (limited to 'gr-blocks/include')
-rw-r--r-- | gr-blocks/include/blocks/CMakeLists.txt | 11 | ||||
-rw-r--r-- | gr-blocks/include/blocks/annotator_1to1.h | 60 | ||||
-rw-r--r-- | gr-blocks/include/blocks/annotator_alltoall.h | 61 | ||||
-rw-r--r-- | gr-blocks/include/blocks/annotator_raw.h | 57 | ||||
-rw-r--r-- | gr-blocks/include/blocks/copy.h | 54 | ||||
-rw-r--r-- | gr-blocks/include/blocks/endian_swap.h | 50 | ||||
-rw-r--r-- | gr-blocks/include/blocks/head.h | 55 | ||||
-rw-r--r-- | gr-blocks/include/blocks/rotator.h | 63 | ||||
-rw-r--r-- | gr-blocks/include/blocks/skiphead.h | 53 | ||||
-rw-r--r-- | gr-blocks/include/blocks/vector_insert_X.h.t | 54 | ||||
-rw-r--r-- | gr-blocks/include/blocks/vector_sink_X.h.t | 54 | ||||
-rw-r--r-- | gr-blocks/include/blocks/vector_source_X.h.t | 56 |
12 files changed, 628 insertions, 0 deletions
diff --git a/gr-blocks/include/blocks/CMakeLists.txt b/gr-blocks/include/blocks/CMakeLists.txt index 10e132ed92..a7cc1e0a31 100644 --- a/gr-blocks/include/blocks/CMakeLists.txt +++ b/gr-blocks/include/blocks/CMakeLists.txt @@ -88,6 +88,9 @@ expand_h(sub_XX ss ii ff cc) expand_h(xor_XX bb ss ii) expand_h(packed_to_unpacked_XX bb ss ii) expand_h(unpacked_to_packed_XX bb ss ii) +expand_h(vector_insert_X b s i f c) +expand_h(vector_sink_X b s i f c) +expand_h(vector_source_X b s i f c) add_custom_target(blocks_generated_includes DEPENDS ${generated_includes} @@ -106,10 +109,14 @@ install(FILES fxpt_nco.h fxpt_vco.h log2_const.h + rotator.h nco.h vco.h wavfile.h add_ff.h + annotator_1to1.h + annotator_alltoall.h + annotator_raw.h bin_statistics_f.h burst_tagger.h char_to_float.h @@ -122,8 +129,10 @@ install(FILES complex_to_mag_squared.h complex_to_arg.h conjugate_cc.h + copy.h deinterleave.h delay.h + endian_swap.h file_source.h file_meta_sink.h file_meta_source.h @@ -132,6 +141,7 @@ install(FILES float_to_int.h float_to_short.h float_to_uchar.h + head.h int_to_float.h interleave.h interleaved_short_to_complex.h @@ -161,6 +171,7 @@ install(FILES rms_ff.h short_to_char.h short_to_float.h + skiphead.h socket_pdu.h stream_mux.h stream_to_streams.h diff --git a/gr-blocks/include/blocks/annotator_1to1.h b/gr-blocks/include/blocks/annotator_1to1.h new file mode 100644 index 0000000000..6cc8db6eef --- /dev/null +++ b/gr-blocks/include/blocks/annotator_1to1.h @@ -0,0 +1,60 @@ +/* -*- c++ -*- */ +/* + * Copyright 2010,2013 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_ANNOTATOR_1TO1_H +#define INCLUDED_GR_ANNOTATOR_1TO1_H + +#include <blocks/api.h> +#include <gr_sync_block.h> + +namespace gr { + namespace blocks { + + /*! + * \brief 1-to-1 stream annotator testing block. FOR TESTING PURPOSES ONLY. + * + * This block creates tags to be sent downstream every 10,000 + * items it sees. The tags contain the name and ID of the + * instantiated block, use "seq" as a key, and have a counter that + * increments by 1 for every tag produced that is used as the + * tag's value. The tags are propagated using the 1-to-1 policy. + * + * It also stores a copy of all tags it sees flow past it. These + * tags can be recalled externally with the data() member. + * + * This block is only meant for testing and showing how to use the tags. + */ + class BLOCKS_API annotator_1to1 : virtual public gr_sync_block + { + public: + // gr::blocks::annotator_1to1::sptr + typedef boost::shared_ptr<annotator_1to1> sptr; + + static sptr make(int when, size_t sizeof_stream_item); + + virtual std::vector<gr_tag_t> data() const = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_ANNOTATOR_1TO1_H */ diff --git a/gr-blocks/include/blocks/annotator_alltoall.h b/gr-blocks/include/blocks/annotator_alltoall.h new file mode 100644 index 0000000000..558aea69ca --- /dev/null +++ b/gr-blocks/include/blocks/annotator_alltoall.h @@ -0,0 +1,61 @@ +/* -*- c++ -*- */ +/* + * Copyright 2010,2013 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_ANNOTATOR_ALLTOALL_H +#define INCLUDED_GR_ANNOTATOR_ALLTOALL_H + +#include <blocks/api.h> +#include <gr_sync_block.h> + +namespace gr { + namespace blocks { + + /*! + * \brief All-to-all stream annotator testing block. FOR TESTING PURPOSES ONLY. + * + * This block creates tags to be sent downstream every 10,000 + * items it sees. The tags contain the name and ID of the + * instantiated block, use "seq" as a key, and have a counter that + * increments by 1 for every tag produced that is used as the + * tag's value. The tags are propagated using the all-to-all + * policy. + * + * It also stores a copy of all tags it sees flow past it. These + * tags can be recalled externally with the data() member. + * + * This block is only meant for testing and showing how to use the tags. + */ + class BLOCKS_API annotator_alltoall : virtual public gr_sync_block + { + public: + // gr::blocks::annotator_alltoall::sptr + typedef boost::shared_ptr<annotator_alltoall> sptr; + + static sptr make(int when, size_t sizeof_stream_item); + + virtual std::vector<gr_tag_t> data() const = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_ANNOTATOR_ALLTOALL_H */ diff --git a/gr-blocks/include/blocks/annotator_raw.h b/gr-blocks/include/blocks/annotator_raw.h new file mode 100644 index 0000000000..e835f0bd8d --- /dev/null +++ b/gr-blocks/include/blocks/annotator_raw.h @@ -0,0 +1,57 @@ +/* -*- c++ -*- */ +/* + * Copyright 2010,2013 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_ANNOTATOR_RAW_H +#define INCLUDED_GR_ANNOTATOR_RAW_H + +#include <blocks/api.h> +#include <gr_sync_block.h> +#include <gr_tags.h> + +namespace gr { + namespace blocks { + + /*! + * \brief raw stream annotator testing block. + * + * This block creates arbitrary tags to be sent downstream blocks + * to be sent are set manually via accessor methods and are sent + * only once. + * + * This block is intended for testing of tag related blocks + */ + class BLOCKS_API annotator_raw : virtual public gr_sync_block + { + public: + // gr::blocks::annotator_raw::sptr + typedef boost::shared_ptr<annotator_raw> sptr; + + static sptr make(size_t sizeof_stream_item); + + // insert a tag to be added + void add_tag(uint64_t offset, pmt::pmt_t key, pmt::pmt_t val); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_ANNOTATOR_RAW_H */ diff --git a/gr-blocks/include/blocks/copy.h b/gr-blocks/include/blocks/copy.h new file mode 100644 index 0000000000..5ed0ea0e92 --- /dev/null +++ b/gr-blocks/include/blocks/copy.h @@ -0,0 +1,54 @@ +/* -*- c++ -*- */ +/* + * Copyright 2006,2009,2013 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_COPY_H +#define INCLUDED_GR_COPY_H + +#include <blocks/api.h> +#include <gr_block.h> + +namespace gr { + namespace blocks { + + /*! + * \brief output[i] = input[i] + * \ingroup misc_blk + * + * When enabled (default), this block copies its input to its + * output. When disabled, this block drops its input on the floor. + */ + class BLOCKS_API copy : virtual public gr_block + { + public: + // gr::blocks::copy::sptr + typedef boost::shared_ptr<copy> sptr; + + static sptr make(size_t itemsize); + + virtual void set_enabled(bool enable) = 0; + virtual bool enabled() const = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_COPY_H */ diff --git a/gr-blocks/include/blocks/endian_swap.h b/gr-blocks/include/blocks/endian_swap.h new file mode 100644 index 0000000000..4b5a76218e --- /dev/null +++ b/gr-blocks/include/blocks/endian_swap.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004,2012,2013 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_ENDIAN_SWAP_H +#define INCLUDED_GR_ENDIAN_SWAP_H + +#include <blocks/api.h> +#include <gr_sync_block.h> + +namespace gr { + namespace blocks { + + /*! + * \brief Convert stream of items into thier byte swapped version + * + * \param item_size_bytes number of bytes per item, 1=no-op, + * 2=uint16_t, 4=uint32_t, 8=uint64_t + */ + class BLOCKS_API endian_swap : virtual public gr_sync_block + { + public: + // gr::blocks::endian_swap::sptr + typedef boost::shared_ptr<endian_swap> sptr; + + static sptr make(size_t item_size_bytes=1); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_ENDIAN_SWAP_H */ diff --git a/gr-blocks/include/blocks/head.h b/gr-blocks/include/blocks/head.h new file mode 100644 index 0000000000..cc7d3808e5 --- /dev/null +++ b/gr-blocks/include/blocks/head.h @@ -0,0 +1,55 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004,2009,2012,2013 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_HEAD_H +#define INCLUDED_GR_HEAD_H + +#include <blocks/api.h> +#include <gr_sync_block.h> +#include <stddef.h> // size_t + +namespace gr { + namespace blocks { + + /*! + * \brief copies the first N items to the output then signals done + * \ingroup slicedice_blk + * + * Useful for building test cases + */ + class BLOCKS_API head : virtual public gr_sync_block + { + public: + // gr::blocks::head::sptr + typedef boost::shared_ptr<head> sptr; + + static sptr make(size_t sizeof_stream_item, + uint64_t nitems); + + virtual void reset() = 0; + virtual void set_length(int nitems) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_HEAD_H */ diff --git a/gr-blocks/include/blocks/rotator.h b/gr-blocks/include/blocks/rotator.h new file mode 100644 index 0000000000..96ece63574 --- /dev/null +++ b/gr-blocks/include/blocks/rotator.h @@ -0,0 +1,63 @@ +/* -*- c++ -*- */ +/* + * Copyright 2003,2008,2013 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 _GR_ROTATOR_H_ +#define _GR_ROTATOR_H_ + +#include <blocks/api.h> +#include <gr_complex.h> + +namespace gr { + namespace blocks { + + class BLOCKS_API rotator + { + private: + gr_complex d_phase; + gr_complex d_phase_incr; + unsigned int d_counter; + + public: + rotator() : d_phase(1), d_phase_incr(1), d_counter(0) + { } + + void set_phase(gr_complex phase) { d_phase = phase / abs(phase); } + void set_phase_incr(gr_complex incr) { d_phase_incr = incr / abs(incr); } + + gr_complex rotate(gr_complex in) + { + d_counter++; + + gr_complex z = in * d_phase; // rotate in by phase + d_phase *= d_phase_incr; // incr our phase (complex mult == add phases) + + if((d_counter % 512) == 0) + d_phase /= abs(d_phase); // Normalize to ensure multiplication is rotation + + return z; + } + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* _GR_ROTATOR_H_ */ diff --git a/gr-blocks/include/blocks/skiphead.h b/gr-blocks/include/blocks/skiphead.h new file mode 100644 index 0000000000..e6745af8ea --- /dev/null +++ b/gr-blocks/include/blocks/skiphead.h @@ -0,0 +1,53 @@ +/* -*- c++ -*- */ +/* + * Copyright 2005,2013 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_SKIPHEAD_H +#define INCLUDED_GR_SKIPHEAD_H + +#include <blocks/api.h> +#include <gr_sync_block.h> +#include <stddef.h> // size_t + +namespace gr { + namespace blocks { + + /*! + * \brief skips the first N items, from then on copies items to the output + * \ingroup slicedice_blk + * + * Useful for building test cases and sources which have metadata + * or junk at the start + */ + class BLOCKS_API skiphead : virtual public gr_block + { + public: + // gr::blocks::skiphead::sptr + typedef boost::shared_ptr<skiphead> sptr; + + static sptr make(size_t itemsize, + uint64_t nitems_to_skip); + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* INCLUDED_GR_SKIPHEAD_H */ diff --git a/gr-blocks/include/blocks/vector_insert_X.h.t b/gr-blocks/include/blocks/vector_insert_X.h.t new file mode 100644 index 0000000000..aeb4a5248a --- /dev/null +++ b/gr-blocks/include/blocks/vector_insert_X.h.t @@ -0,0 +1,54 @@ +/* -*- c++ -*- */ +/* + * Copyright 2012-2013 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 <blocks/api.h> +#include <gr_block.h> + +namespace gr { + namespace blocks { + + /*! + * \brief source of @TYPE@'s that gets its data from a vector + * \ingroup source_blk + */ + class BLOCKS_API @NAME@ : virtual public gr_block + { + public: + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + static sptr make(const std::vector<@TYPE@> &data, + int periodicity, int offset=0); + + virtual void rewind() = 0; + virtual void set_data(const std::vector<@TYPE@> &data) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ diff --git a/gr-blocks/include/blocks/vector_sink_X.h.t b/gr-blocks/include/blocks/vector_sink_X.h.t new file mode 100644 index 0000000000..d15c795721 --- /dev/null +++ b/gr-blocks/include/blocks/vector_sink_X.h.t @@ -0,0 +1,54 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004,2008,2009,2013 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 <blocks/api.h> +#include <gr_sync_block.h> + +namespace gr { + namespace blocks { + + /*! + * \brief @TYPE@ sink that writes to a vector + * \ingroup sink_blk + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + public: + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + static sptr make(int vlen = 1); + + virtual void reset() = 0; + virtual std::vector<@TYPE@> data() const = 0; + virtual std::vector<gr_tag_t> tags() const = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ diff --git a/gr-blocks/include/blocks/vector_source_X.h.t b/gr-blocks/include/blocks/vector_source_X.h.t new file mode 100644 index 0000000000..c68b638e62 --- /dev/null +++ b/gr-blocks/include/blocks/vector_source_X.h.t @@ -0,0 +1,56 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004,2008,2012-2013 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 <blocks/api.h> +#include <gr_sync_block.h> + +namespace gr { + namespace blocks { + + /*! + * \brief source of @TYPE@'s that gets its data from a vector + * \ingroup source_blk + */ + class BLOCKS_API @NAME@ : virtual public gr_sync_block + { + public: + // gr::blocks::@NAME@::sptr + typedef boost::shared_ptr<@NAME@> sptr; + + static sptr make(const std::vector<@TYPE@> &data, + bool repeat=false, int vlen=1, + const std::vector<gr_tag_t> &tags=std::vector<gr_tag_t>()); + + virtual void rewind() = 0; + virtual void set_data(const std::vector<@TYPE@> &data, + const std::vector<gr_tag_t> &tags=std::vector<gr_tag_t>()) = 0; + }; + + } /* namespace blocks */ +} /* namespace gr */ + +#endif /* @GUARD_NAME@ */ |