3 * Copyright 2004,2007 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
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)
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.
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.
23 #ifndef INCLUDED_IO_SIGNATURE_H
24 #define INCLUDED_IO_SIGNATURE_H
26 #include <gr_runtime_types.h>
29 * \brief Create an i/o signature
32 * \param min_streams specify minimum number of streams (>= 0)
33 * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
34 * \param sizeof_stream_item specify the size of the items in each stream
37 gr_make_io_signature(int min_streams, int max_streams,
38 int sizeof_stream_item);
41 * \brief Create an i/o signature
43 * \param min_streams specify minimum number of streams (>= 0)
44 * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
45 * \param sizeof_stream_item1 specify the size of the items in the first stream
46 * \param sizeof_stream_item2 specify the size of the items in the second and subsequent streams
49 gr_make_io_signature2(int min_streams, int max_streams,
50 int sizeof_stream_item1,
51 int sizeof_stream_item2
55 * \brief Create an i/o signature
57 * \param min_streams specify minimum number of streams (>= 0)
58 * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
59 * \param sizeof_stream_item1 specify the size of the items in the first stream
60 * \param sizeof_stream_item2 specify the size of the items in the second stream
61 * \param sizeof_stream_item3 specify the size of the items in the third and subsequent streams
64 gr_make_io_signature3(int min_streams, int max_streams,
65 int sizeof_stream_item1,
66 int sizeof_stream_item2,
67 int sizeof_stream_item3
71 * \brief Create an i/o signature
73 * \param min_streams specify minimum number of streams (>= 0)
74 * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
75 * \param sizeof_stream_items specify the size of the items in the streams
77 * If there are more streams than there are entries in sizeof_stream_items, the
78 * value of the last entry in sizeof_stream_items is used for the missing values.
79 * sizeof_stream_items must contain at least 1 entry.
82 gr_make_io_signaturev(int min_streams, int max_streams,
83 const std::vector<int> &sizeof_stream_items);
87 * \brief i/o signature for input and output ports.
90 class gr_io_signature {
93 std::vector<int> d_sizeof_stream_item;
95 gr_io_signature(int min_streams, int max_streams,
96 const std::vector<int> &sizeof_stream_items);
98 friend gr_io_signature_sptr
99 gr_make_io_signaturev(int min_streams,
101 const std::vector<int> &sizeof_stream_items);
105 static const int IO_INFINITE = -1;
109 int min_streams () const { return d_min_streams; }
110 int max_streams () const { return d_max_streams; }
111 int sizeof_stream_item (int index) const;
112 std::vector<int> sizeof_stream_items() const;
116 #endif /* INCLUDED_IO_SIGNATURE_H */