GNU Radio Manual and C++ API Reference  3.7.13.4
The Free & Open Software Radio Ecosystem
tag_share.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2017 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef INCLUDED_BLOCKS_TAG_SHARE_H
24 #define INCLUDED_BLOCKS_TAG_SHARE_H
25 
26 #include <gnuradio/blocks/api.h>
27 #include <gnuradio/sync_block.h>
28 
29 namespace gr {
30  namespace blocks {
31 
32  /*!
33  * \brief Adds tags from Input 1 onto Input 0's stream.
34  * \ingroup blocks
35  *
36  * \details
37  * This block utilizes the GNU Radio runtime's tag propagation policy
38  * to transfer or share Input 1's tags to Input 0's stream. This is
39  * useful when a signal is detected via a correlate_access_code_bb or
40  * a threshold crossing from a complex_to_mag_squared block. The tag from
41  * that detection is on the alternate stream, either bytes or floats.
42  * Often there is further signal processing that should be done on the
43  * complex stream. This block allows the detection tags to be added to
44  * the complex stream to trigger downstream processing without the need of
45  * redundant trigger inputs on all subsequent blocks.
46  */
47  class BLOCKS_API tag_share : virtual public gr::sync_block
48  {
49  public:
50  typedef boost::shared_ptr<tag_share> sptr;
51 
52  /*!
53  * \param sizeof_io_item The size of the Input 0/Output 0 stream type. Input 0
54  * stream items will be directly copied to Output 0.
55  * \param sizeof_share_item The size of the Input 1 (tag share) stream type. This
56  * stream type does not have to match the input/output stream type. Tags from
57  * Input 1's items will be combined with Input 0's item tags and outputted on
58  * Output 0.
59  * \param vlen The vector size of the input and output stream items
60  */
61  static sptr make(size_t sizeof_io_item, size_t sizeof_share_item, size_t vlen = 1);
62  };
63 
64  } // namespace blocks
65 } // namespace gr
66 
67 #endif /* INCLUDED_BLOCKS_TAG_SHARE_H */
Include this header to use the message passing features.
Definition: logger.h:695
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:30
Adds tags from Input 1 onto Input 0&#39;s stream.
Definition: tag_share.h:47
synchronous 1:1 input to output with historyOverride work to provide the signal processing implementa...
Definition: sync_block.h:37
boost::shared_ptr< tag_share > sptr
Definition: tag_share.h:50