]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Tue, 9 Dec 2008 13:45:11 +0000 (13:45 +0000)
committerguigues <guigues>
Tue, 9 Dec 2008 13:45:11 +0000 (13:45 +0000)
kernel/doc/bbtkDevelopersGuide/bbtkDevelopersGuide.tex
kernel/src/bbtkBlackBox.cxx
kernel/src/bbtkBlackBox.h
kernel/src/bbtkConfigurationFile.cxx

index 7d19f1223a48c6a60aa1feb5204a61bcba0c7865..2c97a8dfb813544659a234695021f4c55e7750f5 100644 (file)
 \section{Pipeline processing algorithm}
 % ==========================================
 
-Each input of a black box instance has a Status, 
+% ==========================================
+\subsection{Input and output status}
+% ==========================================
+Each input of a black box has a Status, 
 of type IOStatus (defined in bbtkConnection.h) 
 which can take one of the three values:
 \begin{itemize}
 \item UPTODATE (==0): The input did not change since last processing 
-\item MODIFIED (==1): [Initial value on construction] The input changed since last processing but is up-to-date with the amont box to which it is connected, if any.
-\item OUTOFDATE (==2): The input changed since last processing and is out-of-date with the amont box to which it is connected.
+\item MODIFIED (==1): [Initial value on construction] The input changed since last processing but is synchronized with the amont box output to which it is connected, if any. This status has only a NOTIFICATION purpose, to let the processing method of the box know which inputs have changed since last time. If it is connected, a MODIFIED input will not call the amont box update during pipeline execution.
+\item OUTOFDATE (==2): The input changed since last processing and is NOT synchronized with the amont box output to which it is connected. This means that the pipeline update must recurse to the amont box next time it is executed, in order to update the input value.
 \end{itemize}
 The status of an input is stored by the class BlackBoxInputConnector.
 
 Each output of a black box instance also has a Status, 
 of type IOStatus but which can only take the two values:
 \begin{itemize}
-\item UPTODATE (==0): The output is up-to-date (the box need not be reprocessed).
-\item OUTOFDATE (==2): [Initial value on construction] The output is out-of-date (the box need to be reprocessed).
+\item UPTODATE (==0): The output is up-to-date (the box does not need to be reprocessed).
+\item OUTOFDATE (==2): [Initial value on construction] The output is out-of-date (the box needs to be reprocessed).
 \end{itemize}
 The status of an output is stored by the class BlackBoxOutputConnector.
 
+If a box output 'O' is connected to another box input 'I' then there are some consistency constraints on their I/O statuses:
+\begin{itemize}
+\item If 'I' is UPTODATE then 'O' is necesseraly UPTODATE
+\item If 'I' is MODIFIED then 'O' is necesseraly UPTODATE
+\item If 'I' is OUTOFDATE then 'O' can be in any Status (The case 'O' is UPTODATE occurs for example when the amont box was created and executed - hence setting its outputs UPTODATE - *BEFORE* being connected to the aval box)
+\item If 'O' is UPTODATE then 'I' can be in any Status
+\item If 'O' is OUTOFDATE then 'I' is necessarly OUTOFDATE
+\end{itemize}
+
+The status of an input can be modified:
+\begin{itemize}
+\item By BlackBox::bbSetStatusAndPropagate which is called by:
+\begin{itemize}
+\item BlackBox::bbSetInput : it is set to MODIFIED
+\item BlackBox::bbSignalOutputModification 
+\item BlackBox::bbConnectInput which is called when a Connection is connected to the input : it is set to OUTOFDATE 
+\item Connection::OnOutputChange
+\end{itemize}
+\item By BlackBox::bbComputePostProcessStatus which is called after bbProcess in AtomicBlackBox::bbBackwardUpdate : if the input status is MODIFIED then it is changed to UPTODATE.
+\item By Connection::BackwardUpdate which is responsible for updating its amont box, transfering the output value to the input and updating the input status. If, after processing the amont box, the output status is UPTODATE then the new input status is MODIFIED, else if the output status is OUTOFDATE then the new input status is OUTOFDATE.
+\end{itemize}
+
+The status of an output is modifed in:
+\begin{itemize}
+\item By BlackBox::bbSetStatusAndPropagate, when propagating the new input status to the outputs. 
+\item By BlackBox::bbComputePostProcessStatus, which is called after bbProcess in AtomicBlackBox::bbBackwardUpdate. The new output status is :
+\begin{itemize}
+\item UPTODATE if all the box inputs are UPTODATE and the BoxProcessMode is *NOT* 'Always'
+\item OUTOFDATE in other cases
+\end{itemize}
+\end{itemize}
 
