summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJosh Blum2013-05-05 16:57:57 -0700
committerJosh Blum2013-05-05 16:57:57 -0700
commit1b84453cc51b07eb9106bcd6731a321ff1924d74 (patch)
treed3b045f4132061a4d6e2b4b4359210973eca40a3 /lib
parentfc196183ad8ac826fbc0b45f6570e68ef7fc669f (diff)
downloadsandhi-1b84453cc51b07eb9106bcd6731a321ff1924d74.tar.gz
sandhi-1b84453cc51b07eb9106bcd6731a321ff1924d74.tar.bz2
sandhi-1b84453cc51b07eb9106bcd6731a321ff1924d74.zip
gras: added post input buffer/message/tag api calls
This allows the user to post stuff to the input port from an external entity aka outside of the scheduler. resolves #86
Diffstat (limited to 'lib')
-rw-r--r--lib/block_message.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/block_message.cpp b/lib/block_message.cpp
index 43dc7b4..eae0c68 100644
--- a/lib/block_message.cpp
+++ b/lib/block_message.cpp
@@ -47,3 +47,28 @@ void Block::propagate_tags(const size_t i, const TagIter &iter)
}
}
}
+
+void Block::post_input_tag(const size_t which_input, const Tag &tag)
+{
+ InputTagMessage message(tag);
+ message.index = which_input;
+ Theron::Actor &actor = *((*this)->block);
+ actor.GetFramework().Send(message, Theron::Address::Null(), actor.GetAddress());
+}
+
+void Block::post_input_msg(const size_t which_input, const PMCC &msg)
+{
+ InputMsgMessage message(msg);
+ message.index = which_input;
+ Theron::Actor &actor = *((*this)->block);
+ actor.GetFramework().Send(message, Theron::Address::Null(), actor.GetAddress());
+}
+
+void Block::post_input_buffer(const size_t which_input, const SBuffer &buffer)
+{
+ InputBufferMessage message;
+ message.index = which_input;
+ message.buffer = buffer;
+ Theron::Actor &actor = *((*this)->block);
+ actor.GetFramework().Send(message, Theron::Address::Null(), actor.GetAddress());
+}