From 4f03a5c6264ba3cd888454360f4c6819fa38023d Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 6 Jun 2013 11:55:53 -0700 Subject: gras: changes for actor in worker Apology commit --- lib/block.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/block.cpp') 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; -- cgit