]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkFactory.cxx
no message
[bbtk.git] / kernel / src / bbtkFactory.cxx
index cfd3c6ec531894a0a3dcda4aeab7b906be244ce8..3d4aef1d4d45ca196f30c85f81bcad68c16bd6d4 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkFactory.cxx,v $
   Language:  C++
-  Date:      $Date: 2010/09/12 14:59:29 $
-  Version:   $Revision: 1.51 $
+  Date:      $Date: 2012/05/30 17:17:00 $
+  Version:   $Revision: 1.52 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -115,6 +115,7 @@ namespace bbtk
        bbtkMessage("output",2,p->GetDescription()<<std::endl);
        //===================================================================
        p->AddFactory(GetThisPointer<Factory>());
+printf("EED Factory::DoLoadPackage > %s %s  %s \n",libname.c_str(), pkgname.c_str(),path.c_str());               
        mPackageMap[pkgname] = p;
        return true;
       }
@@ -140,6 +141,8 @@ namespace bbtk
   
   void Factory::LoadPackage( const std::string& name )
   {
+         
+         
   // Note : in the following :
   // name : the user supplied name
   //      - abreviated name    e.g.       pkg   pkg.so   libbpkg   libbbpkg.so
@@ -149,6 +152,8 @@ namespace bbtk
   //
   // lastname : string before the last / (if any), or user supplied name
          
+        
+         
        if(name != ""){
                bbtkDebugMessageInc("kernel",7,"Factory::LoadPackage(\""<<name<<"\")"<<std::endl);
                bbtkMessage("debug",1,"Factory::LoadPackage(\""<<name<<"\")"<<std::endl);
@@ -158,13 +163,26 @@ namespace bbtk
                std::string pkgname;  // e.g. libbb<pkgname>.so
 
                std::string upath;
+
+               
                pkgname = Utilities::ExtractPackageName(name,upath);
+               
+               printf("EED Factory::LoadPackage A. %s\n", name.c_str());
+               printf("EED Factory::LoadPackage A. %s\n", upath.c_str());
+               printf("EED Factory::LoadPackage A. %s\n", pkgname.c_str());
+               
                bbtkMessage("debug",1,"Package name ["<<pkgname<<"]"<<std::endl);
                bbtkMessage("debug",1,"Package path ["<<upath<<"]"<<std::endl);
 
                // no loading package if already loaded
                PackageMapType::iterator iUnload;
                iUnload = mPackageMap.find(pkgname);
+               
+               PackageMapType::iterator it;
+std::cout << "EED Factory::LoadPackage PackageMap ";
+               for ( it=mPackageMap.begin() ; it != mPackageMap.end(); it++ )
+                       std::cout << (*it).first << " ";
+               std::cout << std::endl;
 
                if (iUnload != mPackageMap.end())
                {
@@ -179,7 +197,8 @@ namespace bbtk
        // *all* the cases. JP
        //==================================================
 
-       //std::cout << "upath [" << upath << "]" << std::endl;
+               printf("\nEED Factory::LoadPackage B. %s\n\n", name.c_str());
+       //std::cout << "upath [" << name << "]" << std::endl;
 
                bool ok = false;
                bool foundFile = false;
@@ -499,6 +518,9 @@ namespace bbtk
                         p->GetName()<<"\")"<<std::endl);
 
     p->AddFactory(GetThisPointer<Factory>());
+         
+printf("EED Factory::InsertPackage %s\n", p->GetName().c_str() );        
+         
     mPackageMap[p->GetName()] = p;
 
     bbtkDebugDecTab("kernel",9);