GNU Radio Manual and C++ API Reference  3.10.9.1
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  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 #ifndef INCLUDED_BLOCKS_TAG_SHARE_H
12 #define INCLUDED_BLOCKS_TAG_SHARE_H
13 
14 #include <gnuradio/blocks/api.h>
15 #include <gnuradio/sync_block.h>
16 
17 namespace gr {
18 namespace blocks {
19 
20 /*!
21  * \brief Adds tags from Input 1 onto Input 0's stream.
22  * \ingroup blocks
23  *
24  * \details
25  * This block utilizes the GNU Radio runtime's tag propagation policy
26  * to transfer or share Input 1's tags to Input 0's stream. This is
27  * useful when a signal is detected via a correlate_access_code_bb or
28  * a threshold crossing from a complex_to_mag_squared block. The tag from
29  * that detection is on the alternate stream, either bytes or floats.
30  * Often there is further signal processing that should be done on the
31  * complex stream. This block allows the detection tags to be added to
32  * the complex stream to trigger downstream processing without the need of
33  * redundant trigger inputs on all subsequent blocks.
34  */
35 class BLOCKS_API tag_share : virtual public gr::sync_block
36 {
37 public:
38  typedef std::shared_ptr<tag_share> sptr;
39 
40  /*!
41  * \param sizeof_io_item The size of the Input 0/Output 0 stream type. Input 0
42  * stream items will be directly copied to Output 0.
43  * \param sizeof_share_item The size of the Input 1 (tag share) stream type. This
44  * stream type does not have to match the input/output stream type. Tags from
45  * Input 1's items will be combined with Input 0's item tags and outputted on
46  * Output 0.
47  * \param vlen The vector size of the input and output stream items
48  */
49  static sptr make(size_t sizeof_io_item, size_t sizeof_share_item, size_t vlen = 1);
50 };
51 
52 } // namespace blocks
53 } // namespace gr
54 
55 #endif /* INCLUDED_BLOCKS_TAG_SHARE_H */
Adds tags from Input 1 onto Input 0's stream.
Definition: tag_share.h:36
static sptr make(size_t sizeof_io_item, size_t sizeof_share_item, size_t vlen=1)
std::shared_ptr< tag_share > sptr
Definition: tag_share.h:38
synchronous 1:1 input to output with history
Definition: sync_block.h:26
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29