[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Blocks with different input types
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] Blocks with different input types |
Date: |
Sun, 18 Feb 2007 13:56:36 -0800 |
User-agent: |
Mutt/1.5.9i |
On Sun, Feb 18, 2007 at 04:37:10PM -0500, Achilleas Anastasopoulos wrote:
> Is it possible to generate a gnuradio block (gr_block)
> with two kinds of inputs (say, shorts and floats)?
>
> Looking at the contructor, and the gr_io_signature class
> it is not clear how to do that...
>
> gr_block::gr_block ( const std::string & name,
> gr_io_signature_sptr input_signature,
> gr_io_signature_sptr output_signature
> ) [protected]
>
>
> Thanks
> Achilleas
It's not currently possible, though not too hard to add.
I agree that it would be useful.
The underlying code can deal with different types for the ports. It
uses the port specific sizeof_stream_item(index) to retrieve the info.
The only thing missing is a way to build a gr_io_signature with different
types for the elements.
Why don't you take a look at the code in gr_io_signature.{h,cc}, and
let me know if you've got any questions about how to make the change.
There are a couple of ways it could go. Probably the easiest is to
create a std::vector<size_t> indexed by stream index instead of just
using the same d_sizeof_stream_item for all of them.
Eric