Program: bbtk
Module: $RCSfile: bbtkFactory.cxx,v $
Language: C++
- Date: $Date: 2010/09/12 14:52:25 $
- Version: $Revision: 1.50 $
+ Date: $Date: 2012/10/16 06:31:04 $
+ Version: $Revision: 1.53 $
=========================================================================*/
/* ---------------------------------------------------------------------
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);
+
bbtkMessage("debug",1,"Package name ["<<pkgname<<"]"<<std::endl);
bbtkMessage("debug",1,"Package path ["<<upath<<"]"<<std::endl);
PackageMapType::iterator iUnload;
iUnload = mPackageMap.find(pkgname);
+//EED Debuging message
+ std::cout << "EED Factory::LoadPackage " << std::endl;
+// PackageMapType::iterator it;
+// for ( it=mPackageMap.begin() ; it != mPackageMap.end(); it++ )
+// std::cout << (*it).first << " ";
+// std::cout << std::endl;
+
+
if (iUnload != mPackageMap.end())
{
bbtkMessage("output",2,"["<< pkgname <<"] already loaded" << std::endl);
// *all* the cases. JP
//==================================================
- //std::cout << "upath [" << upath << "]" << 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");
}