+% ==========================================
+\subsection{Pipeline execution}
+% ==========================================
 The main execution method of a black box is bbExecute.
 bbExecute checks werther the box is not already executing (bbGetExecuting()) 
 to prevent reentrance and 
@@ -117,7 +154,7 @@ void Connection::BackwardUpdate()
   // Updates the status of the final box input
   IOStatus s = MODIFIED;
   if ( mFrom->bbGetOutputConnector(mOutput).GetStatus() == OUTOFDATE) 
-    s = OUTOFDATE,
+    s = OUTOFDATE;
   mTo->bbGetInputConnector(mInput).SetStatus(s);
 }
 \end{verbatim}\hrule\bigskip
index 04d146c6ca2780483e5171b71430655adca552c7..1ff72d10bdb6f49542d099ca5faf82c2fe784240 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/12/09 12:54:02 $
-  Version:   $Revision: 1.34 $
+  Date:      $Date: 2008/12/09 13:45:13 $
+  Version:   $Revision: 1.35 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -583,7 +583,6 @@ namespace bbtk
     for ( o = bbGetOutputConnectorMap().begin(); 
          o != bbGetOutputConnectorMap().end(); ++o )                   
       {                                                                        
-       //      bbSetStatusAndPropagate(o->second, OUTOFDATE);
        if (o->second->GetStatus()==UPTODATE) 
          {
            o->second->SetStatus(OUTOFDATE);
@@ -605,81 +604,6 @@ namespace bbtk
   }
   //=========================================================================
 
-  //=========================================================================
-  void BlackBox::bbSetStatusAndPropagate(BlackBoxOutputConnector* c,
-                                        IOStatus s)
-  {
-    bbtkError("bbSetStatusAndPropagate(BlackBoxOutputConnector* c,IOStatus s)");
-    /*
-    if (i->GetStatus()==UPTODATE) 
-      {
-       i->second->SetStatus(s);
-       i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 
-      }
-    */
-  }
-  //=========================================================================
-
- ///  Signals that the BlackBox has been modified
-  /*
-  void BlackBox::bbSetModifiedStatus(BlackBoxInputConnector* c)
-  {
-    bbtkDebugMessage("modified",1,
-                    "==> BlackBox::bbSetModifiedStatus("<<c<<") ["
-                    <<bbGetFullName()<<"]"<<std::endl);
-    
-    if ( (c==bbGetInputConnectorMap().find("WinHide")->second) )
-      //        && (bbCanReact()))
-      {
-       bbtkDebugMessage("modified",2,
-                        "-> Hide triggered by WinHide input change"
-                        <<std::endl);
-       this->bbHideWindow();
-       this->bbSetStatus(MODIFIED); 
-       return;
-      }
-    if ( (c==bbGetInputConnectorMap().find("WinClose")->second) )
-      //        && (bbCanReact()))
-      {
-       bbtkDebugMessage("modified",2,
-                        "-> Close triggered by WinClose input change"
-                        <<std::endl);
-       this->bbHideWindow();
-       this->bbSetStatus(MODIFIED); 
-       return;
-      }
-    
-    if ( ( bbBoxProcessModeIsReactive()  ||
-          (c==bbGetInputConnectorMap().find("BoxExecute")->second))
-        && (bbCanReact() ) )
-      {
-       bbtkDebugMessage("modified",2,
-                        "-> Execution triggered by Reactive mode or BoxExecute input change"<<std::endl);
-       this->bbSetStatus(MODIFIED); 
-        bbGlobalAddToExecutionList( GetThisPointer<BlackBox>() );
-      }
-    
-    //else if ( bbGetStatus() == MODIFIED ) //! this->bbIsUptodate()) 
-     // { 
-//     bbtkDebugMessage("modified",2,"-> Already modified"<<std::endl);
-//     return;
- //     }
-   
-    else 
-      {
-       bbtkDebugMessage("modified",2,"-> Status set to modified"<<std::endl);
-       this->bbSetStatus(MODIFIED); 
-      }
-    this->bbSignalOutputModification(false);
-
-  bbtkDebugMessageDec("process",5,
-                       "<= BlackBox::bbSetModifiedStatus("<<c<<") ["
-                       <<bbGetFullName()<<"]"<<std::endl);
-  }  
-*/
-  //=========================================================================
 
   //=========================================================================  
   void BlackBox::bbSignalOutputModification(bool reaction)
@@ -695,7 +619,6 @@ namespace bbtk
       {
        if (i->second->GetStatus()==UPTODATE) 
          {
-           //      i->second->SetStatus(MODIFIED);
            i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 
          }
       } 
@@ -728,7 +651,6 @@ namespace bbtk
 
     if (i->second->GetStatus()==UPTODATE) 
       {
-       //      i->second->SetStatus(MODIFIED);
        i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 
        // Has to notify the output "BoxChange" also
        if (output != "BoxChange") 
@@ -736,7 +658,6 @@ namespace bbtk
            i = bbGetOutputConnectorMap().find("BoxChange");
            if ( i != bbGetOutputConnectorMap().end() ) 
              {
-               //              i->second->SetStatus(MODIFIED);
                i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 
              }
          }
@@ -773,7 +694,6 @@ namespace bbtk
        // Already OUTOFDATE : noting to do
        if (i->second->GetStatus()==UPTODATE)
          {
-           //  i->second->SetStatus(MODIFIED);
            i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 
            changed = true;
          }
@@ -785,7 +705,6 @@ namespace bbtk
        // Already OUTOFDATE : noting to do
        if (i->second->GetStatus()==UPTODATE) 
          {
-           //  i->second->SetStatus(MODIFIED);
            i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 
            if (reaction) bbGlobalProcessExecutionList();
          }
index 7989748e800eb08048a75083c5c3b380dca53381..93c51ef9d6f19a3f3ba9135774edacd007747174 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBox.h,v $
   Language:  C++
-  Date:      $Date: 2008/12/09 12:54:02 $
-  Version:   $Revision: 1.18 $
+  Date:      $Date: 2008/12/09 13:45:13 $
+  Version:   $Revision: 1.19 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -336,11 +336,6 @@ namespace bbtk
     /// ** NOT USER INTENDED **
     virtual void bbSetStatusAndPropagate(BlackBoxInputConnector* c,
                                         IOStatus s);
-    /// Signals that the output whose connector is c has changed 
-    /// and propagates the info downward
-    /// ** NOT USER INTENDED **
-    virtual void bbSetStatusAndPropagate(BlackBoxOutputConnector* c,
-                                        IOStatus s);
     //==================================================================
     
   private:
index d558b5c087bc24db436d38a4fce6818e249bccf0..c8e155c6c89777b27fbb712adfa7664c5e17f9e6 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkConfigurationFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/11/21 15:26:44 $
-  Version:   $Revision: 1.22 $
+  Date:      $Date: 2008/12/09 13:47:29 $
+  Version:   $Revision: 1.23 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -373,7 +373,7 @@ namespace bbtk
          {
                  *slash = 0;
          }
-printf("EED ConfigurationFile::GetExecutablePath  %s\n",name);
+         //printf("EED ConfigurationFile::GetExecutablePath  %s\n",name);
          return name;
   }