diff options
author | Josh Blum | 2012-08-26 18:55:18 -0700 |
---|---|---|
committer | Josh Blum | 2012-08-26 18:55:18 -0700 |
commit | d7374b5658490acf84c539c3528688250c692f21 (patch) | |
tree | d9b17a787e372057530fbb1523d241f3813d2174 /lib/block_task.cpp | |
parent | b4dded9b9e394de73d263b927e93fe4131e6a0d6 (diff) | |
download | sandhi-d7374b5658490acf84c539c3528688250c692f21.tar.gz sandhi-d7374b5658490acf84c539c3528688250c692f21.tar.bz2 sandhi-d7374b5658490acf84c539c3528688250c692f21.zip |
runtime: work on allocator handler
Diffstat (limited to 'lib/block_task.cpp')
-rw-r--r-- | lib/block_task.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/lib/block_task.cpp b/lib/block_task.cpp index 3a34107..c152fa9 100644 --- a/lib/block_task.cpp +++ b/lib/block_task.cpp @@ -22,14 +22,22 @@ using namespace gnuradio; void ElementImpl::handle_task(const tsbe::TaskInterface &task_iface) { + //------------------------------------------------------------------ + //-- Decide if its possible to continue any processing: + //-- Handle task may get called for incoming buffers, + //-- however, not all ports may have available buffers. + //------------------------------------------------------------------ const bool all_inputs_ready = (~task_iface.get_inputs_ready()).none(); const bool all_outputs_ready = (~task_iface.get_outputs_ready()).none(); if (not (this->active and all_inputs_ready and all_outputs_ready)) return; const size_t num_inputs = task_iface.get_num_inputs(); const size_t num_outputs = task_iface.get_num_outputs(); + const bool is_source = (num_inputs == 0); - //sort the input tags before working + //------------------------------------------------------------------ + //-- sort the input tags before working + //------------------------------------------------------------------ for (size_t i = 0; i < num_inputs; i++) { if (not this->input_tags_changed[i]) continue; @@ -38,6 +46,11 @@ void ElementImpl::handle_task(const tsbe::TaskInterface &task_iface) this->input_tags_changed[i] = false; } + //------------------------------------------------------------------ + //-- Processing time! + //------------------------------------------------------------------ + + HERE(); //0) figure out what we have for input data @@ -49,10 +62,14 @@ void ElementImpl::handle_task(const tsbe::TaskInterface &task_iface) //block_ptr->forecast(100 + //TODO set deactive when work returns DONE + //TODO source blocks should call work again until exhausted output buffers - - //trim the input tags that are past the consumption zone + //------------------------------------------------------------------ + //-- trim the input tags that are past the consumption zone + //-- and post trimmed tags to the downstream based on policy + //------------------------------------------------------------------ for (size_t i = 0; i < num_inputs; i++) { std::vector<Tag> &tags_i = this->input_tags[i]; @@ -95,7 +112,9 @@ void ElementImpl::handle_task(const tsbe::TaskInterface &task_iface) if (last != 0) tags_i.erase(tags_i.begin(), tags_i.begin()+last); } - //now commit all tags in the output queue to the downstream msg handler + //------------------------------------------------------------------ + //-- 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]) |