summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2013-02-25 03:16:03 -0800
committerJosh Blum2013-02-25 03:16:03 -0800
commitc60a6dc8b61c26c37874b27e4440c02e573dca27 (patch)
tree7e5c4ada51384513fdeb9b46dde339ed06dff677
parent7233e7c2dd2c0cba1a998cdd5b3ad7f76816e9dd (diff)
downloadgnuradio-c60a6dc8b61c26c37874b27e4440c02e573dca27.tar.gz
gnuradio-c60a6dc8b61c26c37874b27e4440c02e573dca27.tar.bz2
gnuradio-c60a6dc8b61c26c37874b27e4440c02e573dca27.zip
gras: changes for port config API
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block.cc24
1 files changed, 9 insertions, 15 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_block.cc b/gnuradio-core/src/lib/runtime/gr_block.cc
index bac395a20..53d9d20c4 100644
--- a/gnuradio-core/src/lib/runtime/gr_block.cc
+++ b/gnuradio-core/src/lib/runtime/gr_block.cc
@@ -57,7 +57,7 @@ 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));
+ this->input_config(i).item_size = sig->sizeof_stream_items().at(i);
}
_in_sig = sig;
}
@@ -66,7 +66,7 @@ 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));
+ this->output_config(i).item_size = sig->sizeof_stream_items().at(i);
}
_out_sig = sig;
}
@@ -344,12 +344,11 @@ unsigned gr_block::history(void) const
void gr_block::set_history(unsigned history)
{
- gras::InputPortConfig config = this->get_input_config(0);
//implement off-by-one history compat
if (history == 0) history++;
_input_history_items = history-1;
- config.preload_items = _input_history_items;
- this->set_input_config(0, config);
+ this->input_config(0).preload_items = _input_history_items;
+ this->commit_config();
}
void gr_block::set_fixed_rate(const bool fixed_rate)
@@ -373,18 +372,15 @@ void gr_block::_update_input_reserve(void)
*/
if (_enable_fixed_rate or _output_multiple_items > 1024)
{
- gras::InputPortConfig config = this->get_input_config(0);
- config.reserve_items = size_t(0.5 + _output_multiple_items/_relative_rate);
- if (config.reserve_items) this->set_input_config(0, config);
+ const size_t reserve = size_t(0.5 + _output_multiple_items/_relative_rate);
+ if (reserve) this->input_config(0).reserve_items = reserve;
}
}
void gr_block::set_output_multiple(const size_t multiple)
{
_output_multiple_items = multiple;
- gras::OutputPortConfig config = this->get_output_config(0);
- config.reserve_items = multiple;
- this->set_output_config(0, config);
+ this->output_config(0).reserve_items = multiple;
this->_update_input_reserve();
}
@@ -406,14 +402,12 @@ double gr_block::relative_rate(void) const
int gr_block::max_noutput_items(void) const
{
- return this->get_output_config(0).maximum_items;
+ return this->output_config(0).maximum_items;
}
void gr_block::set_max_noutput_items(int max_items)
{
- gras::OutputPortConfig config = this->get_output_config(0);
- config.maximum_items = max_items;
- this->set_output_config(0, config);
+ this->output_config(0).maximum_items = max_items;
}
void gr_block::unset_max_noutput_items(void)