GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
stream_mux.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2012 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_STREAM_MUX_H
12#define INCLUDED_BLOCKS_STREAM_MUX_H
13
14#include <gnuradio/block.h>
15#include <gnuradio/blocks/api.h>
16#include <vector>
17
18namespace gr {
19namespace blocks {
20
21/*!
22 * \brief Stream muxing block to multiplex many streams into
23 * one with a specified format.
24 * \ingroup stream_operators_blk
25 *
26 * \details
27 * Muxes N streams together producing an output stream that
28 * contains N0 items from the first stream, N1 items from the second,
29 * etc. and repeats:
30 *
31 * [N0, N1, N2, ..., Nm, N0, N1, ...]
32 */
33class BLOCKS_API stream_mux : virtual public block
34{
35public:
36 // gr::blocks::stream_mux::sptr
37 typedef std::shared_ptr<stream_mux> sptr;
38
39 /*!
40 * \brief Creates a stream muxing block to multiplex many streams into
41 * one with a specified format.
42 *
43 * \param itemsize the item size of the stream
44 * \param lengths a vector (list/tuple) specifying the number of
45 * items from each stream the mux together.
46 * Warning: this requires that at least as many items
47 * per stream are available or the system will wait
48 * indefinitely for the items.
49 *
50 */
51 static sptr make(size_t itemsize, const std::vector<int>& lengths);
52};
53
54} /* namespace blocks */
55} /* namespace gr */
56
57#endif /* INCLUDED_BLOCKS_STREAM_MUX_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
Stream muxing block to multiplex many streams into one with a specified format.
Definition: stream_mux.h:34
static sptr make(size_t itemsize, const std::vector< int > &lengths)
Creates a stream muxing block to multiplex many streams into one with a specified format.
std::shared_ptr< stream_mux > sptr
Definition: stream_mux.h:37
#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