GNU Radio Manual and C++ API Reference  v3.9.2.0-89-gb7c7001e
The Free & Open Software Radio Ecosystem
io_signature.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004,2007 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_IO_SIGNATURE_H
12 #define INCLUDED_IO_SIGNATURE_H
13 
14 #include <gnuradio/api.h>
15 #include <gnuradio/runtime_types.h>
16 
17 namespace gr {
18 
19 /*!
20  * \brief i/o signature for input and output ports.
21  * \brief misc
22  */
24 {
25  int d_min_streams;
26  int d_max_streams;
27  std::vector<int> d_sizeof_stream_item;
28 
29  io_signature(int min_streams,
30  int max_streams,
31  const std::vector<int>& sizeof_stream_items);
32 
33 public:
34  typedef std::shared_ptr<io_signature> sptr;
35 
36  static constexpr int IO_INFINITE = -1;
37 
39 
40  /*!
41  * \brief Create an i/o signature
42  *
43  * \ingroup internal
44  * \param min_streams specify minimum number of streams (>= 0)
45  * \param max_streams specify maximum number of streams (>= min_streams or -1 ->
46  * infinite) \param sizeof_stream_item specify the size of the items in each stream
47  */
48  static sptr make(int min_streams, int max_streams, int sizeof_stream_item);
49 
50  /*!
51  * \brief Create an i/o signature
52  *
53  * \param min_streams specify minimum number of streams (>= 0)
54  * \param max_streams specify maximum number of streams (>= min_streams or -1 ->
55  * infinite) \param sizeof_stream_item1 specify the size of the items in the first
56  * stream \param sizeof_stream_item2 specify the size of the items in the second and
57  * subsequent streams
58  */
59  static sptr make2(int min_streams,
60  int max_streams,
61  int sizeof_stream_item1,
62  int sizeof_stream_item2);
63 
64  /*!
65  * \brief Create an i/o signature
66  *
67  * \param min_streams specify minimum number of streams (>= 0)
68  * \param max_streams specify maximum number of streams (>= min_streams or -1 ->
69  * infinite) \param sizeof_stream_item1 specify the size of the items in the first
70  * stream \param sizeof_stream_item2 specify the size of the items in the second
71  * stream \param sizeof_stream_item3 specify the size of the items in the third and
72  * subsequent streams
73  */
74  static sptr make3(int min_streams,
75  int max_streams,
76  int sizeof_stream_item1,
77  int sizeof_stream_item2,
78  int sizeof_stream_item3);
79 
80  /*!
81  * \brief Create an i/o signature
82  *
83  * \param min_streams specify minimum number of streams (>= 0)
84  * \param max_streams specify maximum number of streams (>= min_streams or -1 ->
85  * infinite) \param sizeof_stream_items specify the size of the items in the streams
86  *
87  * If there are more streams than there are entries in
88  * sizeof_stream_items, the value of the last entry in
89  * sizeof_stream_items is used for the missing values.
90  * sizeof_stream_items must contain at least 1 entry.
91  */
92  static sptr
93  makev(int min_streams, int max_streams, const std::vector<int>& sizeof_stream_items);
94 
95  int min_streams() const { return d_min_streams; }
96  int max_streams() const { return d_max_streams; }
97  int sizeof_stream_item(int index) const;
98  std::vector<int> sizeof_stream_items() const;
99 };
100 
101 } /* namespace gr */
102 
103 #endif /* INCLUDED_IO_SIGNATURE_H */
i/o signature for input and output ports.
Definition: io_signature.h:24
int min_streams() const
Definition: io_signature.h:95
int sizeof_stream_item(int index) const
std::shared_ptr< io_signature > sptr
Definition: io_signature.h:34
static sptr make2(int min_streams, int max_streams, int sizeof_stream_item1, int sizeof_stream_item2)
Create an i/o signature.
static sptr makev(int min_streams, int max_streams, const std::vector< int > &sizeof_stream_items)
Create an i/o signature.
static sptr make3(int min_streams, int max_streams, int sizeof_stream_item1, int sizeof_stream_item2, int sizeof_stream_item3)
Create an i/o signature.
int max_streams() const
Definition: io_signature.h:96
std::vector< int > sizeof_stream_items() const
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:18
static sptr make(int min_streams, int max_streams, int sizeof_stream_item)
Create an i/o signature.
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:29