]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkBlackBoxDescriptor.cxx
First stage of 'Keyword'
[bbtk.git] / kernel / src / bbtkBlackBoxDescriptor.cxx
index 1fe23c82888e6b63b9d8283d3f473ea31fbcbc5a..050231eccab747e7a3b638cf2666e732d50bd51c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBoxDescriptor.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/01/22 15:02:00 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2008/01/30 09:28:15 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -34,6 +34,7 @@ namespace bbtk
     : mTypeName("Unknown"), 
       mDescription(""), 
       mAuthor(""),
+      mKeyword(""),
       mCategory(STANDARD),
       mPackage(NULL)
   {
@@ -61,7 +62,7 @@ namespace bbtk
   //=========================================================================
 
   //=========================================================================
-  /// Adds the string to the BlackBox's description
+  /// Adds the string to the BlackBox description
   void BlackBoxDescriptor::AddToDescription( const std::string& s, bool clear)
   {
     bbtkDebugMessage("Core",9,"BlackBoxDescriptor::AddToDescription(\""<<s<<
@@ -69,7 +70,10 @@ namespace bbtk
     if (clear) mDescription = s; 
     else mDescription += s;
    }
-  /// Adds the string to the BlackBox's author list
+  //=========================================================================
+
+  //=========================================================================   
+  /// Adds the string to the BlackBox author list
   void BlackBoxDescriptor::AddToAuthor( const std::string& s, bool clear)
   {
     bbtkDebugMessage("Core",9,"BlackBoxDescriptor::AddToAuthor(\""<<s<<"\") ["
@@ -79,6 +83,17 @@ namespace bbtk
   }
   //=========================================================================
 
+  //=========================================================================  
+  /// Adds the string to the BlackBox keyword list
+  void BlackBoxDescriptor::AddToKeyword( const std::string& s, bool clear)
+  {
+    bbtkDebugMessage("Core",9,"BlackBoxDescriptor::AddToKeyword(\""<<s<<"\") ["
+                    <<GetTypeName()<<"]"<<std::endl);  
+    if (clear) mKeyword = s;
+    else mKeyword += s;
+  }  
+  //=========================================================================
+
   //=========================================================================
   const BlackBoxDescriptor::InputDescriptor* 
   BlackBoxDescriptor::GetInputDescriptor(const std::string & name) const
@@ -89,9 +104,9 @@ namespace bbtk
     InputDescriptorMapType::const_iterator i;
     i = mInput.find(name);
     if ( i == mInput.end() ) 
-      {
-       bbtkError("input '"<<name<<"' does not exist");
-      }
+    {
+           bbtkError("input '"<<name<<"' does not exist");
+    }
     bbtkDebugDecTab("Core",9);
     return i->second;
   }
@@ -107,9 +122,9 @@ namespace bbtk
     OutputDescriptorMapType::const_iterator i;
     i = mOutput.find(name);
     if ( i == mOutput.end() ) 
-      {
-       bbtkError("output '"<<name<<"' does not exist");
-      }
+    {
+           bbtkError("output '"<<name<<"' does not exist");
+    }
     bbtkDebugDecTab("Core",9);
     return i->second;
   }
@@ -121,11 +136,11 @@ namespace bbtk
     bbtkDebugMessageInc("Core",9,"BlackBoxDescriptor::GetHelp() ["<<GetTypeName()<<"]"<<std::endl);
     if (GetPackage()) 
         {
-    bbtkMessage("Help",1,"Black Box <"<<
-               GetPackage()->GetName()<<"::"<<GetTypeName()<<">"<<std::endl);
-               }
-               else 
-               {
+       bbtkMessage("Help",1,"Black Box <"<<
+                    GetPackage()->GetName()<<"::"<<GetTypeName()<<">"<<std::endl);
+    }
+    else 
+    {
           bbtkMessage("Help",1,"Black Box <::"<<GetTypeName()<<">"<<std::endl);
        }
     bbtkMessage("Help",1," "<<GetDescription()<<std::endl);