From eb05abff6d3ba1f593e3f33fe2eb455d0824a7a4 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 23 Feb 2013 01:50:10 -0800 Subject: gras: implement io sig ontop of set/get size api --- gnuradio-core/src/lib/runtime/gr_block.cc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'gnuradio-core/src/lib/runtime/gr_block.cc') diff --git a/gnuradio-core/src/lib/runtime/gr_block.cc b/gnuradio-core/src/lib/runtime/gr_block.cc index ed390e71f..bac395a20 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.cc +++ b/gnuradio-core/src/lib/runtime/gr_block.cc @@ -43,6 +43,34 @@ gr_block::gr_block( this->set_output_signature(output_signature); } +gr_io_signature_sptr gr_block::input_signature(void) const +{ + return _in_sig; +} + +gr_io_signature_sptr gr_block::output_signature(void) const +{ + return _out_sig; +} + +void gr_block::set_input_signature(gr_io_signature_sptr sig) +{ + for (size_t i = 0; i < sig->sizeof_stream_items().size(); i++) + { + this->set_input_size(i, sig->sizeof_stream_items().at(i)); + } + _in_sig = sig; +} + +void gr_block::set_output_signature(gr_io_signature_sptr sig) +{ + for (size_t i = 0; i < sig->sizeof_stream_items().size(); i++) + { + this->set_output_size(i, sig->sizeof_stream_items().at(i)); + } + _out_sig = sig; +} + gr_block::~gr_block(void) { //NOP -- cgit