X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkBlackBoxDescriptor.cxx;h=e4318a7a3dd3d7259bef6bb5486509d2cc76a89e;hb=d8041d1ef54a73acc2306557435f6b04edf60daf;hp=6f5ab20e7c7cfa0c4d1571c3e120fa500de566fb;hpb=f5db17702a2c51a5933f6c556d070167e4db9cfd;p=bbtk.git diff --git a/kernel/src/bbtkBlackBoxDescriptor.cxx b/kernel/src/bbtkBlackBoxDescriptor.cxx index 6f5ab20..e4318a7 100644 --- a/kernel/src/bbtkBlackBoxDescriptor.cxx +++ b/kernel/src/bbtkBlackBoxDescriptor.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkBlackBoxDescriptor.cxx,v $ Language: C++ - Date: $Date: 2008/02/07 07:58:53 $ - Version: $Revision: 1.10 $ + Date: $Date: 2008/05/06 13:45:12 $ + Version: $Revision: 1.17 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -29,7 +29,11 @@ namespace bbtk { - + + typedef Package::Pointer PackagePointer; + + + //========================================================================= /// Default ctor BlackBoxDescriptor::BlackBoxDescriptor() @@ -38,20 +42,27 @@ namespace bbtk mAuthor(""), mCategory(""), mKind(STANDARD), - mPackage(NULL) + mPackage() { - bbtkDebugMessage("Kernel",9, - "BlackBoxDescriptor::BlackBoxDescriptor()"< BlackBoxDescriptor::BlackBoxDescriptor()"< BlackBoxDescriptor::~BlackBoxDescriptor() [" + <second; - bbtkDebugDecTab("Kernel",9); + bbtkDebugMessage("object",4, + "<== BlackBoxDescriptor::~BlackBoxDescriptor() [" + < BlackBoxDescriptor::Release('" + <GetTypeName()<<"')"< No more instance alive = releasing from package"<mPackage; + Package::ReleaseBlackBoxDescriptor(pack,desc); + } + else + { + bbtkMessage("object",2," --> Still some instances alive = Keeping it alive"<GetTypeName()<<"')"< Destructing BlackBoxDescriptor ["<GetName()<<"::"<"<"<"<second->GetName().size()>namelmax) namelmax = i->second->GetName().size(); if (i->second->GetHumanTypeName().size()>typelmax) typelmax = i->second->GetHumanTypeName().size(); + if (i->second->GetNature().size()>natlmax) + natlmax = i->second->GetNature().size(); } OutputDescriptorMapType::const_iterator o; for ( o = mOutput.begin(); o != mOutput.end(); ++o ) @@ -170,6 +232,8 @@ namespace bbtk namelmax = o->second->GetName().size(); if (o->second->GetHumanTypeName().size()>typelmax) typelmax = o->second->GetHumanTypeName().size(); + if (o->second->GetNature().size()>natlmax) + natlmax = o->second->GetNature().size(); } // for ( i = mInput.begin(); i != mInput.end(); ++i ) @@ -180,10 +244,14 @@ namespace bbtk std::string type(i->second->GetHumanTypeName()); type += ">"; type.append(1+typelmax-type.size(),' '); + std::string nature(i->second->GetNature()); + nature += "]"; + nature.append(1+natlmax-nature.size(),' '); bbtkMessage("Help",1, - " '"<second->GetDescription()<second->GetDescription()<second->GetHumanTypeName()); type += ">"; type.append(1+typelmax-type.size(),' '); + std::string nature(o->second->GetNature()); + nature += "]"; + nature.append(1+natlmax-nature.size(),' '); bbtkMessage("Help",1, " '"<second->GetDescription()<second->GetDescription()<GetName() + "::" + mTypeName; + return "::" + mTypeName; + } + //========================================================================= + //========================================================================= void BlackBoxDescriptor::InsertHtmlHelp ( std::ofstream& s, int detail, int level, const std::string& output_dir, bool relative_link ) { - bbtkDebugMessageInc("Kernel",9,"BlackBoxDescriptor::InsertHtmlHelp() ["< categories; + // Split the category string + std::string delimiters = ";,"; + Utilities::SplitString(GetCategory(), + delimiters,categories); + (s) << "

\n"; (s) << "\n"; (s) << "\n"; - (s) << "\n"; + (s) << "\n"; + (s) << "\n"; (s) << "
Description : " << descr << "
Author(s) : " << author << "
Category(s) : " - << category << "
Category(s) : "; + std::vector::iterator ci; + for (ci=categories.begin(); ci!=categories.end(); ++ci) + { + s << "" << *ci + << " \n"; + } + s << "
To use it : include " << GetPackage()->GetName() << "
\n"; @@ -301,7 +393,7 @@ namespace bbtk Utilities::html_format(type); std::string descr(in->second->GetDescription()); - //Utilities::html_format(descr); + Utilities::html_format(descr); std::string out = "second->GetDescription()); - //Utilities::html_format(descr); + Utilities::html_format(descr); std::string out = "