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
31 * \param min_streams specify minimum number of streams (>= 0)
32 * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
33 * \param sizeof_stream_item specify the size of the items in each stream
36 gr_make_io_signature(int min_streams, int max_streams,
37 int sizeof_stream_item);
40 * \brief Create an i/o signature
42 * \param min_streams specify minimum number of streams (>= 0)
43 * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
44 * \param sizeof_stream_item1 specify the size of the items in the first stream
45 * \param sizeof_stream_item2 specify the size of the items in the second and subsequent streams
48 gr_make_io_signature2(int min_streams, int max_streams,
49 int sizeof_stream_item1,
50 int sizeof_stream_item2
54 * \brief Create an i/o signature
56 * \param min_streams specify minimum number of streams (>= 0)
57 * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
58 * \param sizeof_stream_item1 specify the size of the items in the first stream
59 * \param sizeof_stream_item2 specify the size of the items in the second stream
60 * \param sizeof_stream_item3 specify the size of the items in the third and subsequent streams
63 gr_make_io_signature3(int min_streams, int max_streams,
64 int sizeof_stream_item1,
65 int sizeof_stream_item2,
66 int sizeof_stream_item3
70 * \brief Create an i/o signature
72 * \param min_streams specify minimum number of streams (>= 0)
73 * \param max_streams specify maximum number of streams (>= min_streams or -1 -> infinite)
74 * \param sizeof_stream_items specify the size of the items in the streams
76 * If there are more streams than there are entries in sizeof_stream_items, the
77 * value of the last entry in sizeof_stream_items is used for the missing values.
78 * sizeof_stream_items must contain at least 1 entry.
81 gr_make_io_signaturev(int min_streams, int max_streams,
82 const std::vector<int> &sizeof_stream_items);
86 * \brief i/o signature for input and output ports.
88 class gr_io_signature {
91 std::vector<int> d_sizeof_stream_item;
93 gr_io_signature(int min_streams, int max_streams,
94 const std::vector<int> &sizeof_stream_items);
96 friend gr_io_signature_sptr
97 gr_make_io_signaturev(int min_streams,
99 const std::vector<int> &sizeof_stream_item);
103 static const int IO_INFINITE = -1;
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;
114 #endif /* INCLUDED_IO_SIGNATURE_H */