GNU Radio C++ API
gr_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 <gr_core_api.h>
27 #include <gr_runtime_types.h>
28 
29 /*!
30  * \brief Create an i/o signature
31  *
32  * \ingroup internal
33  * \param min_streams specify minimum number of streams (>= 0)
34  * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
35  * \param sizeof_stream_item specify the size of the items in each stream
36  */
38 gr_make_io_signature(int min_streams, int max_streams,
39  int sizeof_stream_item);
40 
41 /*!
42  * \brief Create an i/o signature
43  *
44  * \param min_streams specify minimum number of streams (>= 0)
45  * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
46  * \param sizeof_stream_item1 specify the size of the items in the first stream
47  * \param sizeof_stream_item2 specify the size of the items in the second and subsequent streams
48  */
50 gr_make_io_signature2(int min_streams, int max_streams,
51  int sizeof_stream_item1,
52  int sizeof_stream_item2
53  );
54 
55 /*!
56  * \brief Create an i/o signature
57  *
58  * \param min_streams specify minimum number of streams (>= 0)
59  * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
60  * \param sizeof_stream_item1 specify the size of the items in the first stream
61  * \param sizeof_stream_item2 specify the size of the items in the second stream
62  * \param sizeof_stream_item3 specify the size of the items in the third and subsequent streams
63  */
65 gr_make_io_signature3(int min_streams, int max_streams,
66  int sizeof_stream_item1,
67  int sizeof_stream_item2,
68  int sizeof_stream_item3
69  );
70 
71 /*!
72  * \brief Create an i/o signature
73  *
74  * \param min_streams specify minimum number of streams (>= 0)
75  * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
76  * \param sizeof_stream_items specify the size of the items in the streams
77  *
78  * If there are more streams than there are entries in sizeof_stream_items, the
79  * value of the last entry in sizeof_stream_items is used for the missing values.
80  * sizeof_stream_items must contain at least 1 entry.
81  */
83 gr_make_io_signaturev(int min_streams, int max_streams,
84  const std::vector<int> &sizeof_stream_items);
85 
86 
87 /*!
88  * \brief i/o signature for input and output ports.
89  * \brief misc
90  */
92  int d_min_streams;
93  int d_max_streams;
94  std::vector<int> d_sizeof_stream_item;
95 
96  gr_io_signature(int min_streams, int max_streams,
97  const std::vector<int> &sizeof_stream_items);
98 
100  gr_make_io_signaturev(int min_streams,
101  int max_streams,
102  const std::vector<int> &sizeof_stream_items);
103 
104  public:
105 
106  static const int IO_INFINITE = -1;
107 
108  ~gr_io_signature ();
109 
110  int min_streams () const { return d_min_streams; }
111  int max_streams () const { return d_max_streams; }
112  int sizeof_stream_item (int index) const;
113  std::vector<int> sizeof_stream_items() const;
114 };
115 
116 
117 #endif /* INCLUDED_IO_SIGNATURE_H */