summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/block.cpp24
-rw-r--r--lib/block_consume.cpp4
-rw-r--r--lib/block_message.cpp6
-rw-r--r--lib/block_produce.cpp4
-rw-r--r--lib/block_props.cpp4
-rw-r--r--lib/element.cpp4
-rw-r--r--lib/element_impl.hpp2
-rw-r--r--lib/task_done.cpp2
-rw-r--r--lib/task_fail.cpp4
9 files changed, 27 insertions, 27 deletions
diff --git a/lib/block.cpp b/lib/block.cpp
index da29ebc..23b6f18 100644
--- a/lib/block.cpp
+++ b/lib/block.cpp
@@ -32,16 +32,16 @@ Block::Block(void)
Block::Block(const std::string &name):
Element(name)
{
- (*this)->block.reset(new BlockActor());
+ (*this)->block_actor.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
- (*this)->block->block_ptr = this;
- (*this)->block->data.reset(new BlockData());
- (*this)->block_data = (*this)->block->data;
+ (*this)->worker->set_actor((*this)->block_actor.get());
+ (*this)->block_actor->worker = (*this)->worker.get();
+ (*this)->block_actor->prio_token = Token::make();
+ (*this)->thread_pool = (*this)->block_actor->thread_pool; //ref copy of pool
+ (*this)->block_actor->name = name; //for debug purposes
+ (*this)->block_actor->block_ptr = this;
+ (*this)->block_actor->data.reset(new BlockData());
+ (*this)->block_data = (*this)->block_actor->data;
//setup some state variables
(*this)->block_data->block_state = BLOCK_STATE_INIT;
@@ -68,7 +68,7 @@ static void wait_block_cleanup(ElementImpl &self)
{
const boost::system_time start = boost::get_system_time();
block_cleanup_state_type state = BLOCK_CLEANUP_WAIT;
- while (self.block->GetNumQueuedMessages())
+ while (self.block_actor->GetNumQueuedMessages())
{
boost::this_thread::sleep(boost::posix_time::milliseconds(1));
switch (state)
@@ -108,7 +108,7 @@ void ElementImpl::block_cleanup(void)
wait_block_cleanup(*this);
//delete the actor
- this->block.reset();
+ this->block_actor.reset();
//unref actor's framework
this->thread_pool.reset(); //must be deleted after actor
@@ -157,7 +157,7 @@ const OutputPortConfig &Block::output_config(const size_t which_output) const
void Block::commit_config(void)
{
- Theron::Actor &actor = *((*this)->block);
+ Theron::Actor &actor = *((*this)->block_actor);
for (size_t i = 0; i < (*this)->worker->get_num_inputs(); i++)
{
InputUpdateMessage message;
diff --git a/lib/block_consume.cpp b/lib/block_consume.cpp
index 8665339..421b3bc 100644
--- a/lib/block_consume.cpp
+++ b/lib/block_consume.cpp
@@ -10,7 +10,7 @@ using namespace gras;
void Block::consume(const size_t which_input, const size_t num_items)
{
ASSERT(long(num_items) >= 0); //sign bit set? you dont want a negative
- (*this)->block->consume(which_input, num_items);
+ (*this)->block_actor->consume(which_input, num_items);
}
void Block::consume(const size_t num_items)
@@ -18,7 +18,7 @@ void Block::consume(const size_t num_items)
const size_t num_inputs = (*this)->worker->get_num_inputs();
for (size_t i = 0; i < num_inputs; i++)
{
- (*this)->block->consume(i, num_items);
+ (*this)->block_actor->consume(i, num_items);
}
}
diff --git a/lib/block_message.cpp b/lib/block_message.cpp
index a0ff2e8..08a3784 100644
--- a/lib/block_message.cpp
+++ b/lib/block_message.cpp
@@ -52,7 +52,7 @@ 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);
+ Theron::Actor &actor = *((*this)->block_actor);
actor.GetFramework().Send(message, Theron::Address::Null(), actor.GetAddress());
}
@@ -60,7 +60,7 @@ 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);
+ Theron::Actor &actor = *((*this)->block_actor);
actor.GetFramework().Send(message, Theron::Address::Null(), actor.GetAddress());
}
@@ -69,6 +69,6 @@ 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);
+ Theron::Actor &actor = *((*this)->block_actor);
actor.GetFramework().Send(message, Theron::Address::Null(), actor.GetAddress());
}
diff --git a/lib/block_produce.cpp b/lib/block_produce.cpp
index c47fec5..7133321 100644
--- a/lib/block_produce.cpp
+++ b/lib/block_produce.cpp
@@ -9,7 +9,7 @@ using namespace gras;
void Block::produce(const size_t which_output, const size_t num_items)
{
ASSERT(long(num_items) >= 0); //sign bit set? you dont want a negative
- (*this)->block->produce(which_output, num_items);
+ (*this)->block_actor->produce(which_output, num_items);
}
void Block::produce(const size_t num_items)
@@ -17,7 +17,7 @@ void Block::produce(const size_t num_items)
const size_t num_outputs = (*this)->worker->get_num_outputs();
for (size_t o = 0; o < num_outputs; o++)
{
- (*this)->block->produce(o, num_items);
+ (*this)->block_actor->produce(o, num_items);
}
}
diff --git a/lib/block_props.cpp b/lib/block_props.cpp
index cc42846..3fb381e 100644
--- a/lib/block_props.cpp
+++ b/lib/block_props.cpp
@@ -106,10 +106,10 @@ void Block::_register_setter(const std::string &key, void *pr)
void Block::_set_property(const std::string &key, const PMCC &value)
{
- (*this)->block->prop_access_dispatcher(key, value, true);
+ (*this)->block_actor->prop_access_dispatcher(key, value, true);
}
PMCC Block::_get_property(const std::string &key)
{
- return (*this)->block->prop_access_dispatcher(key, PMCC(), false);
+ return (*this)->block_actor->prop_access_dispatcher(key, PMCC(), false);
}
diff --git a/lib/element.cpp b/lib/element.cpp
index c06d96d..39c1f02 100644
--- a/lib/element.cpp
+++ b/lib/element.cpp
@@ -61,7 +61,7 @@ ElementImpl::~ElementImpl(void)
{
if (this->executor) this->top_block_cleanup();
if (this->topology) this->hier_block_cleanup();
- if (this->block) this->block_cleanup();
+ if (this->worker) this->block_cleanup();
}
void Element::set_container(WeakContainer *container)
@@ -138,5 +138,5 @@ Block *Element::locate_block(const std::string &path)
}
//return block ptr as result
- return elem->block->block_ptr;
+ return elem->block_actor->block_ptr;
}
diff --git a/lib/element_impl.hpp b/lib/element_impl.hpp
index ce274f3..6b1bee0 100644
--- a/lib/element_impl.hpp
+++ b/lib/element_impl.hpp
@@ -46,7 +46,7 @@ struct ElementImpl
boost::shared_ptr<Apology::Worker> worker;
boost::shared_ptr<Apology::Topology> topology;
boost::shared_ptr<Apology::Executor> executor;
- boost::shared_ptr<BlockActor> block;
+ boost::shared_ptr<BlockActor> block_actor;
boost::shared_ptr<BlockData> block_data;
ThreadPool thread_pool;
Apology::Base *get_elem(void) const
diff --git a/lib/task_done.cpp b/lib/task_done.cpp
index 2796ee7..3d4262d 100644
--- a/lib/task_done.cpp
+++ b/lib/task_done.cpp
@@ -7,7 +7,7 @@ using namespace gras;
void Block::mark_done(void)
{
- (*this)->block->mark_done();
+ (*this)->block_actor->mark_done();
}
void BlockActor::mark_done(void)
diff --git a/lib/task_fail.cpp b/lib/task_fail.cpp
index 1168698..415c13b 100644
--- a/lib/task_fail.cpp
+++ b/lib/task_fail.cpp
@@ -7,12 +7,12 @@ using namespace gras;
void Block::mark_output_fail(const size_t which_output)
{
- (*this)->block->output_fail(which_output);
+ (*this)->block_actor->output_fail(which_output);
}
void Block::mark_input_fail(const size_t which_input)
{
- (*this)->block->input_fail(which_input);
+ (*this)->block_actor->input_fail(which_input);
}
void BlockActor::input_fail(const size_t i)