diff options
author | Josh Blum | 2013-02-23 01:50:10 -0800 |
---|---|---|
committer | Josh Blum | 2013-02-23 01:50:10 -0800 |
commit | eb05abff6d3ba1f593e3f33fe2eb455d0824a7a4 (patch) | |
tree | ce2468a4013c2038e64a1013ad0f23ad9056619f /gnuradio-core/src/lib/runtime/gr_block.cc | |
parent | ed4a675c651ebb74904d2e1d4297cdfac0e4f214 (diff) | |
download | gnuradio-eb05abff6d3ba1f593e3f33fe2eb455d0824a7a4.tar.gz gnuradio-eb05abff6d3ba1f593e3f33fe2eb455d0824a7a4.tar.bz2 gnuradio-eb05abff6d3ba1f593e3f33fe2eb455d0824a7a4.zip |
gras: implement io sig ontop of set/get size api
Diffstat (limited to 'gnuradio-core/src/lib/runtime/gr_block.cc')
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_block.cc | 28 |
1 files changed, 28 insertions, 0 deletions
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 |