Program: bbtk
Module: $RCSfile: bbtkBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/11/12 15:42:52 $
- Version: $Revision: 1.26 $
+ Date: $Date: 2008/11/13 10:37:27 $
+ Version: $Revision: 1.27 $
=========================================================================*/
/* ---------------------------------------------------------------------
}
//=========================================================================
+ static bool bbmgGlobalProcessingExecutionList = false;
//=========================================================================
void BlackBox::bbGlobalProcessExecutionList()
{
bbtkDebugMessageInc("process",3,
"=> BlackBox::bbGlobalProcessExecutionList()"
- <<std::endl);
-
- std::set<BlackBox::WeakPointer>::iterator i;
- for (i=bbmgExecutionList.begin();
- i!=bbmgExecutionList.end();
- ++i)
+ <<std::endl);
+ if (bbmgGlobalProcessingExecutionList)
{
- {
- if ((*i).lock())
- {
- bbtkDebugMessage("process",4,
- " -> Executing "<<
- (*i).lock()->bbGetFullName()<<std::endl);
- (*i).lock()->bbExecute(true);
- }
- else
- {
- bbtkGlobalError("Strange error in BlackBox::bbGlobalProcessExecutionList() : Weak bb pointer in bbmgExecutionList is no more valid...");
- }
- }
+ bbtkDebugMessage("process",3,"BlackBox::bbGlobalProcessExecutionList() reentered !");
+ return;
+ }
+ bbmgGlobalProcessingExecutionList = true;
+
+ std::set<BlackBox::WeakPointer>::iterator i;
+ while (bbmgExecutionList.size()>0)
+ {
+ i = bbmgExecutionList.begin();
+ BlackBox::WeakPointer p = *i;
+ bbmgExecutionList.erase(i);
+ if (p.lock())
+ {
+ bbtkDebugMessage("process",4,
+ " -> Executing "<<
+ p.lock()->bbGetFullName()<<std::endl);
+ p.lock()->bbExecute(true);
+ }
+ else
+ {
+ bbtkGlobalError("Strange error in BlackBox::bbGlobalProcessExecutionList() : Weak bb pointer in bbmgExecutionList is no more valid...");
+ }
}
bbmgExecutionList.clear();
"<= BlackBox::bbGlobalProcessExecutionList()"
<<std::endl);
+ bbmgGlobalProcessingExecutionList = false;
}
//=========================================================================
}
void BlackBox::bbGlobalAddToExecutionList( BlackBox::Pointer b )
- {
- bbmgExecutionList.insert(b);
- }
+ {
+ bbtkDebugMessage("process",3,"* bbGlobalAddToExecutionList("<<b->bbGetFullName()<<")"<<std::endl);
+ if (bbmgGlobalProcessingExecutionList)
+ {
+ bbtkDebugMessage("process",3,"bbGlobalAddToExecutionList called inside bbGlobalProcessExecutionList !");
+ }
+ bbmgExecutionList.insert(b);
+ }
//=========================================================================