Corrected an API design flaw with pausing. Contexts can now be flagged as paused, and IsRunnable() is moved from IBaseContext to IPluginFunction. While this allows for per-function pausing, it is not intended that way.
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40531
This commit is contained in:
@@ -304,6 +304,11 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
|
||||
{
|
||||
func = (*iter);
|
||||
|
||||
if (!func->IsRunnable())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (unsigned int i=0; i<num_params; i++)
|
||||
{
|
||||
param = &temp_info[i];
|
||||
@@ -633,21 +638,13 @@ bool CForward::RemoveFunction(IPluginFunction *func)
|
||||
{
|
||||
bool found = false;
|
||||
FuncIter iter;
|
||||
List<IPluginFunction *> *lst;
|
||||
|
||||
if (func->GetParentContext()->IsRunnable())
|
||||
{
|
||||
lst = &m_functions;
|
||||
} else {
|
||||
lst = &m_paused;
|
||||
}
|
||||
|
||||
for (iter=lst->begin(); iter!=lst->end(); iter++)
|
||||
for (iter=m_functions.begin(); iter!=m_functions.end(); iter++)
|
||||
{
|
||||
if ((*iter) == func)
|
||||
{
|
||||
found = true;
|
||||
lst->erase(iter);
|
||||
m_functions.erase(iter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -689,13 +686,7 @@ bool CForward::AddFunction(IPluginFunction *func)
|
||||
return false;
|
||||
}
|
||||
|
||||
//:IDEA: eventually we will tell the plugin we're using it [?]
|
||||
if (func->GetParentContext()->IsRunnable())
|
||||
{
|
||||
m_functions.push_back(func);
|
||||
} else {
|
||||
m_paused.push_back(func);
|
||||
}
|
||||
m_functions.push_back(func);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user