diff options
author | Josh Blum | 2012-09-10 14:12:56 -0700 |
---|---|---|
committer | Josh Blum | 2012-09-10 14:12:56 -0700 |
commit | f26a477d4526d2abf9310b0b620c66376759d4db (patch) | |
tree | 163b7ecaff896f04a01e60b51ae85d36c11c7816 | |
parent | 55289d5761c9fb07019643438e2e0b767ea97ecf (diff) | |
download | sandhi-f26a477d4526d2abf9310b0b620c66376759d4db.tar.gz sandhi-f26a477d4526d2abf9310b0b620c66376759d4db.tar.bz2 sandhi-f26a477d4526d2abf9310b0b620c66376759d4db.zip |
remove output tags queue, block directly posts msg downstream
-rw-r--r-- | lib/block.cpp | 3 | ||||
-rw-r--r-- | lib/block_handlers.cpp | 1 | ||||
-rw-r--r-- | lib/block_task.cpp | 14 | ||||
-rw-r--r-- | lib/element_impl.hpp | 2 |
4 files changed, 5 insertions, 15 deletions
diff --git a/lib/block.cpp b/lib/block.cpp index ea70f28..9dd0028 100644 --- a/lib/block.cpp +++ b/lib/block.cpp @@ -146,7 +146,8 @@ void Block::add_item_tag( const size_t which_output, const Tag &tag ){ - (*this)->output_tags[which_output].push_back(tag); + ASSERT((*this)->work_task_iface); + (*this)->work_task_iface.post_downstream(which_output, tag); } void Block::add_item_tag( diff --git a/lib/block_handlers.cpp b/lib/block_handlers.cpp index d63c1a9..367a6f3 100644 --- a/lib/block_handlers.cpp +++ b/lib/block_handlers.cpp @@ -150,7 +150,6 @@ void ElementImpl::topology_update(const tsbe::TaskInterface &task_iface) //resize tags vector to match sizes this->input_tags_changed.resize(num_inputs); this->input_tags.resize(num_inputs); - this->output_tags.resize(num_outputs); //impose input reserve requirements based on relative rate and output multiple std::vector<size_t> input_multiple_items(num_inputs, 1); diff --git a/lib/block_task.cpp b/lib/block_task.cpp index 5c2137c..4acc1b9 100644 --- a/lib/block_task.cpp +++ b/lib/block_task.cpp @@ -181,7 +181,9 @@ void ElementImpl::handle_task(const tsbe::TaskInterface &task_iface) work_noutput_items = num_output_items; if (this->enable_fixed_rate) work_noutput_items = std::min( work_noutput_items, myulround((num_input_items)*this->relative_rate)); + this->work_task_iface = task_iface; const int ret = block_ptr->Work(this->input_items, this->output_items); + this->work_task_iface.reset(); const size_t noutput_items = size_t(ret); if (ret == Block::WORK_DONE) @@ -278,18 +280,6 @@ void ElementImpl::handle_task(const tsbe::TaskInterface &task_iface) } //------------------------------------------------------------------ - //-- now commit all tags in the output queue to the downstream - //------------------------------------------------------------------ - for (size_t i = 0; i < num_outputs; i++) - { - BOOST_FOREACH(const Tag &t, this->output_tags[i]) - { - task_iface.post_downstream(i, t); - } - this->output_tags[i].clear(); - } - - //------------------------------------------------------------------ //-- Message self based on post-work conditions //------------------------------------------------------------------ this->conclusion(task_iface, inputs_done); diff --git a/lib/element_impl.hpp b/lib/element_impl.hpp index 250e640..0c080fd 100644 --- a/lib/element_impl.hpp +++ b/lib/element_impl.hpp @@ -90,7 +90,6 @@ struct ElementImpl //tag tracking std::vector<bool> input_tags_changed; std::vector<std::vector<Tag> > input_tags; - std::vector<std::vector<Tag> > output_tags; Block::tag_propagation_policy_t tag_prop_policy; //topological things @@ -105,6 +104,7 @@ struct ElementImpl } //gets the handlers access for forecast and work Block *block_ptr; + tsbe::TaskInterface work_task_iface; //only valid during work //handlers void handle_input_msg(const tsbe::TaskInterface &, const size_t, const tsbe::Wax &); |