]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkBlackBox.cxx
*** empty log message ***
[bbtk.git] / kernel / src / bbtkBlackBox.cxx
index 316f8cb8142a711f57eed716f3e2486b00a17b82..c74b2e9e1cf4a53a87ab398660813ffadc5d580a 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/05/28 14:22:09 $
-  Version:   $Revision: 1.47 $
+  Date:      $Date: 2009/06/08 14:50:02 $
+  Version:   $Revision: 1.48 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -169,7 +169,6 @@ namespace bbtk
 
 
   //=========================================================================
-  /// Returns the name with the name of the parent prepended if any
   std::string BlackBox::bbGetNameWithParent() const
   {
     if (bbmParent.lock()) 
@@ -184,7 +183,6 @@ namespace bbtk
   //=========================================================================
 
   //=========================================================================
-  /// Prints the Help on the BlackBox type 
   void BlackBox::bbGetHelp(bool full) const
   {
     bbGetDescriptor()->GetHelp(full); 
@@ -193,7 +191,6 @@ namespace bbtk
 
 
   //=========================================================================
-  /// Returns true if the UserBlackBox has an input of name name
   bool BlackBox::bbHasInput(const std::string& name) const
   {
     bbtkBlackBoxDebugMessage("kernel",8,
@@ -209,7 +206,6 @@ namespace bbtk
 
 
   //=========================================================================  
-  /// Returns true if the UserBlackBox has an output of name name
   bool BlackBox::bbHasOutput(const std::string& name) const
   {
     bbtkBlackBoxDebugMessage("kernel",8,"BlackBox::bbHasOutput(\""
@@ -224,7 +220,6 @@ namespace bbtk
 
 
   //=========================================================================  
-  ///  Gets the output type of a given name
   TypeInfo BlackBox::bbGetOutputType( const std::string &name ) const 
   {
     bbtkBlackBoxDebugMessage("kernel",8,
@@ -238,7 +233,6 @@ namespace bbtk
   //=========================================================================
 
   //=========================================================================
-  ///  Gets the input type of a given name
   TypeInfo BlackBox::bbGetInputType( const std::string &name ) const
   {
     bbtkBlackBoxDebugMessage("kernel",8,
@@ -253,7 +247,6 @@ namespace bbtk
 
 
   //=========================================================================
-  /// Allocates the i/o connectors of the black box
   void BlackBox::bbAllocateConnectors()
   {  
     bbtkBlackBoxDebugMessage("kernel",8,
@@ -286,7 +279,6 @@ namespace bbtk
 
 
   //=========================================================================
-  /// Desallocates the i/o connectors of the black box
   void BlackBox::bbDesallocateConnectors()
   {
     bbtkBlackBoxDebugMessage("kernel",8,
@@ -315,7 +307,6 @@ namespace bbtk
 
 
   //=========================================================================
-  /// Copies the input / output values from another box
   void BlackBox::bbCopyIOValues(BlackBox& from)
   {
     bbtkBlackBoxDebugMessage("kernel",1,
@@ -365,19 +356,6 @@ namespace bbtk
 
 
 
-  //=========================================================================
-  /// User overloadable destruction method of a black box
-  void BlackBox::bbUserDelete() 
-  {   
-    bbtkBlackBoxDebugMessage("process",5,
-                            "=> BlackBox::bbUserDelete()"
-                            <<" : not overloaded; using standard deletion"
-                            <<std::endl);
-    delete this;
-  }
-  //=========================================================================
-
-
   //=========================================================================
   BlackBox::BoxProcessModeValue BlackBox::bbGetBoxProcessModeValue() const
   {
@@ -440,117 +418,7 @@ namespace bbtk
   //=========================================================================
 
 
-  /*
-  //=========================================================================
-  ///  Sets the ChangeTime of input 
-  void BlackBox::bbSetInputChangeTime(BlackBoxInputConnector* c, 
-                                     const ChangeTime& t)
-  {
-    bbtkBlackBoxDebugMessage("change",1,
-                    "==> BlackBox::bbSetInputChangeTime("<<c<<","<<t<<") ["
-                    <<bbGetFullName()<<"]"<<std::endl);
-    
-    // If new time is greater than old one
-    if ( c->SetChangeTime(t) ) 
-      {
-       bool was_up_to_date = bbIsUpToDate();
-       // If new time is greater than the old max time of inputs
-       if ( mMaxInputChangeTime.Set(t) ) 
-         {
-           // If the box turned out-of-date
-           if ( was_up_to_date && bbIsOutOfDate() )
-             {
-               // 
-               if ( ( bbBoxProcessModeIsReactive()  ||
-                      (c==bbGetInputConnectorMap().find("BoxExecute")->second))
-                    && (bbCanReact() ) )
-                 {
-                   bbtkBlackBoxDebugMessage("change",2,
-                                    "an input of "
-                                    <<bbGetFullName()
-                                    <<" changed and box is in Reactive mode or BoxExecute input changed : adding it to the global execution list"
-                                    <<std::endl);
-                   bbGlobalAddToExecutionList( GetThisPointer<BlackBox>() );
-                 }
-               // Have to propagate the modification to aval boxes
-               OutputConnectorMapType::iterator i;
-               for (i = bbGetOutputConnectorMap().begin();
-                    i != bbGetOutputConnectorMap().end();
-                    ++i)
-                 {
-                   i->second->SetChangeTime(t);
-                 }
-               // update the MinOutputChangeTime
-               mMinOutputChangeTime.Set(t);
-             }
-         }
-      }
-  }
-  //=========================================================================
-
- //=========================================================================
-  ///  Sets the ChangeTime of output 
-  void BlackBox::bbSetOutputChangeTime(BlackBoxOutputConnector* c, 
-                                      const ChangeTime& t)
-  {
-    bbtkBlackBoxDebugMessage("change",1,
-                    "==> BlackBox::bbSetOutputChangeTime("<<c<<","<<t<<") ["
-                    <<bbGetFullName()<<"]"<<std::endl);
-    
-    //ChangeTime old = 
-    c->SetChangeTime(t);
-    // c->GetChangeTime() = t;
-    //    bbUpdateMinOutputChangeTime(t);
-    // propagate
-    
-  }
-  //=========================================================================
-  */
-
-  /*
-  //=========================================================================
-  void BlackBox::bbUpdateMaxInputChangeTime(const ChangeTime& t)
-  {    
-
-    
-    if ( t > mMaxInputChangeTime ) 
-      {
-       mMaxInputChangeTime = t;
-       if ( mMinOutputChangeTime > mMaxInputChangeTime )
-         {
-           
-         }
-      }
-    
-  }
-  //=========================================================================
-
-  //=========================================================================
-  void bbUpdateMinOutputChangeTime(const ChangeTime& t)
-  {
-    ChangeTime old = mMinOutputChangeTime;
-    mMinOutputChangeTime = MAXLONG;
-    OutputConnectorMapType::iterator i;
-    for (i = bbGetOutputConnectorMap.begin();
-        i != bbGetOutputConnectorMap.end();
-        ++i)
-      {
-       if (i->second->GetChangeTime() < mMinOutputChangeTime)
-         mMinOutputChangeTime = i->second->GetChangeTime();
-      }
-    if ( mMinOutputChangeTime < old )
-      {
-      }
-   
-  }
-  //=========================================================================
-  */
-
   //=========================================================================
-  /// Signals that the BlackBox has been modified through 
-  /// the input connector c
-  /// and propagates it downward
-  /// ** NOT USER INTENDED **
   void BlackBox::bbSetStatusAndPropagate(BlackBoxInputConnector* c,
                                         IOStatus s)
   {
@@ -785,7 +653,6 @@ namespace bbtk
 
   
   //=========================================================================
-  /// Main recursive processing method of the box.
   void BlackBox::bbRecursiveExecute( Connection::Pointer caller )
   {
     bbtkBlackBoxDebugMessage("process",3,
@@ -867,9 +734,6 @@ namespace bbtk
 
 
   //=========================================================================
-  /// Updates the BlackBox inputs
-  /// Calls RecursiveExecute on all BlackBoxInputConnector
-  /// \returns The maximum of final IOStatus after each input update
   IOStatus BlackBox::bbUpdateInputs()
   {
     bbtkBlackBoxDebugMessage("process",4,
@@ -912,8 +776,7 @@ namespace bbtk
   //=========================================================================
 
   //==================================================================
-  /// Computes the final IOStatus of inputs and outputs after processing
-  void BlackBox::bbComputePostProcessStatus()
+   void BlackBox::bbComputePostProcessStatus()
   {
     bbtkBlackBoxDebugMessage("process",4,
                        "=> BlackBox::bbComputePostProcessStatus()"
@@ -957,7 +820,6 @@ namespace bbtk
   //==================================================================
 
   //=========================================================================
-  /// Connects the input <name> to the connection c
   void BlackBox::bbConnectInput( const std::string& name, Connection* c)
   {
     bbtkBlackBoxDebugMessage("connection",2,
@@ -985,7 +847,6 @@ namespace bbtk
 
 
   //=========================================================================  
-  /// Connects the output <name> to the connection c
   void BlackBox::bbConnectOutput( const std::string& name, Connection* c)
   {
     bbtkBlackBoxDebugMessage("connection",2,
@@ -1010,8 +871,7 @@ namespace bbtk
 
 
   //=========================================================================
-  /// Disconnects the input <name> from the connection c
-  void BlackBox::bbDisconnectInput( const std::string& name, Connection* c)
+   void BlackBox::bbDisconnectInput( const std::string& name, Connection* c)
   {
 
     bbtkBlackBoxDebugMessage("connection",2,
@@ -1043,8 +903,7 @@ namespace bbtk
 
 
   //=========================================================================
-  /// Disconnects the output <name> from the connection c
-  void BlackBox::bbDisconnectOutput( const std::string& name, Connection* c)
+   void BlackBox::bbDisconnectOutput( const std::string& name, Connection* c)
   {
     bbtkBlackBoxDebugMessage("connection",2,
                     "==> BlackBox::bbDisconnectOutput(\""<<name
@@ -1072,8 +931,28 @@ namespace bbtk
   //=========================================================================
  
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
   //=========================================================================
-  /// Virtual
   void BlackBox::bbWriteDotInputOutputName(FILE *ff,bool inputoutput,int detail, int level)
   {
     fprintf(ff,"%s%p",bbGetTypeName().c_str(),this);
@@ -1330,7 +1209,7 @@ namespace bbtk
 
 
   //=========================================================================
-  void BlackBox::bbShowRelations(BlackBox::Pointer parentblackbox, 
+  void BlackBox::bbPrintHelp(BlackBox::Pointer parentblackbox, 
                                 int detail, int level
                                 /*,Factory *factory*/ )
   {
@@ -1470,6 +1349,23 @@ namespace bbtk
    }
   //=========================================================================
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
   static bool bbmgGlobalProcessingExecutionList = false;
 
   //=========================================================================