summaryrefslogtreecommitdiff
path: root/lib/block.cpp
diff options
context:
space:
mode:
authorJosh Blum2013-06-06 11:55:53 -0700
committerJosh Blum2013-06-06 11:55:53 -0700
commit4f03a5c6264ba3cd888454360f4c6819fa38023d (patch)
tree080e9d41148ac911b745009c869f9da7a0475c4d /lib/block.cpp
parent43c7ef3e7807ad3035a2882d237b0441e6102817 (diff)
downloadsandhi-4f03a5c6264ba3cd888454360f4c6819fa38023d.tar.gz
sandhi-4f03a5c6264ba3cd888454360f4c6819fa38023d.tar.bz2
sandhi-4f03a5c6264ba3cd888454360f4c6819fa38023d.zip
gras: changes for actor in worker Apology commit
Diffstat (limited to 'lib/block.cpp')
-rw-r--r--lib/block.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/block.cpp b/lib/block.cpp
index ac01f72..da29ebc 100644
--- a/lib/block.cpp
+++ b/lib/block.cpp
@@ -33,6 +33,9 @@ Block::Block(const std::string &name):
Element(name)
{
(*this)->block.reset(new BlockActor());
+ (*this)->worker.reset(new Apology::Worker());
+ (*this)->worker->set_actor((*this)->block.get());
+ (*this)->block->worker = (*this)->worker.get();
(*this)->block->prio_token = Token::make();
(*this)->thread_pool = (*this)->block->thread_pool; //ref copy of pool
(*this)->block->name = name; //for debug purposes
@@ -155,13 +158,13 @@ const OutputPortConfig &Block::output_config(const size_t which_output) const
void Block::commit_config(void)
{
Theron::Actor &actor = *((*this)->block);
- for (size_t i = 0; i < (*this)->block->get_num_inputs(); i++)
+ for (size_t i = 0; i < (*this)->worker->get_num_inputs(); i++)
{
InputUpdateMessage message;
message.index = i;
actor.GetFramework().Send(message, Theron::Address::Null(), actor.GetAddress());
}
- for (size_t i = 0; i < (*this)->block->get_num_outputs(); i++)
+ for (size_t i = 0; i < (*this)->worker->get_num_outputs(); i++)
{
OutputUpdateMessage message;
message.index = i;