]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkFactory.cxx
*** empty log message ***
[bbtk.git] / kernel / src / bbtkFactory.cxx
index 5e9c395b9ff66c5119043a2c7c6105a4e4427c08..6b4079344912f2c976bba2e3e209c044990f6d7e 100644 (file)
@@ -4,8 +4,8 @@ Program:   bbtk
 Module:    $RCSfile: bbtkFactory.cxx,v $
 Language:  C++
 
-Date:      $Date: 2008/03/07 08:40:14 $
-Version:   $Revision: 1.27 $
+Date:      $Date: 2008/03/11 12:27:21 $
+Version:   $Revision: 1.30 $
                                                                                 
 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
@@ -80,6 +80,14 @@ namespace bbtk
   //===================================================================
   void Factory::Reset()
   {
+    /*
+printf("EED kkkkkkkkkkkkkkkkkkkkkkkk  Factory::Reset() \n");
+printf("EED kkkkkkkkkkkkkkkkkkkkkkkk  Factory::Reset() \n");
+printf("EED kkkkkkkkkkkkkkkkkkkkkkkk  Factory::Reset() \n");
+printf("EED kkkkkkkkkkkkkkkkkkkkkkkk  Factory::Reset() \n");
+printf("EED kkkkkkkkkkkkkkkkkkkkkkkk  Factory::Reset() \n");
+printf("EED kkkkkkkkkkkkkkkkkkkkkkkk  Factory::Reset() \n");
+    */
     bbtkDebugMessageInc("Kernel",7,"Factory::Reset()"<<std::endl);
     CloseAllPackages();
     bbtkDebugDecTab("Kernel",7);
@@ -723,53 +731,7 @@ namespace bbtk
                       <<to->bbGetName()<<"\",\""<<input
                       <<"\")"<<std::endl);
     
-    return new Connection(from,output,to,input);
-    /*  
-       Connection* c;
-    // !!! WARNING : WE NEED TO TEST THE TYPE NAME EQUALITY 
-    // BECAUSE IN DIFFERENT DYN LIBS THE type_info EQUALITY CAN 
-    // BE FALSE (DIFFERENT INSTANCES !)
-  
-    std::string t1 ( from->bbGetOutputType(output).name() );
-    std::string t2 ( to->bbGetInputType(input).name() );
-
-
-    if ( t1 == t2 ) 
-       //from->bbGetOutputType(output) ==
-       // to->bbGetInputType(input) )
-      {
-         c = new Connection(from,output,to,input);
-      }
-    else 
-      {
-         //   std::cout << "Adaptive connection "<<std::endl;
-         std::string name;
-         name = from->bbGetName() + "." + output + "-" 
-                                  + to->bbGetName() + "." + input; 
-
-         BlackBox* b = 0; 
-         PackageMapType::const_iterator i;
-         for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
-         {
-             b = i->second.mPackage->NewAdaptor(from->bbGetOutputType(output),
-                                                  to->bbGetInputType(input),
-                                                  name);
-             if (b) break; 
-         } 
-         if (!b)  
-         {  
-            bbtkError("did not find any <"
-                       <<TypeName(from->bbGetOutputType(output))
-                       <<"> to <"
-                       <<TypeName(to->bbGetInputType(input))
-                       <<"> adaptor");
-         } 
-         c = new AdaptiveConnection(from,output,to,input,b);
-      }
-      bbtkDebugDecTab("Kernel",7);
-    
-      return c;
-    */
+    return new Connection(from,output,to,input,this);
   }
   //===================================================================