X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkPackage.cxx;h=91cdb518372b220f124b1de33af8dc5c22c8912a;hb=12f2166f201f4e5a99c9c7876dadd09da81bfb51;hp=05d5d1f5fa3f9b5bb1e161648039e51c3185a1d9;hpb=664e5cdbbcaf3dafa5fc9f206a7094248c289d5a;p=bbtk.git diff --git a/kernel/src/bbtkPackage.cxx b/kernel/src/bbtkPackage.cxx index 05d5d1f..91cdb51 100644 --- a/kernel/src/bbtkPackage.cxx +++ b/kernel/src/bbtkPackage.cxx @@ -1,33 +1,40 @@ +/* + # --------------------------------------------------------------------- + # + # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image + # pour la SantÈ) + # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton + # Previous Authors : Laurent Guigues, Jean-Pierre Roux + # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil + # + # 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. + # ------------------------------------------------------------------------ */ + + /*========================================================================= Program: bbtk Module: $RCSfile: bbtkPackage.cxx,v $ Language: C++ - Date: $Date: 2009/06/08 14:50:04 $ - Version: $Revision: 1.30 $ + Date: $Date: 2012/11/16 08:49:01 $ + Version: $Revision: 1.37 $ =========================================================================*/ -/* --------------------------------------------------------------------- - -* 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 @@ -78,8 +85,10 @@ namespace bbtk mDescription(description), mVersion(version) { + bbtkDebugMessage("object",2,"==> Package('"<mDescriptorMap[*descname]; if ( (dyn==0) || (boost::dynamic_pointer_cast(desc)) ) + { PackageReleaseBlackBoxDescriptorInternal(pack,*descname); + } #else PackageReleaseBlackBoxDescriptorInternal(pack,*descname); #endif @@ -242,10 +253,7 @@ namespace bbtk UnLoadDynamicLibrary(pack); // Unload orphan dl packages Package::UnLoadReleasedDynamicallyLoadedPackages(); - - - } #ifdef BBTK_COMPILE_DEBUG_MESSAGES @@ -350,11 +358,8 @@ namespace bbtk /// to test that a dyn lib is a valid bbtk package lib /// NB : The BBTK version exported from the library /// is tested against the current bbtk version - DynamicLibraryHandler Package::OpenDynamicLibrary - ( const std::string& libname, - const std::string& package_name, - DLGetPackageFunction& getpack, - DLDeletePackageFunction& delpack) + DynamicLibraryHandler Package::OpenDynamicLibrary( const std::string& libname,const std::string& package_name, + DLGetPackageFunction& getpack, DLDeletePackageFunction& delpack) { bbtkDebugMessage("package",3,"==> Package::OpenDynamicLibrary(" <mDynamicLibraryHandler)) return; - - + std::string packname = pack.lock()->GetName(); bbtkDebugMessage("package",5,"==> Package::UnLoadDynamicLibrary('" <GetDescriptorMap().empty()) { - + bbtkDebugMessage("package",5," Package not empty ... abort" < package '"< with name BlackBox::Pointer Package::NewBlackBox(const std::string& type, @@ -1128,6 +1138,8 @@ namespace bbtk bbtkDebugMessageInc("kernel",9,"Package<"<::CreateHtmlPage(\"" <\n"; s << "\n"; } - +//std::cout<<"JCP bbtkPackage.cxx void Package::CreateHtmlPage() ln 1225"<\n"; DescriptorMapType::const_iterator i; - for (i=mDescriptorMap.begin(); i!=mDescriptorMap.end(); ++i) - { - if ( i->second->GetKind() != BlackBoxDescriptor::STANDARD) - continue; +//std::cout<<"JCP bbtkPackage.cxx void Package::CreateHtmlPage() ln 1236"<second->GetKind() != BlackBoxDescriptor::STANDARD) + continue; - std::string name = i->second->GetTypeName(); - Utilities::html_format(name); - std::string descr = i->second->GetDescription(); - //Utilities::html_format(descr); - - s << ""; - s << " "; - s << " "; - s << "\n"; - } - s << "
"; - s << "   " - <"; - s << "" << descr << "
\n"; - - - s << "\n"; - s << "\n"; - - //------------------- - // Adaptors list - if (mAdaptorMap.size()>0) - { - // s << "
\n"; - s << "

Adaptors : \n"; - s << "

    \n"; - - // DescriptorMapType::const_iterator i; - s << "

    \n"; - for (i=mDescriptorMap.begin(); i!=mDescriptorMap.end();++i) - { - if ( i->second->GetKind() == BlackBoxDescriptor::STANDARD) - continue; + std::string name = i->second->GetTypeName(); + Utilities::html_format(name); + std::string descr = i->second->GetDescription(); + //Utilities::html_format(descr); +//std::cout<<"JCP bbtkPackage.cxx void Package::CreateHtmlPage() ln 1246"<"; + s << " "; + s << " "; + s << "\n"; + } + s << "
    "; + s << "   " + <"; + s << "" << descr << "
    \n"; + + + s << "

\n"; + s << "
\n"; - std::string name = i->second->GetTypeName(); - Utilities::html_format(name); - std::string descr = i->second->GetDescription(); + //------------------- + // Adaptors list + if (mAdaptorMap.size()>0) + { + // s << "
\n"; + s << "

Adaptors : \n"; + s << "

    \n"; +//std::cout<<"JCP bbtkPackage.cxx void Package::CreateHtmlPage() ln 1268"<\n"; + for (i=mDescriptorMap.begin(); i!=mDescriptorMap.end();++i) + { + if ( i->second->GetKind() == BlackBoxDescriptor::STANDARD) + continue; - s << ""; - s << " "; - s << " "; - s << "\n"; - } - s << "
    "; - s << "   " - <"; - s << "" << descr << "
    \n"; - - s << "
\n"; - s << "
\n"; - } + std::string name = i->second->GetTypeName(); + Utilities::html_format(name); + std::string descr = i->second->GetDescription(); + + s << ""; + s << ""; + s << "   " + <"; + s << " "; + s << " " << descr << " "; + s << "\n"; + } + s << "\n"; + + s << "\n"; + s << "\n"; + } // s << "
\n"; @@ -1305,23 +1317,23 @@ namespace bbtk //------------------- // Computes output directory from filename to pass it to // BlackBoxDescriptor::InsertHtmlHelp - std::string dir; + std::string dir; - std::string::size_type slash_position = filename.find_last_of("/\\"); + std::string::size_type slash_position = filename.find_last_of("/\\"); - if (slash_position != std::string::npos) { - if (slash_position == 0) - slash_position = 1; - dir = filename.substr(0,slash_position); - } + if (slash_position != std::string::npos) { + if (slash_position == 0) + slash_position = 1; + dir = filename.substr(0,slash_position); + } - for (i=mDescriptorMap.begin(); - i!=mDescriptorMap.end(); - ++i) - { - i->second->InsertHtmlHelp(s,detail,level,dir,relative_link); - } + for (i=mDescriptorMap.begin(); + i!=mDescriptorMap.end(); + ++i) + { + i->second->InsertHtmlHelp(s,detail,level,dir,relative_link); + } //---------------------- // Footer @@ -1395,10 +1407,21 @@ namespace bbtk return s; } //========================================================================== - + void Package::GetBoxesInside(NodeTreeC& tree, int cont) + { + DescriptorMapType::const_iterator i; + std::cout<<"*********a********"<second->GetBoxesInside(tree, cont); + std::cout<<"*****************"< Package::mReleasedDynamicallyLoadedPackages; //========================================================================== + }