GNU Radio Manual and C++ API Reference  3.7.4.1
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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, int max_streams,
42  const std::vector<int> &sizeof_stream_items);
43 
44  public:
46 
47  static const int IO_INFINITE = -1;
48 
49  ~io_signature();
50 
51  /*!
52  * \brief Create an i/o signature
53  *
54  * \ingroup internal
55  * \param min_streams specify minimum number of streams (>= 0)
56  * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
57  * \param sizeof_stream_item specify the size of the items in each stream
58  */
59  static sptr make(int min_streams, int max_streams,
60  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 -> infinite)
67  * \param sizeof_stream_item1 specify the size of the items in the first stream
68  * \param sizeof_stream_item2 specify the size of the items in the second and subsequent streams
69  */
70  static sptr make2(int min_streams, int max_streams,
71  int sizeof_stream_item1,
72  int sizeof_stream_item2);
73 
74  /*!
75  * \brief Create an i/o signature
76  *
77  * \param min_streams specify minimum number of streams (>= 0)
78  * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
79  * \param sizeof_stream_item1 specify the size of the items in the first stream
80  * \param sizeof_stream_item2 specify the size of the items in the second stream
81  * \param sizeof_stream_item3 specify the size of the items in the third and subsequent streams
82  */
83  static sptr make3(int min_streams, int max_streams,
84  int sizeof_stream_item1,
85  int sizeof_stream_item2,
86  int sizeof_stream_item3);
87 
88  /*!
89  * \brief Create an i/o signature
90  *
91  * \param min_streams specify minimum number of streams (>= 0)
92  * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
93  * \param sizeof_stream_items specify the size of the items in the streams
94  *
95  * If there are more streams than there are entries in
96  * sizeof_stream_items, the value of the last entry in
97  * sizeof_stream_items is used for the missing values.
98  * sizeof_stream_items must contain at least 1 entry.
99  */
100  static sptr makev(int min_streams, int max_streams,
101  const std::vector<int> &sizeof_stream_items);
102 
103  int min_streams() const { return d_min_streams; }
104  int max_streams() const { return d_max_streams; }
105  int sizeof_stream_item(int index) const;
106  std::vector<int> sizeof_stream_items() const;
107  };
108 
109 } /* namespace gr */
110 
111 #endif /* INCLUDED_IO_SIGNATURE_H */
boost::shared_ptr< io_signature > sptr
Definition: io_signature.h:45
int max_streams() const
Definition: io_signature.h:104
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:30
int min_streams() const
Definition: io_signature.h:103
i/o signature for input and output ports.
Definition: io_signature.h:35