summaryrefslogtreecommitdiff
path: root/lib/top_block.cpp
diff options
context:
space:
mode:
authorJosh Blum2012-09-29 09:33:54 -0700
committerJosh Blum2012-09-29 09:33:54 -0700
commitba9ed63e59c1fc92bc823d11d779fe162df0aca1 (patch)
tree99dba0d3a89965fd1884f09af315db82a3e034d1 /lib/top_block.cpp
parentc92b1c1b320cb05c858bd0dcf4850de6e666e171 (diff)
downloadsandhi-ba9ed63e59c1fc92bc823d11d779fe162df0aca1.tar.gz
sandhi-ba9ed63e59c1fc92bc823d11d779fe162df0aca1.tar.bz2
sandhi-ba9ed63e59c1fc92bc823d11d779fe162df0aca1.zip
ported allocator and block handler to apology
Diffstat (limited to 'lib/top_block.cpp')
-rw-r--r--lib/top_block.cpp30
1 files changed, 10 insertions, 20 deletions
diff --git a/lib/top_block.cpp b/lib/top_block.cpp
index a8f01de..b2c2e8d 100644
--- a/lib/top_block.cpp
+++ b/lib/top_block.cpp
@@ -40,9 +40,7 @@ TopBlock::TopBlock(const std::string &name):
void ElementImpl::top_block_cleanup(void)
{
- TopBlockMessage event;
- event.what = TopBlockMessage::INERT;
- this->executor->post_all(event);
+ this->executor->post_all(TopInertMessage());
if (ARMAGEDDON) std::cerr
<< "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"
<< "xx Top Block Destroyed: " << name << "\n"
@@ -57,10 +55,9 @@ void TopBlock::update(void)
void TopBlock::set_buffer_hint(const size_t hint)
{
- TopBlockMessage event;
- event.what = TopBlockMessage::HINT;
- event.hint = hint;
- (*this)->executor->post_all(event);
+ TopHintMessage message;
+ message.hint = hint;
+ (*this)->executor->post_all(message);
}
void TopBlock::start(void)
@@ -70,20 +67,15 @@ void TopBlock::start(void)
(*this)->executor->post_all((*this)->thread_group);
}
{
- TopBlockMessage event;
- event.what = TopBlockMessage::TOKEN_TIME;
- event.token = (*this)->token;
- (*this)->executor->post_all(event);
+ TopTokenMessage message;
+ message.token = (*this)->token;
+ (*this)->executor->post_all(message);
}
{
- TopBlockMessage event;
- event.what = TopBlockMessage::ALLOCATE;
- (*this)->executor->post_all(event);
+ (*this)->executor->post_all(TopAllocMessage());
}
{
- TopBlockMessage event;
- event.what = TopBlockMessage::ACTIVE;
- (*this)->executor->post_all(event);
+ (*this)->executor->post_all(TopActiveMessage());
}
}
@@ -93,9 +85,7 @@ void TopBlock::stop(void)
(*this)->thread_group->interrupt_all();
//message all blocks to mark done
- TopBlockMessage event;
- event.what = TopBlockMessage::INERT;
- (*this)->executor->post_all(event);
+ (*this)->executor->post_all(TopInertMessage());
}
void TopBlock::run(void)