]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkBlackBox.cxx
Clean code
[bbtk.git] / kernel / src / bbtkBlackBox.cxx
index 6fb1fb83a9c749dfce3cc545269c3f0773ad71bf..ed57b5a6709cff088e79191c6d0fb6aee531a79d 100644 (file)
@@ -55,8 +55,8 @@
 
 namespace bbtk
 {
-  static bool bbmgSomeBoxExecuting = false;
-  static bool bbmgFreezeExecution = false;
+  static bool bbmgSomeBoxExecuting     = false;
+  static bool bbmgFreezeExecution      = false;
   static std::set<BlackBox::WeakPointer> bbmgExecutionList;
 
   //=========================================================================
@@ -93,14 +93,10 @@ namespace bbtk
        if (!pack.expired()) 
          {
            Package::ReleaseBlackBoxDescriptor(pack,desc);
-         }
-       else 
-         {
+         }     else {
            bbtkDebugMessage("object",2,"##> BlackBox::Deleter(\""<<name<<"\") : descriptor package expired (was not held by a package and the box was the last instance)"<<std::endl);
          }
-      }
-    else
-      {
+      } else {
        bbtkDebugMessage("object",2,"##> BlackBox::Deleter(\""<<name<<"\") : descriptor expired : nothing to do (was not held by a package or the box is a complex black box prototype)"<<std::endl);
       }
     bbtkDebugMessage("object",2,"<## BlackBox::Deleter(\""<<name<<"\")"<<std::endl);
@@ -187,13 +183,11 @@ namespace bbtk
   std::string BlackBox::bbGetNameWithParent() const
   {
     if (bbmParent.lock()) 
-      {
-       return bbmParent.lock()->bbGetNameWithParent() + ":" + bbmName;
-      }
-    else 
-      {
-       return bbmName;
-      }
+       {
+               return bbmParent.lock()->bbGetNameWithParent() + ":" + bbmName;
+       } else {
+               return bbmName;
+    }
   } 
   //=========================================================================
 
@@ -707,19 +701,18 @@ namespace bbtk
   //=========================================================================
   void BlackBox::bbRecursiveExecute( Connection::Pointer caller )
   {
-
     bbtkBlackBoxDebugMessage("process",3,
                        "=> BlackBox::bbRecursiveExecute("
                        <<(caller?caller->GetFullName():"0")<<")"
                        <<std::endl);
 
     // If already executing : return
-    if (bbGetExecuting()) 
-      {
-       bbtkBlackBoxDebugMessage("process",3,
+       if (bbGetExecuting()) 
+       {
+               bbtkBlackBoxDebugMessage("process",3,
                         " -> already executing : abort"<<std::endl);
-       return; 
-      }
+               return; 
+       }
     
     // If not initialized do it
     bbInitializeProcessing();
@@ -755,7 +748,9 @@ namespace bbtk
                           ( (bbBoxProcessModeIsManual()==true)&&(bbLetRecursiveExecuteManualMode==true) ) 
                         )
                        {
+ printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() );
                                this->bbProcess();              
+ printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() );
                    } // Manual analysis
                  
 //EED ups                      if ((bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==false))
@@ -766,9 +761,7 @@ namespace bbtk
                  
                  // Update the I/O statuses
                  bbComputePostProcessStatus();
-      }
-    else 
-      {
+      }  else  {
        // Test output status...
        OutputConnectorMapType::iterator o;
        for ( o = bbGetOutputConnectorMap().begin(); 
@@ -780,11 +773,11 @@ namespace bbtk
                            <<"all inputs are Up-to-date but output '"
                            <<o->first<<"' is Out-of-date ???");
              }
-         }
+         } // for
        
         bbtkBlackBoxDebugMessage("process",3," -> Up-to-date : nothing to do"
                         <<std::endl);
-      }
+      } // if
 
     // Shows the window if the black box has one
     this->bbShowWindow(); 
@@ -797,7 +790,6 @@ namespace bbtk
     bbSetExecuting(false);
     bbGlobalSetSomeBoxExecuting(wasExecuting);
 
-
     return;
   }
   //=========================================================================