bugfixes in overall coroutine handling to allow the overwriting of onTrigger.

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1721 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
adrian
2012-10-05 11:48:39 +00:00
parent 32de9e174e
commit 31aa3aa925
3 changed files with 22 additions and 5 deletions

View File

@ -24,6 +24,9 @@ CoroutineManager::~CoroutineManager() { }
void CoroutineManager::toggle(ExperimentFlow* flow)
{
assert((co_current() != m_simCoro || flow != SIM_FLOW) &&
"FATAL ERROR: We are already in the simulators coroutine flow! \
(Maybe you forgot to overwrite the (default) onTrigger() method?)");
m_togglerstack.push(co_current());
//std::cerr << "CORO toggle from " << m_togglerstack.top() << " to ";
if (flow == SIM_FLOW) {
@ -86,8 +89,7 @@ ExperimentFlow* CoroutineManager::getCurrent()
if (it->second == cr)
return it->first;
assert(false && "FATAL ERROR: The current flow could not be retrieved!");
return 0;
return NULL;
}
const ExperimentFlow* CoroutineManager::SIM_FLOW = NULL;