summaryrefslogtreecommitdiff
path: root/lib/block.cpp
diff options
context:
space:
mode:
authorJosh Blum2012-11-30 23:33:57 -0800
committerJosh Blum2012-11-30 23:33:57 -0800
commitf4d7bf791d677cbff05c8ee12fe1d3b5a922373f (patch)
tree5d062b0c652d474b0e282689ee3a101eea649f1d /lib/block.cpp
parent0dea1563a4e13bd6081acc2ed5f4c611bdfbb9af (diff)
downloadsandhi-f4d7bf791d677cbff05c8ee12fe1d3b5a922373f.tar.gz
sandhi-f4d7bf791d677cbff05c8ee12fe1d3b5a922373f.tar.bz2
sandhi-f4d7bf791d677cbff05c8ee12fe1d3b5a922373f.zip
messing w/ pop_input_msg call
Diffstat (limited to 'lib/block.cpp')
-rw-r--r--lib/block.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/block.cpp b/lib/block.cpp
index 469a233..945b1e9 100644
--- a/lib/block.cpp
+++ b/lib/block.cpp
@@ -144,18 +144,27 @@ void Block::erase_input_tags(const size_t which_input)
(*this)->block->input_tags[which_input].clear();
}
+Tag Block::pop_input_msg(const size_t which_input)
+{
+ std::vector<Tag> &input_tags = (*this)->block->input_tags[which_input];
+ if (input_tags.empty()) return Tag();
+ Tag t = input_tags.front();
+ input_tags.erase(input_tags.begin());
+ return t;
+}
+
void Block::propagate_tags(const size_t i, const TagIter &iter)
{
const size_t num_outputs = (*this)->block->get_num_outputs();
for (size_t o = 0; o < num_outputs; o++)
+ {
+ BOOST_FOREACH(gras::Tag t, iter)
{
- BOOST_FOREACH(gras::Tag t, iter)
- {
- t.offset -= this->get_consumed(i);
- t.offset += this->get_produced(o);
- this->post_output_tag(o, t);
- }
+ t.offset -= this->get_consumed(i);
+ t.offset += this->get_produced(o);
+ this->post_output_tag(o, t);
}
+ }
}
bool Block::start(void)