c++ - GNU Radio io_signature -
i'm getting gnu radio , after created new block, in main class have peace of code :
square_ff_impl::square_ff_impl() : gr::block("square_ff", gr::io_signature::make(<+imin+>, <+imax+>, sizeof (<+itype+>)), // input signature gr::io_signature::make(<+omin+>, <+omax+>, sizeof (<+otype+>))) // output signature { // empty constructor }
i don't know put in min , max (even after reading doc).
can give me examples please ?
imin - minimum number of acceptable input ports imax - maximum number of acceptable input ports omin - minimum number of acceptable output ports omax - maximum number of acceptable output ports
the documentation talks bit in iosignatures portion of blockscodingguide:
- the first 2 parameters min , max number of ports, allows blocks have selectable number of ports @ runtime.
a value of -1 means "unlimited".
as example of source block, take @ io signature of null source block, takes no input:
null_source_impl::null_source_impl (size_t sizeof_stream_item) : sync_block("null_source", io_signature::make(0, 0, 0), io_signature::make(1, -1, sizeof_stream_item)) { }
for sink, check out null sink, has no output:
null_sink_impl::null_sink_impl(size_t sizeof_stream_item) : sync_block("null_sink", io_signature::make(1, -1, sizeof_stream_item), io_signature::make(0, 0, 0)) { }
and simple processing blocks, add_ff, takes unlimited input , produces 1 output stream:
add_ff_impl::add_ff_impl(size_t vlen) : sync_block("add_ff", io_signature::make (1, -1, sizeof(float)*vlen), io_signature::make (1, 1, sizeof(float)*vlen)), d_vlen(vlen) { ...
Comments
Post a Comment