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
: mTypeName("Unknown"),
mDescription(""),
mAuthor(""),
+ mKeyword(""),
mCategory(STANDARD),
mPackage(NULL)
{
//=========================================================================
//=========================================================================
- /// 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<<
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<<"\") ["
}
//=========================================================================
+ //=========================================================================
+ /// 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
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;
}
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;
}
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);
Program: bbtk
Module: $RCSfile: bbtkBlackBoxDescriptor.h,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
/// Returns the name of the **TYPE** of the black box
const std::string& GetTypeName() const { return mTypeName; }
+
/// Returns the description of the BlackBox
const std::string& GetDescription() const { return mDescription; }
+
/// Returns the author(s) of the BlackBox
const std::string& GetAuthor() const { return mAuthor; }
+
+ /// Returns the keyword(s) of the BlackBox
+ const std::string& GetKeyword() const { return mKeyword; }
+
/// Returns the Package to which the box belongs
Package* GetPackage() { return mPackage; }
+
/// Returns the Package to which the box belongs
const Package* GetPackage() const { return mPackage; }
+
/// Returns the category of box
Category GetCategory() const { return mCategory; }
-
/// Prints help on the black box
virtual void GetHelp(bool full=true) const;
/// Returns a const ref on the map of input descriptors
const InputDescriptorMapType& GetInputDescriptorMap() const
{ return mInput; }
+
/// Returns a const ref on the map of output descriptors
const OutputDescriptorMapType& GetOutputDescriptorMap() const
{ return mOutput; }
+
/// Returns a const pointer on the descriptor of the input of name <name>
const InputDescriptor* GetInputDescriptor(const std::string & name) const;
+
/// Returns a const pointer on the descriptor of the output of name <name>
const OutputDescriptor* GetOutputDescriptor(const std::string & name) const;
/// Sets the name of the **TYPE** of BlackBox
void SetTypeName( const std::string& name ) { mTypeName=name; }
- /// Adds the string to the BlackBox's description
+
+ /// Adds the string to the BlackBox description
void AddToDescription( const std::string&, bool clear = false );
- /// Adds the string to the BlackBox's author list
+
+ /// Adds the string to the BlackBox author list
void AddToAuthor( const std::string&, bool clear = false );
+
+ /// Adds the string to the BlackBox keyword list
+ void AddToKeyword( const std::string&, bool clear = false );
+
/// Sets the Package to which the box belongs
void SetPackage(Package *package) { mPackage = package; }
+
/// Sets the category of box
void SetCategory(Category category) { mCategory = category; }
std::string mDescription;
/// The author of the black box
std::string mAuthor;
+ /// The keyword of the black box
+ std::string mKeyword;
/// The category of box
Category mCategory;
/// The Package to which the box belongs
Program: bbtk
Module: $RCSfile: bbtkExecuter.cxx,v $ $
Language: C++
- Date: $Date: 2008/01/28 15:34:37 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/01/30 09:28:15 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
}
}
-
/**
*
*/
Current()->AddToAuthor(authorName,Current()==mRoot);
}
-
+ void Executer::Keyword(const std::string &keyword)
+ {
+ Current()->AddToKeyword(keyword,Current()==mRoot);
+ }
void Executer::Description(const std::string &d)
{
Program: bbtk
Module: $RCSfile: bbtkExecuter.h,v $ $
Language: C++
- Date: $Date: 2008/01/28 15:08:53 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/01/30 09:28:15 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// changes the workspace name
void SetWorkspaceName( const std::string& n );
- ///Adds the authorName to the Box's author list
+ ///Adds the authorName to the Box author list
void Author(const std::string &authorName);
+ ///Adds the categories to the Box keyword list
+ void Keyword(const std::string &keyword);
+
/// The description string which explains what does the ComplexBox
void Description(const std::string & d);
Module: $RCSfile: bbtkFactory.cxx,v $
Language: C++
-Date: $Date: 2008/01/29 14:01:31 $
-Version: $Revision: 1.6 $
+Date: $Date: 2008/01/30 09:28:15 $
+Version: $Revision: 1.7 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
bbtkError("Use absolute or relative path name! ["<<name<<"] is an illegal name");
return;
}
-
+
// std::string path = Utilities::ExpandLibName(upath, verbose);
- std::string path;
- if (name[1]!= ':') // Absolute name, under Windows
- path = Utilities::ExpandLibName(name, verbose); // keep last item, here.
-
+ std::string path = Utilities::ExpandLibName(name, verbose); // keep last item, here.
+
if (path != "")
{
std::string p2;
Program: bbtk
Module: $RCSfile: bbtkInterpreter.cxx,v $ $
Language: C++
- Date: $Date: 2008/01/29 14:34:43 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2008/01/30 09:28:15 $
+ Version: $Revision: 1.15 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
info.syntax = "author <string>";
info.help = "Adds the string <string> to the author information of the black box being defined";
mCommandDict[info.keyword] = info;
+
+ info.keyword = "keyword"; //JP
+ info.argmin = 1;
+ info.argmax = 1;
+ info.code = cKeyword;
+ info.syntax = "keyword <list of items, separated by ;>";
+ info.help = "Adds the string <string> to the keyword information of the black box being defined";
+ mCommandDict[info.keyword] = info;
info.keyword = "description";
info.argmin = 1;
case cAuthor :
mExecuter->Author(words[1]);
break;
-
+
+ case cKeyword :
+ mExecuter->Keyword(words[1]);
+ break;
+
case cDescription :
mExecuter->Description(words[1]);
break;
int nbFiles = Utilities::Explore(fullDirectoryName, false, Filenames);
// std::cout << "=================nbFiles " << nbFiles << std::endl;
int nbBssFiles = 0;
- for (std::vector<std::string>::iterator i = Filenames.begin(); i!=Filenames.end(); ++i)
+ for (std::vector<std::string>::iterator i = Filenames.begin(); i!= Filenames.end(); ++i)
{
if ((*i).substr((*i).size()-4, 4) != ".bbs")
continue; // ignore non .bbs files
// (not only a plain script name)
// we trust him, and try to expland the directory name
// WARNING : starting from current local directory : ./whatYouWant (./ mandatory!)
-
- // if (slash_position != std::string::npos)
+
if (name[0]=='/' || name[1] == ':' || name[0]=='.') // absolute path (linux/windows) or relative path
{
{
foundFile = true;
}
-
} // endif l != 0
}
else
Program: bbtk
Module: $RCSfile: bbtkInterpreter.h,v $ $
Language: C++
- Date: $Date: 2008/01/29 10:12:45 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2008/01/30 09:28:15 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
cSet,
cConfig, // JPR
cReset, // EED
- cAuthor,
+ cAuthor,
+ cKeyword, // JPR
cDescription,
cHelp,
cMessage,
Program: bbtk
Module: $RCSfile: bbtkPackage.h,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
~Package();
/// Returns the name of the package
const std::string& GetName() const { return mName; }
+
/// Returns the author of the package
const std::string& GetAuthor() const { return mAuthor; }
+
+ /// Returns the keyword of the package
+ const std::string& GetKeyword() const { return mKeyword; }
+
/// Returns the description of the package
const std::string& GetDescription() const { return mDescription; }
+
/// Returns the version of the package
const std::string& GetVersion() const { return mVersion; }
+
/// Returns the version of bbtk used to build the package
const std::string& GetBBTKVersion() const { return mBBTKVersion; }
-
+
bool ContainsBlackBox(const std::string& boxname) const;
-
- BlackBox* NewBlackBox(const std::string& type,
+
+ BlackBox* NewBlackBox(const std::string& type,
const std::string& name) const;
BlackBox* NewAdaptor(TypeInfo typein,
std::string mName;
/// The author of the package
std::string mAuthor;
+ /// The keywords of the package
+ std::string mKeyword;
/// The description of the package
std::string mDescription;
/// The version of the package
Program: bbtk
Module: $RCSfile: bbtkUserBlackBoxMacros.h,v $
Language: C++
- Date: $Date: 2008/01/22 15:41:34 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/01/30 09:28:16 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#define BBTK_AUTHOR(AUTHOR) AddToAuthor(AUTHOR)
//============================================================================
+//============================================================================
+/// Declares the keywords of a UserBlackBox (to be put inside the UBB description block)
+#define BBTK_KEYWORD(KEYWORD) AddToKeyword(KEYWORD)
+//============================================================================
+
//============================================================================
/// Declares the description of a UserBlackBox (to be put inside the UBB description block)
#define BBTK_DESCRIPTION(DESCR) AddToDescription(DESCR)
Program: bbtk
Module: $RCSfile: bbtkVirtualExec.h,v $ $
Language: C++
- Date: $Date: 2008/01/28 15:08:53 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2008/01/30 09:28:16 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// changes the workspace name
virtual void SetWorkspaceName( const std::string& n ) = 0;
- ///Adds the authorName to the Box's author list
+ ///Adds the authorName to the Box author list
virtual void Author(const std::string &authorName) = 0;
+ ///Adds the keywords to the Box keywords list
+ virtual void Keyword(const std::string &keywords) = 0;
+
/// The description string which explains what does the ComplexBox
- virtual void Description(const std::string & d) = 0;
+ virtual void Description(const std::string &d) = 0;
/// prints the list off the boxes of the current box
virtual void PrintBoxes() = 0;