GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
tag_gate.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2013 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_GATE_H
12 #define INCLUDED_BLOCKS_TAG_GATE_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 Control tag propagation.
22  * \ingroup blocks
23  *
24  * Use this block to stop tags from propagating.
25  */
26 class BLOCKS_API tag_gate : virtual public gr::sync_block
27 {
28 public:
29  typedef std::shared_ptr<tag_gate> sptr;
30 
31  virtual void set_propagation(bool propagate_tags) = 0;
32 
33  /*!
34  * \param item_size Item size
35  * \param propagate_tags Set this to true to allow tags to pass through this block.
36  */
37  static sptr make(size_t item_size, bool propagate_tags = false);
38 
39  /*!
40  * \brief Only gate stream tags with one specific key instead of all keys
41  *
42  * \details
43  * If set to "", all tags will be affected by the gate.
44  * If set to "foo", all tags with key different from "foo" will pass
45  * through.
46  */
47  virtual void set_single_key(const std::string& single_key) = 0;
48 
49  /*!
50  * \brief Get the current single key.
51  */
52  virtual std::string single_key() const = 0;
53 };
54 
55 } // namespace blocks
56 } // namespace gr
57 
58 #endif /* INCLUDED_BLOCKS_TAG_GATE_H */
Control tag propagation.
Definition: tag_gate.h:27
virtual void set_propagation(bool propagate_tags)=0
static sptr make(size_t item_size, bool propagate_tags=false)
virtual std::string single_key() const =0
Get the current single key.
virtual void set_single_key(const std::string &single_key)=0
Only gate stream tags with one specific key instead of all keys.
std::shared_ptr< tag_gate > sptr
Definition: tag_gate.h:29
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