X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkFactory.cxx;h=aa3ee5c2fbc3073d45e7c036de6f89594ca99e43;hb=63005ec659612d567c00bfbb9ecbd62566a3217d;hp=48963f21558658cca8ec5c79aa42a29342a5e3dc;hpb=6ad84645e7e5971e3a7b166bd3099c06c343010f;p=bbtk.git diff --git a/kernel/src/bbtkFactory.cxx b/kernel/src/bbtkFactory.cxx index 48963f2..aa3ee5c 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/08 07:39:49 $ -Version: $Revision: 1.17 $ +Date: $Date: 2008/02/21 09:37:23 $ +Version: $Revision: 1.23 $ 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 <<" [" < - void Factory::HelpBlackBox(const std::string& name, bool full) const + /// Returns the package to which it belongs + void Factory::HelpBlackBox(const std::string& name, + std::string& package, + bool full) const { bbtkDebugMessageInc("Kernel",9,"Factory::HelpBlackBox(\""<second.mPackage->ContainsBlackBox(name)) { i->second.mPackage->HelpBlackBox(name,full); + package = i->second.mPackage->GetName(); found = true; } } @@ -822,6 +823,7 @@ namespace bbtk //=================================================================== void Factory::WriteDotFilePackagesList(FILE *ff) { + bbtkDebugMessageInc("Kernel",9,"Factory::WriteDotFilePackagesList()" <first<<"\">\n"; s << "

first<<"/index.html\">" << ii->first<<"\n"; + + s << "  -  \n"; + + s << "\n"; + s << "first << "/main.html>(Doxygen documentation of the source)\n"; } else {