]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkPackage.cxx
Changes under win32
[bbtk.git] / kernel / src / bbtkPackage.cxx
index 29cd1dc4463af4836125e11c4a50efb44bc0d60c..921682c743a9922525d81940f17aab36241d43e9 100644 (file)
@@ -1,20 +1,34 @@
-/*=========================================================================
-                                                                                
+
+/*=========================================================================                                                                               
   Program:   bbtk
   Module:    $RCSfile: bbtkPackage.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/06/10 19:19:42 $
-  Version:   $Revision: 1.20 $
-                                                                                
-  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('"<<name<<"',...)"
                     <<bbtkendl);
     Package::Pointer p = MakePointer(new Package(name,
                                               author,
                                               description,
-                                              version,
-                                              BBTKVersion));
+                                              version));
     bbtkDebugMessage("object",2,"<## Package::New('"<<name<<"',...)"
                     <<bbtkendl);
     return p;
@@ -57,8 +69,7 @@ namespace bbtk
   Package::Package(const std::string& name,
                   const std::string& author,
                   const std::string& description,
-                  const std::string& version,
-                  const std::string& BBTKVersion) 
+                  const std::string& version) 
     :
     mDynamicLibraryHandler(0),
     mName(name),
@@ -234,8 +245,11 @@ namespace bbtk
        
       }
     
+#ifdef BBTK_COMPILE_DEBUG_MESSAGES
+
     bbtkDebugMessage("package",2,"<== Package::Release('"<<
                     packname<<"')"<<bbtkendl);
+
     if (!pack.expired())
       {
        long dyn = pack.lock()->mDynamicLibraryHandler ? 1:0; 
@@ -252,6 +266,7 @@ namespace bbtk
        bbtkDebugMessage("package",1," ... Package has been released"
                         <<std::endl);
       }
+#endif
   }
   //==========================================================================
 
@@ -609,12 +624,17 @@ namespace bbtk
     bbtkDebugMessage("package",5,"==> Package::UnLoadReleasedDynamicallyLoadedPackages()"<<std::endl);
 
     std::set<Package::WeakPointer>::iterator i;
-    for (i=mReleasedDynamicallyLoadedPackages.begin();
-        i!=mReleasedDynamicallyLoadedPackages.end();
-        ++i)
-      {
-       if (!i->expired()) UnLoad(*i);
-      }
+
+//JCP- 21-04-09
+       if(mReleasedDynamicallyLoadedPackages.size()>0){
+               for (i=mReleasedDynamicallyLoadedPackages.begin();
+               i!=mReleasedDynamicallyLoadedPackages.end();
+               ++i)
+               {
+               if (!i->expired()) UnLoad(*i);
+               }
+       }
+//JCP- 21-04-09
     bbtkDebugMessage("package",5,"<== Package::UnLoadReleasedDynamicallyLoadedPackages()"<<std::endl);
   }
   //==========================================================================