]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkBlackBox.cxx
*** empty log message ***
[bbtk.git] / kernel / src / bbtkBlackBox.cxx
index 94610b0645b0cde78dedb497d4466e5d10522ff3..9a62efb37ca3b78c4c57837b31098169cc361366 100644 (file)
@@ -3,8 +3,8 @@
 Program:   bbtk
 Module:    $RCSfile: bbtkBlackBox.cxx,v $
 Language:  C++
-Date:      $Date: 2008/03/07 08:40:14 $
-Version:   $Revision: 1.6 $
+Date:      $Date: 2008/04/09 11:16:57 $
+Version:   $Revision: 1.9 $
                                                                                 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
 l'Image). All rights reserved. See doc/license.txt or
@@ -35,10 +35,20 @@ PURPOSE.  See the above copyright notices for more information.
 
 namespace bbtk
 {
+
+//EED
+  static bool bbmgSomeBoxExecuting = false;
+  static bool bbmgFreezeExecution = false;
+  static std::set<BlackBox*> bbmgExecutionList;
+
+
   //=========================================================================
   BlackBox::BlackBox(const std::string &name) 
-    : bbmName(name), bbmStatus(MODIFIED), 
-      bbmBoxProcessMode("Pipeline"),bbmParent(NULL)
+    : bbmName(name), 
+      bbmStatus(MODIFIED), 
+      bbmBoxProcessMode("Pipeline"),
+      bbmParent(NULL),
+      bbmExecuting(false)
   {
     bbtkDebugMessage("Kernel",7,"BlackBox::BlackBox(\""
                     <<name<<"\")"<<std::endl);
@@ -50,7 +60,9 @@ namespace bbtk
   BlackBox::BlackBox(BlackBox& from, const std::string &name) 
     : bbmName(name), 
       bbmStatus(from.bbmStatus), 
-      bbmBoxProcessMode(from.bbmBoxProcessMode),bbmParent(NULL)
+      bbmBoxProcessMode(from.bbmBoxProcessMode),
+      bbmParent(NULL),
+      bbmExecuting(false)
   {
     bbtkDebugMessage("Kernel",7,"BlackBox::BlackBox("
                     <<from.bbGetFullName()<<",\""
@@ -74,8 +86,9 @@ namespace bbtk
   /// Destruction method of a black box
   void BlackBox::bbDelete()
   {
-    bbtkDebugMessage("Kernel",5,"BlackBox::bbDelete() ["
+    bbtkDebugMessage("Kernel",1,"BlackBox::bbDelete() ["
                     <<bbGetFullName()<<"]"<<std::endl);    
+    bbGetDescriptor()->UnReference();
     this->bbUserDelete();
   }
   //=========================================================================
@@ -88,7 +101,7 @@ namespace bbtk
     bbtkDebugMessageInc("Process",1,
                        "=> BlackBox::bbExecute() ["
                        <<bbGetFullName()<<"]"<<std::endl);
-
     Wx::BeginBusyCursor();
 
     // If execution frozen : return
@@ -1038,13 +1051,48 @@ namespace bbtk
    }
   //=========================================================================
 
+    bool BlackBox::bbGlobalGetSomeBoxExecuting()
+       { 
+               return bbmgSomeBoxExecuting; 
+       }
+
+    void BlackBox::bbGlobalSetSomeBoxExecuting(bool b) 
+       { 
+               bbmgSomeBoxExecuting = b; 
+       }
+
+    void BlackBox::bbGlobalSetFreezeExecution(bool b) 
+       { 
+               bbmgFreezeExecution = b;
+       }
+
+    bool BlackBox::bbGlobalGetFreezeExecution() 
+       { 
+               return bbmgFreezeExecution; 
+       }
+
+    void BlackBox::bbGlobalAddToExecutionList( BlackBox* b )
+       {  
+               bbmgExecutionList.insert(b); 
+       } 
+
+
   //=========================================================================
   // Static members initialization
+/*EED
   bool BlackBox::bbmgSomeBoxExecuting = false;
   bool BlackBox::bbmgFreezeExecution = false;
   std::set<BlackBox*> BlackBox::bbmgExecutionList;
+*/
    //=========================================================================
 
+  //=========================================================================
+  void BlackBox::Check(bool recursive)
+  {
+    bbtkMessage("Debug",1,"*** Checking Black Box "<<(void*)this<<" ["<<bbGetFullName()
+               <<"] ... OK"<<std::endl);
+  }
+  //=========================================================================
 
 }  // EO namespace bbtk