X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkFactory.cxx;h=5095c0e81b452368b4aca8f68f53464aa4cf40cc;hb=cbdd914a561bf6241a5b56d66873e090db933f8b;hp=9f1e96f91576a358d0317f6c6f3f2c0f6f154e36;hpb=76f2826fd6b67d3a15fe72c1b50d5ee1af1960a1;p=bbtk.git diff --git a/kernel/src/bbtkFactory.cxx b/kernel/src/bbtkFactory.cxx index 9f1e96f..5095c0e 100644 --- a/kernel/src/bbtkFactory.cxx +++ b/kernel/src/bbtkFactory.cxx @@ -4,8 +4,8 @@ Program: bbtk Module: $RCSfile: bbtkFactory.cxx,v $ Language: C++ -Date: $Date: 2008/02/14 11:38:58 $ -Version: $Revision: 1.19 $ +Date: $Date: 2008/02/14 13:44:25 $ +Version: $Revision: 1.21 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de @@ -100,154 +100,151 @@ namespace bbtk //=================================================================== -// =================================================================================== - + // =================================================================== bool Factory::DoLoadPackage(std::string libname, std::string pkgname, - std::string path, - bool verbose) + std::string path) { - + #if defined(__GNUC__) - - void *handler; - handler = dlopen(libname.c_str(), - BBTK_RTLD_TIME | BBTK_RTLD_SCOPE ); - if (!handler) - { - // The following is *NOT* a debug time message : - // It's a user intended message. - // Please don't remove it. - if (verbose) { - std::cout <<"[" <[" <[" <[" <[" <GetBBTKVersion() != bbtk::GetVersion() ) - { - std::string v(pack.mPackage->GetBBTKVersion()); - UnLoadPackage(pkgname); - bbtkError(" package build with bbtk version " - << v - << " whereas application build with version " - << bbtk::GetVersion()); - } - - std::string separator = - ConfigurationFile::GetInstance().Get_file_separator (); - //BBTK_STRINGIFY_SYMBOL(BBTK_DOC_REL_PATH) - std::string docreldoc = - separator + "bbdoc" + separator + pkgname + separator + "index.html"; - std::string reldoc = - ".." + separator + ".." + docreldoc; - std::string doc = path + separator + ".." + separator - + BBTK_STRINGIFY_SYMBOL(BBTK_DOC_REL_PATH) - + docreldoc; - - pack.mPackage->SetDocURL(doc); - pack.mPackage->SetDocRelativeURL(reldoc); - + if ( pack.mPackage->GetBBTKVersion() != bbtk::GetVersion() ) + { + std::string v(pack.mPackage->GetBBTKVersion()); + UnLoadPackage(pkgname); + bbtkError("Cannot load package ["<SetDocURL(doc); + pack.mPackage->SetDocRelativeURL(reldoc); + //=================================================================== - bbtkMessage("Output",2,pack.mPackage->GetName()<<" " - <GetVersion() - <<" (bbtk " - <GetBBTKVersion()<<") " - <GetAuthor() << " Category(s) :" - <GetCategory() - <GetDescription()<GetName()<<" " + <GetVersion() + <<" (bbtk " + <GetBBTKVersion()<<") " + <GetAuthor() << " Category(s) :" + <GetCategory() + <GetDescription()<GetPackage" and "DeletePackage". /// "GetPackage" is called to get the pointer on the bbtk::Package of the library /// ("DeletePackage" is not used, its presence is just checked before loading the package). - + /// now, filename is only the last name (no longer the full name!) /// it will be searched within *all* the paths given in bbtk_config.xml + - /// verbose = true (set by "config v") displays the loading process - + void Factory::LoadPackage( const std::string& name, - bool use_configuration_file, bool verbose) + bool use_configuration_file) { // Note : in the following : // name : the user supplied name @@ -322,8 +319,8 @@ namespace bbtk return; } - // std::string path = Utilities::ExpandLibName(upath, verbose); - std::string path = Utilities::ExpandLibName(name, verbose); // keep last item, here. + // std::string path = Utilities::ExpandLibName(upath, false); + std::string path = Utilities::ExpandLibName(name,false); // keep last item, here. if (path != "") { @@ -337,12 +334,12 @@ namespace bbtk // The following is *NOT* a debug time message : // It's a user intended message. // Please don't remove it. - if (verbose) - std::cout <<" [" <