GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
tagged_stream_mux.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /* Copyright 2012 Free Software Foundation, Inc.
3  *
4  * This file is part of GNU Radio
5  *
6  * SPDX-License-Identifier: GPL-3.0-or-later
7  *
8  */
9 
10 #ifndef INCLUDED_TAGGED_STREAM_MUX_H
11 #define INCLUDED_TAGGED_STREAM_MUX_H
12 
13 #include <gnuradio/blocks/api.h>
15 
16 namespace gr {
17 namespace blocks {
18 
19 /*!
20  * \brief Combines tagged streams.
21  * \ingroup stream_operators_blk
22  *
23  * \details
24  * Takes N streams as input. Each stream is tagged with packet lengths.
25  * Packets are output sequentially from each input stream.
26  *
27  * The output signal has a new length tag, which is the sum of all
28  * individual length tags. The old length tags are discarded.
29  *
30  * All other tags are propagated as expected, i.e. they stay associated
31  * with the same input item.
32  * There are cases when this behaviour is undesirable. One special case
33  * is when a tag at the first element (the head item) of one input port
34  * must stay on the head item of the output port. To achieve this,
35  * set \p tag_preserve_head_pos to the port that will receive these special
36  * tags.
37  */
39 {
40 public:
41  typedef std::shared_ptr<tagged_stream_mux> sptr;
42 
43  /*!
44  * Make a tagged stream mux block.
45  *
46  * \param itemsize Items size (number of bytes per item)
47  * \param lengthtagname Length tag key
48  * \param tag_preserve_head_pos Preserves the head position of tags on this input port
49  */
50  static sptr make(size_t itemsize,
51  const std::string& lengthtagname,
52  unsigned int tag_preserve_head_pos = 0);
53 };
54 
55 } // namespace blocks
56 } // namespace gr
57 
58 #endif /* INCLUDED_TAGGED_STREAM_MUX_H */
Combines tagged streams.
Definition: tagged_stream_mux.h:39
std::shared_ptr< tagged_stream_mux > sptr
Definition: tagged_stream_mux.h:41
static sptr make(size_t itemsize, const std::string &lengthtagname, unsigned int tag_preserve_head_pos=0)
Block that operates on PDUs in form of tagged streams.
Definition: tagged_stream_block.h:26
#define BLOCKS_API
Definition: gr-blocks/include/gnuradio/blocks/api.h:18
GR_RUNTIME_API size_t itemsize(types::vector_type type)
GNU Radio logging wrapper.
Definition: basic_block.h:29