Program: bbtk
Module: $RCSfile: bbtkBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/12/08 12:53:45 $
- Version: $Revision: 1.32 $
+ Date: $Date: 2008/12/09 11:48:31 $
+ Version: $Revision: 1.33 $
=========================================================================*/
/* ---------------------------------------------------------------------
void BlackBox::bbSetStatusAndPropagate(BlackBoxInputConnector* c,
IOStatus s)
{
+ bbtkDebugMessageInc("change",5,
+ "=> BlackBox::bbSetStatusAndPropagate(input,"
+ <<GetIOStatusString(s)<<") ["
+ <<bbGetFullName()<<"]"<<std::endl);
+
if (s==UPTODATE) bbtkError("bbSetStatusAndPropagate with status UPTODATE!");
c->SetStatus(s);
OutputConnectorMapType::const_iterator o;
(c==bbGetInputConnectorMap().find("BoxExecute")->second))
&& (bbCanReact() ) )
{
- bbtkDebugMessage("modified",2,
+ bbtkDebugMessage("change",2,
"-> Execution triggered by Reactive mode or BoxExecute input change"<<std::endl);
bbGlobalAddToExecutionList( GetThisPointer<BlackBox>() );
}
+ bbtkDebugMessageInc("change",5,
+ "<= BlackBox::bbSetStatusAndPropagate(input) ["
+ <<bbGetFullName()<<"]"<<std::endl);
}
//=========================================================================
//=========================================================================
void BlackBox::bbSignalOutputModification(bool reaction)
{
- bbtkDebugMessageInc("process",5,
+ bbtkDebugMessageInc("change",5,
"=> BlackBox::bbSignalOutputModification("
<<reaction<<") ["
<<bbGetFullName()<<"]"<<std::endl);
if (reaction) bbGlobalProcessExecutionList();
- bbtkDebugMessageDec("process",5,
+ bbtkDebugMessageDec("change",5,
"<= BlackBox::bbSignalOutputModification() ["
<<bbGetFullName()<<"]"<<std::endl);
void BlackBox::bbSignalOutputModification(const std::string& output,
bool reaction)
{
- bbtkDebugMessageInc("process",5,
+ bbtkDebugMessageInc("change",5,
"=> BlackBox::bbSignalOutputModification("
<<output<<","<<reaction<<") ["
<<bbGetFullName()<<"]"<<std::endl);
if (reaction) bbGlobalProcessExecutionList();
}
- bbtkDebugMessageDec("process",5,
+ bbtkDebugMessageDec("change",5,
"<= BlackBox::bbSignalOutputModification("
<<output<<") ["
<<bbGetFullName()<<"]"<<std::endl);
void BlackBox::bbSignalOutputModification(const std::vector<std::string>& output,
bool reaction)
{
- bbtkDebugMessageInc("process",5,
+ bbtkDebugMessageInc("change",5,
"=> BlackBox::bbSignalOutputModification(vector of outputs) ["
<<bbGetFullName()<<"]"<<std::endl);
OutputConnectorMapType::iterator i;
}
}
- bbtkDebugMessageDec("process",5,
+ bbtkDebugMessageDec("change",5,
"<= BlackBox::bbSignalOutputModification(vector of outputs) ["
<<bbGetFullName()<<"]"<<std::endl);
//if ( bbGetDescriptor()->GetInputDescriptor(i->first)->GetTypeInfo()
// == typeid(Void) )
// continue;
+ bbtkDebugMessageDec("change",2,
+ bbGetName()<<"."<<i->first
+ <<" ["<<i->second<<"] "
+ <<" status before update = '"
+ <<GetIOStatusString(i->second->GetStatus())
+ <<"'"<<std::endl);
i->second->BackwardUpdate();
IOStatus t = i->second->GetStatus();
if (t > s) s = t;
+ bbtkDebugMessageDec("change",2,
+ bbGetName()<<"."<<i->first
+ <<" ["<<i->second<<"] "
+ <<" status before process = '"
+ <<GetIOStatusString(i->second->GetStatus())
+ <<"'"<<std::endl);
}
bbtkDebugMessageDec("process",4,
/// Computes the final IOStatus of inputs and outputs after processing
void BlackBox::bbComputePostProcessStatus()
{
+ bbtkDebugMessageInc("process",4,
+ "=> BlackBox::bbComputePostProcessStatus() ["
+ <<bbGetFullName()<<"]"
+ <<std::endl);
+
IOStatus new_output_status = UPTODATE;
if (bbBoxProcessModeIsAlways()) new_output_status = OUTOFDATE;
if (t == OUTOFDATE) new_output_status = OUTOFDATE;
// A previously MODIFIED status turns to UPTODATE
if (t==MODIFIED) i->second->SetStatus(UPTODATE);
+ bbtkDebugMessage("change",2,
+ bbGetName()<<"."<<i->first<<" : "
+ << GetIOStatusString(t) << " -> "
+ << GetIOStatusString(i->second->GetStatus())
+ << std::endl);
}
-
+ bbtkDebugMessage("change",2,
+ bbGetName()<<" new output status : "
+ << GetIOStatusString(new_output_status)
+ <<std::endl);
// Update the output statuses
OutputConnectorMapType::iterator o;
for ( o = bbGetOutputConnectorMap().begin();
{
o->second->SetStatus(new_output_status);
}
+
+ bbtkDebugMessageInc("process",4,
+ "<= BlackBox::bbComputePostProcessStatus() ["
+ <<bbGetFullName()<<"]"
+ <<std::endl);
+
}
//==================================================================
Program: bbtk
Module: $RCSfile: bbtkBlackBoxInputConnector.cxx,v $
Language: C++
- Date: $Date: 2008/12/08 12:53:50 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2008/12/09 11:48:31 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
//========================================================================
void BlackBoxInputConnector::BackwardUpdate()
{
- bbtkDebugMessage("process",9,"==> BlackBoxInputConnector::BackwardUpdate()"
- <<std::endl);
// If UPTODATE or MODIFIED : nothing to do
// if (mStatus != OUTOFDATE) return;
// (either MODIFIED or OUTOFDATE)
if ( mConnection && (mStatus == OUTOFDATE) )
{
+ bbtkDebugMessage("process",9,
+ "==> BlackBoxInputConnector::BackwardUpdate() : "
+ <<"calling connection BackwardUpdate"
+ <<std::endl);
mConnection->BackwardUpdate();
}
+ else
+ {
+ bbtkDebugMessage("process",9,
+ "==> BlackBoxInputConnector::BackwardUpdate() : "
+ <<"input Up-to-date or Modified : nothing to do"
+ <<std::endl);
+
+ }
// If not connected : it was set to OUTOFDATE on creation
// Becomes MODIFIED
// LGTODO : Initialize to MODIFIED and set to OUTOFDATE on connection ?
Program: bbtk
Module: $RCSfile: bbtkConnection.cxx,v $
Language: C++
- Date: $Date: 2008/12/08 14:02:15 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2008/12/09 11:48:31 $
+ Version: $Revision: 1.18 $
=========================================================================*/
/* ---------------------------------------------------------------------
/// Backward Update
void Connection::BackwardUpdate()
{
- bbtkDebugMessage("process",5,
+ bbtkDebugMessage("process",3,
"===> Connection::BackwardUpdate() ["
<<GetFullName()<<"]"<<std::endl);
// Transfer status
IOStatus s = MODIFIED;
if ( mFrom->bbGetOutputConnector(mOutput).GetStatus() == OUTOFDATE)
- s = OUTOFDATE,
+ {
+ s = OUTOFDATE;
+ }
mTo->bbGetInputConnector(mInput).SetStatus(s);
-
- bbtkDebugMessage("process",5,
+
+ bbtkDebugMessage("process",3,
+ " --> '"<<mTo->bbGetName()<<"."<<mInput
+ <<" ["<<&mTo->bbGetInputConnector(mInput)<<"] "
+ <<"' new status '"
+ <<GetIOStatusString(s)
+ <<"'"
+ << std::endl);
+
+ bbtkDebugMessage("process",3,
"<=== Connection::BackwardUpdate() ["
<<GetFullName()<<"]"<<std::endl);
return; // s;
IOStatus status)
{
bbtkDebugMessage("change",2,
- "==> Connection::OnOutputChange("<<status<<") ["
+ "==> Connection::OnOutputChange("
+ <<GetIOStatusString(status)<<") ["
<<GetFullName()<<"]"<<std::endl);
if (mAdaptor)
{