]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkBlackBox.cxx
Another ugly bug fixed in pipeline executing (bad transfer to parent in some cases...
[bbtk.git] / kernel / src / bbtkBlackBox.cxx
index 6d134c9ce3faae64d0c348add99e51c91ab78f3e..3b3955622d59b996fb88bcd0989b5b2923b99b4b 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/11/13 10:37:27 $
-  Version:   $Revision: 1.27 $
+  Date:      $Date: 2008/11/13 14:46:43 $
+  Version:   $Revision: 1.28 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -103,6 +103,7 @@ namespace bbtk
   BlackBox::BlackBox(const std::string &name) 
     : 
     bbmStatus(MODIFIED), 
+    bbmExecuting(false),
     bbmName(name),
     bbmBoxProcessMode("Pipeline"),
     bbmParent()
@@ -123,6 +124,7 @@ namespace bbtk
   BlackBox::BlackBox(BlackBox& from, const std::string &name) 
     :
       bbmStatus(from.bbmStatus), 
+      bbmExecuting(false),
       bbmName(name), 
       bbmBoxProcessMode(from.bbmBoxProcessMode),
       bbmParent()
@@ -155,9 +157,16 @@ namespace bbtk
   void BlackBox::bbExecute(bool force)
   {
     bbtkDebugMessageInc("process",2,
-                       "=> BlackBox::bbExecute() ["
+                       "=> BlackBox::bbExecute("<<(int)force<<") ["
                        <<bbGetFullName()<<"]"<<std::endl);
  
+    // If already executing : return
+    if (bbGetExecuting()) 
+      {
+       bbtkDebugMessage("process",2,
+                        " -> already executing : bailing out"<<std::endl);
+       return;
+      }
 
     // If execution frozen : return
     if (bbGlobalGetFreezeExecution())