Program: bbtk
Module: $RCSfile: bbtkFactory.cxx,v $
Language: C++
- Date: $Date: 2010/09/12 14:52:25 $
- Version: $Revision: 1.50 $
+ Date: $Date: 2012/05/30 17:17:00 $
+ Version: $Revision: 1.52 $
=========================================================================*/
/* ---------------------------------------------------------------------
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;
}
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
//
// 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);
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())
{
// *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;
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);
}
else
{
- printf(" \n",name.c_str());
- printf(" ..BBTK ERROR.. package >>>%s<<< unknown\n",name.c_str());
- printf(" Your have to configure your bbtk_config.xml\n");
- printf(" to configure the correct path of the packages\n\n");
bbtkDebugDecTab("kernel",9);
bbtkError("package \""<<name<<"\" unknown");
}