X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkPackage.cxx;h=921682c743a9922525d81940f17aab36241d43e9;hb=8dd53a72bc1dd1ca2c6e2763c0aeb51c77ee352e;hp=94286b37811f8f99a3cc8b17a8b1ddbd51c0636f;hpb=4ad5b5ee44357ad873bc8c43230defb6d0a79879;p=bbtk.git diff --git a/kernel/src/bbtkPackage.cxx b/kernel/src/bbtkPackage.cxx index 94286b3..921682c 100644 --- a/kernel/src/bbtkPackage.cxx +++ b/kernel/src/bbtkPackage.cxx @@ -1,20 +1,34 @@ -/*========================================================================= - + +/*========================================================================= Program: bbtk Module: $RCSfile: bbtkPackage.cxx,v $ Language: C++ - Date: $Date: 2008/04/18 12:59:15 $ - Version: $Revision: 1.13 $ - - Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de - l'Image). All rights reserved. See doc/license.txt or - http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - + Date: $Date: 2009/04/21 14:36:51 $ + Version: $Revision: 1.25 $ =========================================================================*/ + +/* --------------------------------------------------------------------- + +* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) +* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux +* +* This software is governed by the CeCILL-B license under French law and +* abiding by the rules of distribution of free software. You can use, +* modify and/ or redistribute the software under the terms of the CeCILL-B +* license as circulated by CEA, CNRS and INRIA at the following URL +* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +* or in the file LICENSE.txt. +* +* As a counterpart to the access to the source code and rights to copy, +* modify and redistribute granted by the license, users are provided only +* with a limited warranty and the software's author, the holder of the +* economic rights, and the successive licensors have only limited +* liability. +* +* The fact that you are presently reading this means that you have had +* knowledge of the CeCILL-B license and that you accept its terms. +* ------------------------------------------------------------------------ */ + /** *\file *\brief Class bbtk::Package : registers black boxes descriptors and is able to create instances of the black boxes registered. @@ -36,16 +50,14 @@ namespace bbtk Package::Pointer Package::New(const std::string& name, const std::string& author, const std::string& description, - const std::string& version, - const std::string& BBTKVersion) + const std::string& version) { bbtkDebugMessage("object",1,"##> Package::New('"<GetName(); + bbtkDebugMessage("package",5,"--- Releasing descriptor '" + <GetBlackBoxMap().find(descname); if (desc == pack.lock()->GetBlackBoxMap().end()) { - bbtkDebugMessage("package",3, + bbtkDebugMessage("package",5, " Descriptor has already been released" < '"<GetBlackBoxMap()[descname] = pdesc.lock(); @@ -166,7 +179,7 @@ namespace bbtk long ndesc = pack.lock()->GetBlackBoxMap().size(); long nrefs = pack.use_count(); - bbtkDebugMessage("package",2," "< No more external ref : checking descriptors" <mDynamicLibraryHandler ? 1:0; @@ -247,9 +263,10 @@ namespace bbtk } else { - bbtkDebugMessage("package",1," ... Package has been released" + bbtkDebugMessage("package",1," ... Package has been released" <mName; std::string dname = descr.lock()->GetTypeName(); bbtkDebugMessage("package",3,"==> Package::ReleaseBlackBoxDescriptor('"<< - packname<<"','"<SetDocURL(doc); p->SetDocRelativeURL(reldoc); - bbtkDebugMessage("package",1,"<== Package::CreateFromDynamicLibrary(" + bbtkDebugMessage("package",2,"<== Package::CreateFromDynamicLibrary(" <GetName(); - bbtkDebugMessage("package",3,"==> Package::UnLoadDynamicLibrary('" + bbtkDebugMessage("package",5,"==> Package::UnLoadDynamicLibrary('" <GetBlackBoxMap().empty()) { - bbtkDebugMessage("package",3," Package not empty ... abort" + bbtkDebugMessage("package",5," Package not empty ... abort" < dynamic library for package '" + < package '"< Package::UnLoadReleasedDynamicallyLoadedPackages()"< Package::UnLoadReleasedDynamicallyLoadedPackages()"<::iterator i; - for (i=mReleasedDynamicallyLoadedPackages.begin(); - i!=mReleasedDynamicallyLoadedPackages.end(); - ++i) - { - if (!i->expired()) UnLoad(*i); - } - bbtkDebugMessage("package",2,"<== Package::UnLoadReleasedDynamicallyLoadedPackages()"<0){ + for (i=mReleasedDynamicallyLoadedPackages.begin(); + i!=mReleasedDynamicallyLoadedPackages.end(); + ++i) + { + if (!i->expired()) UnLoad(*i); + } + } +//JCP- 21-04-09 + bbtkDebugMessage("package",5,"<== Package::UnLoadReleasedDynamicallyLoadedPackages()"<GetName(); - bbtkDebugMessage("package",2,"==> Package::UnLoad("< Package::UnLoad("< dynamic library for package '" + <GetKind() == BlackBoxDescriptor::DEFAULT_WIDGET_ADAPTOR) + else if ( d->GetKind() == BlackBoxDescriptor::DEFAULT_GUI) { bbtkDebugMessage("Kernel",8,"Package<"<::RegisterBlackBox(\""<GetTypeName()<<"\") : The box is a widget adaptor, inserting it in adaptors map ..."<second->Check(true); } - bbtkMessage("Debug",1,"****** Checking Package "<<(void*)this + bbtkMessage("debug",1,"****** Checking Package "<<(void*)this <<" ["<second->GetTypeName(); Utilities::html_format(name); std::string descr = i->second->GetDescription(); - Utilities::html_format(descr); + //Utilities::html_format(descr); s << ""; s << "";