GNU Radio Manual and C++ API Reference  3.8.1.0
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  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef INCLUDED_IO_SIGNATURE_H
24 #define INCLUDED_IO_SIGNATURE_H
25 
26 #include <gnuradio/api.h>
27 #include <gnuradio/runtime_types.h>
28 
29 namespace gr {
30 
31 /*!
32  * \brief i/o signature for input and output ports.
33  * \brief misc
34  */
36 {
37  int d_min_streams;
38  int d_max_streams;
39  std::vector<int> d_sizeof_stream_item;
40 
41  io_signature(int min_streams,
42  int max_streams,
43  const std::vector<int>& sizeof_stream_items);
44 
45 public:
46  typedef boost::shared_ptr<io_signature> sptr;
47 
48  static const int IO_INFINITE = -1;
49 
50  ~io_signature();
51 
52  /*!
53  * \brief Create an i/o signature
54  *
55  * \ingroup internal
56  * \param min_streams specify minimum number of streams (>= 0)
57  * \param max_streams specify maximum number of streams (>= min_streams or -1 ->
58  * infinite) \param sizeof_stream_item specify the size of the items in each stream
59  */
60  static sptr make(int min_streams, int max_streams, int sizeof_stream_item);
61 
62  /*!
63  * \brief Create an i/o signature
64  *
65  * \param min_streams specify minimum number of streams (>= 0)
66  * \param max_streams specify maximum number of streams (>= min_streams or -1 ->
67  * infinite) \param sizeof_stream_item1 specify the size of the items in the first
68  * stream \param sizeof_stream_item2 specify the size of the items in the second and
69  * subsequent streams
70  */
71  static sptr make2(int min_streams,
72  int max_streams,
73  int sizeof_stream_item1,
74  int sizeof_stream_item2);
75 
76  /*!
77  * \brief Create an i/o signature
78  *
79  * \param min_streams specify minimum number of streams (>= 0)
80  * \param max_streams specify maximum number of streams (>= min_streams or -1 ->
81  * infinite) \param sizeof_stream_item1 specify the size of the items in the first
82  * stream \param sizeof_stream_item2 specify the size of the items in the second
83  * stream \param sizeof_stream_item3 specify the size of the items in the third and
84  * subsequent streams
85  */
86  static sptr make3(int min_streams,
87  int max_streams,
88  int sizeof_stream_item1,
89  int sizeof_stream_item2,
90  int sizeof_stream_item3);
91 
92  /*!
93  * \brief Create an i/o signature
94  *
95  * \param min_streams specify minimum number of streams (>= 0)
96  * \param max_streams specify maximum number of streams (>= min_streams or -1 ->
97  * infinite) \param sizeof_stream_items specify the size of the items in the streams
98  *
99  * If there are more streams than there are entries in
100  * sizeof_stream_items, the value of the last entry in
101  * sizeof_stream_items is used for the missing values.
102  * sizeof_stream_items must contain at least 1 entry.
103  */
104  static sptr
105  makev(int min_streams, int max_streams, const std::vector<int>& sizeof_stream_items);
106 
107  int min_streams() const { return d_min_streams; }
108  int max_streams() const { return d_max_streams; }
109  int sizeof_stream_item(int index) const;
110  std::vector<int> sizeof_stream_items() const;
111 };
112 
113 } /* namespace gr */
114 
115 #endif /* INCLUDED_IO_SIGNATURE_H */
boost::shared_ptr< io_signature > sptr
Definition: io_signature.h:46
int max_streams() const
Definition: io_signature.h:108
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:30
int min_streams() const
Definition: io_signature.h:107
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
i/o signature for input and output ports.
Definition: io_signature.h:35