GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
vector_insert.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2012-2013,2018 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 
12 #ifndef VECTOR_INSERT_H
13 #define VECTOR_INSERT_H
14 
15 #include <gnuradio/block.h>
16 #include <gnuradio/blocks/api.h>
17 #include <cstdint>
18 
19 namespace gr {
20 namespace blocks {
21 
22 /*!
23  * \brief source of T's that gets its data from a vector
24  * \ingroup stream_operators_blk
25  */
26 template <class T>
27 class BLOCKS_API vector_insert : virtual public block
28 {
29 public:
30  // gr::blocks::vector_insert::sptr
31  typedef std::shared_ptr<vector_insert<T>> sptr;
32 
33  /*!
34  * Make vector insert block.
35  *
36  * \param data vector of data to insert
37  * \param periodicity number of samples between when to send \p data
38  * \param offset initial item offset of first insert
39  */
40  static sptr make(const std::vector<T>& data, int periodicity, int offset = 0);
41 
42  virtual void rewind() = 0;
43  virtual void set_data(const std::vector<T>& data) = 0;
44 };
45 
51 } /* namespace blocks */
52 } /* namespace gr */
53 
54 #endif /* VECTOR_INSERT_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
source of T's that gets its data from a vector
Definition: vector_insert.h:28
virtual void set_data(const std::vector< T > &data)=0
virtual void rewind()=0
static sptr make(const std::vector< T > &data, int periodicity, int offset=0)
std::shared_ptr< vector_insert< T > > sptr
Definition: vector_insert.h:31
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
vector_insert< gr_complex > vector_insert_c
Definition: vector_insert.h:50
vector_insert< float > vector_insert_f
Definition: vector_insert.h:49
vector_insert< std::int32_t > vector_insert_i
Definition: vector_insert.h:48
vector_insert< std::int16_t > vector_insert_s
Definition: vector_insert.h:47
vector_insert< std::uint8_t > vector_insert_b
Definition: vector_insert.h:46
GNU Radio logging wrapper.
Definition: basic_block.h:29