From: jean-pierre roux Date: Tue, 5 Feb 2008 17:01:08 +0000 (+0000) Subject: Package descr X-Git-Tag: r0.6.1~270 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=001c522c9cd723fd522afda8a3882607c2565b85;p=bbtk.git Package descr --- diff --git a/packages/std/src/bbstdAdd.xml b/packages/std/src/bbstdAdd.xml index e865a8c..db3b9a1 100644 --- a/packages/std/src/bbstdAdd.xml +++ b/packages/std/src/bbstdAdd.xml @@ -4,6 +4,7 @@ laurent.guigues@creatis.insa-lyon.fr Adds its inputs + math bbtk::UserBlackBox std diff --git a/packages/std/src/bbstdConcatStrings.cxx b/packages/std/src/bbstdConcatStrings.cxx index 5ca9c5f..9993645 100644 --- a/packages/std/src/bbstdConcatStrings.cxx +++ b/packages/std/src/bbstdConcatStrings.cxx @@ -3,7 +3,6 @@ namespace bbstd { - BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ConcatStrings) BBTK_USER_BLACK_BOX_IMPLEMENTATION(ConcatStrings,bbtk::UserBlackBox); diff --git a/packages/std/src/bbstdConcatStrings.h b/packages/std/src/bbstdConcatStrings.h index 9c2ea9b..deb62cd 100644 --- a/packages/std/src/bbstdConcatStrings.h +++ b/packages/std/src/bbstdConcatStrings.h @@ -5,7 +5,6 @@ namespace bbstd { - class ConcatStrings : public bbtk::UserBlackBox @@ -27,12 +26,12 @@ namespace bbstd protected: virtual void bbUserConstructor(); - }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(ConcatStrings,bbtk::UserBlackBox); BBTK_NAME("ConcatStrings"); - BBTK_AUTHOR("jpr@creatis.insa-lyon.fr"); + BBTK_AUTHOR("jean-pierre.roux@creatis.insa-lyon.fr"); + BBTK_CATEGORY("misc"); BBTK_DESCRIPTION("String concatenation"); BBTK_INPUT(ConcatStrings,In1, "String 1", std::string); BBTK_INPUT(ConcatStrings,In2, "String 2", std::string); diff --git a/packages/std/src/bbstdConfiguration.cxx b/packages/std/src/bbstdConfiguration.cxx index 8fab8fe..89029b9 100644 --- a/packages/std/src/bbstdConfiguration.cxx +++ b/packages/std/src/bbstdConfiguration.cxx @@ -4,7 +4,6 @@ #include "bbtkConfigurationFile.h" namespace bbstd { - BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,Configuration) BBTK_USER_BLACK_BOX_IMPLEMENTATION(Configuration,bbtk::UserBlackBox); @@ -13,7 +12,6 @@ namespace bbstd } - void Configuration::DoProcess() { bbSetOutputDataPath( bbtk::ConfigurationFile::GetInstance().Get_data_path() ); @@ -30,5 +28,3 @@ namespace bbstd } } // EO namespace bbstd - - diff --git a/packages/std/src/bbstdConfiguration.h b/packages/std/src/bbstdConfiguration.h index 6d88344..f0b048d 100644 --- a/packages/std/src/bbstdConfiguration.h +++ b/packages/std/src/bbstdConfiguration.h @@ -5,7 +5,6 @@ namespace bbstd { - class Configuration : public bbtk::UserBlackBox @@ -25,15 +24,13 @@ namespace bbstd BBTK_BEGIN_DESCRIBE_BLACK_BOX(Configuration,bbtk::UserBlackBox); BBTK_NAME("Configuration"); BBTK_AUTHOR("jpr@creatis.insa-lyon.fr"); + BBTK_CATEGORY("misc"); BBTK_DESCRIPTION("Gets configuration informations"); BBTK_OUTPUT(Configuration,DataPath,"Sample Data Path",std::string); BBTK_OUTPUT(Configuration,FileSeparator,"/ or \\",std::string); BBTK_OUTPUT(Configuration,SystemType,"0=Linux 1=Windows",int); BBTK_END_DESCRIBE_BLACK_BOX(Configuration); - } // EO namespace bbstd #endif // __bbstdConfiguration_h_INCLUDED__ - - diff --git a/packages/std/src/bbstdMagicBox.h b/packages/std/src/bbstdMagicBox.h index 5c70c64..c4226c9 100644 --- a/packages/std/src/bbstdMagicBox.h +++ b/packages/std/src/bbstdMagicBox.h @@ -5,15 +5,14 @@ namespace bbstd { - //================================================================== - class /*BBTK_EXPORT*/ MagicBox + class MagicBox : public bbtk::UserBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(MagicBox,bbtk::UserBlackBox); - BBTK_DECLARE_INPUT(In,bbtk::Data); - BBTK_DECLARE_OUTPUT(Out,bbtk::Data); + BBTK_DECLARE_INPUT(In,bbtk::Data); + BBTK_DECLARE_OUTPUT(Out,bbtk::Data); BBTK_PROCESS(DoProcess); void DoProcess() { bbSetOutputOut( bbGetInputIn() ); } @@ -63,17 +62,17 @@ namespace bbstd //=========================================================================== - BBTK_BEGIN_DESCRIBE_BLACK_BOX(MagicBox,bbtk::UserBlackBox); BBTK_NAME("MagicBox"); BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); + BBTK_CATEGORY("adaptor"); BBTK_DESCRIPTION("MagicBox"); - AddInputDescriptor(new bbtk::UserBlackBoxInputDescriptor + AddInputDescriptor(new bbtk::UserBlackBoxInputDescriptor ("In","Input data", new bbtk::UserBlackBoxTGetFunctor (&MagicBox::bbGetInputIn), new MagicBoxSetFunctor (&MagicBox::bbSetInputIn) ) ); - AddOutputDescriptor(new bbtk::UserBlackBoxOutputDescriptor + AddOutputDescriptor(new bbtk::UserBlackBoxOutputDescriptor ("Out","Output data", new bbtk::UserBlackBoxTGetFunctor (&MagicBox::bbGetOutputOut), diff --git a/packages/std/src/bbstdMakeFileName.h b/packages/std/src/bbstdMakeFileName.h index 780ff1c..bf61184 100644 --- a/packages/std/src/bbstdMakeFileName.h +++ b/packages/std/src/bbstdMakeFileName.h @@ -10,10 +10,10 @@ namespace bbstd public bbtk::UserBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(MakeFileName,bbtk::UserBlackBox); - BBTK_DECLARE_INPUT(Directory,std::string); - BBTK_DECLARE_INPUT(File,std::string); - BBTK_DECLARE_INPUT(Extent,std::string); - BBTK_DECLARE_OUTPUT(Out,std::string); + BBTK_DECLARE_INPUT(Directory,std::string); + BBTK_DECLARE_INPUT(File,std::string); + BBTK_DECLARE_INPUT(Extent,std::string); + BBTK_DECLARE_OUTPUT(Out,std::string); BBTK_PROCESS(DoProcess); void DoProcess(); @@ -25,12 +25,13 @@ namespace bbstd BBTK_BEGIN_DESCRIBE_BLACK_BOX(MakeFileName,bbtk::UserBlackBox); BBTK_NAME("MakeFileName"); BBTK_AUTHOR("jpr@creatis.insa-lyon.fr"); + BBTK_CATEGORY("misc"); BBTK_DESCRIPTION("Makes a kosher file name"); - BBTK_INPUT(MakeFileName,Directory,"Directory Name",std::string); - BBTK_INPUT(MakeFileName,File,"File Name",std::string); - BBTK_INPUT(MakeFileName,Extent,"Extention",std::string); + BBTK_INPUT(MakeFileName,Directory,"Directory Name",std::string); + BBTK_INPUT(MakeFileName,File,"File Name",std::string); + BBTK_INPUT(MakeFileName,Extent,"Extention",std::string); - BBTK_OUTPUT(MakeFileName,Out,"Full File Name",std::string); + BBTK_OUTPUT(MakeFileName,Out,"Full File Name",std::string); BBTK_END_DESCRIBE_BLACK_BOX(MakeFileName); } diff --git a/packages/std/src/bbstdRelay.h b/packages/std/src/bbstdRelay.h index b41c9f4..b44cb25 100644 --- a/packages/std/src/bbstdRelay.h +++ b/packages/std/src/bbstdRelay.h @@ -5,29 +5,27 @@ namespace bbstd { - template - class /*BBTK_EXPORT*/ Relay - : + class Relay + : public bbtk::UserBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(Relay,bbtk::UserBlackBox); - BBTK_DECLARE_INPUT(In,T); - BBTK_DECLARE_OUTPUT(Out,T); + BBTK_DECLARE_INPUT(In,T); + BBTK_DECLARE_OUTPUT(Out,T); BBTK_PROCESS(Process); protected: void Process() { bbSetOutputOut ( bbGetInputIn() ); } }; - BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(Relay); BBTK_NAME(bbtk::HumanTypeName()+"Relay"); BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); + BBTK_CATEGORY("misc"); BBTK_DESCRIPTION("Relays a "+bbtk::TypeName()); - BBTK_TEMPLATE_INPUT(Relay,In,"Input",T); - BBTK_TEMPLATE_OUTPUT(Relay,Out,"Output",T); + BBTK_TEMPLATE_INPUT(Relay,In,"Input",T); + BBTK_TEMPLATE_OUTPUT(Relay,Out,"Output",T); BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(Relay); - } // namespace bbstd diff --git a/packages/std/src/bbstdStringSelect.h b/packages/std/src/bbstdStringSelect.h index 18c5d21..fe3ebaf 100644 --- a/packages/std/src/bbstdStringSelect.h +++ b/packages/std/src/bbstdStringSelect.h @@ -5,24 +5,23 @@ namespace bbstd { - class /*BBTK_EXPORT*/ StringSelect : public bbtk::UserBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(StringSelect,bbtk::UserBlackBox); - BBTK_DECLARE_INPUT(In,int); - BBTK_DECLARE_INPUT(In0,std::string); - BBTK_DECLARE_INPUT(In1,std::string); - BBTK_DECLARE_INPUT(In2,std::string); - BBTK_DECLARE_INPUT(In3,std::string); - BBTK_DECLARE_INPUT(In4,std::string); - BBTK_DECLARE_INPUT(In5,std::string); - BBTK_DECLARE_INPUT(In6,std::string); - BBTK_DECLARE_INPUT(In7,std::string); - BBTK_DECLARE_INPUT(In8,std::string); - BBTK_DECLARE_INPUT(In9,std::string); - BBTK_DECLARE_OUTPUT(Out,std::string); + BBTK_DECLARE_INPUT(In,int); + BBTK_DECLARE_INPUT(In0,std::string); + BBTK_DECLARE_INPUT(In1,std::string); + BBTK_DECLARE_INPUT(In2,std::string); + BBTK_DECLARE_INPUT(In3,std::string); + BBTK_DECLARE_INPUT(In4,std::string); + BBTK_DECLARE_INPUT(In5,std::string); + BBTK_DECLARE_INPUT(In6,std::string); + BBTK_DECLARE_INPUT(In7,std::string); + BBTK_DECLARE_INPUT(In8,std::string); + BBTK_DECLARE_INPUT(In9,std::string); + BBTK_DECLARE_OUTPUT(Out,std::string); BBTK_PROCESS(DoProcess); void DoProcess(); @@ -34,21 +33,21 @@ namespace bbstd BBTK_BEGIN_DESCRIBE_BLACK_BOX(StringSelect,bbtk::UserBlackBox); BBTK_NAME("StringSelect"); BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr"); + BBTK_CATEGORY("misc"); BBTK_DESCRIPTION("String selection with 0-9 entries"); - BBTK_INPUT(StringSelect,In,"Index of the string to select",int); - BBTK_INPUT(StringSelect,In0,"String of index 0",std::string); - BBTK_INPUT(StringSelect,In1,"String of index 1",std::string); - BBTK_INPUT(StringSelect,In2,"String of index 2",std::string); - BBTK_INPUT(StringSelect,In3,"String of index 3",std::string); - BBTK_INPUT(StringSelect,In4,"String of index 4",std::string); - BBTK_INPUT(StringSelect,In5,"String of index 4",std::string); - BBTK_INPUT(StringSelect,In6,"String of index 6",std::string); - BBTK_INPUT(StringSelect,In7,"String of index 7",std::string); - BBTK_INPUT(StringSelect,In8,"String of index 8",std::string); - BBTK_INPUT(StringSelect,In9,"String of index 9",std::string); - BBTK_OUTPUT(StringSelect,Out,"Selected string",std::string); + BBTK_INPUT(StringSelect,In,"Index of the string to select",int); + BBTK_INPUT(StringSelect,In0,"String of index 0",std::string); + BBTK_INPUT(StringSelect,In1,"String of index 1",std::string); + BBTK_INPUT(StringSelect,In2,"String of index 2",std::string); + BBTK_INPUT(StringSelect,In3,"String of index 3",std::string); + BBTK_INPUT(StringSelect,In4,"String of index 4",std::string); + BBTK_INPUT(StringSelect,In5,"String of index 4",std::string); + BBTK_INPUT(StringSelect,In6,"String of index 6",std::string); + BBTK_INPUT(StringSelect,In7,"String of index 7",std::string); + BBTK_INPUT(StringSelect,In8,"String of index 8",std::string); + BBTK_INPUT(StringSelect,In9,"String of index 9",std::string); + BBTK_OUTPUT(StringSelect,Out,"Selected string",std::string); BBTK_END_DESCRIBE_BLACK_BOX(StringSelect); - } // EO namespace bbstd diff --git a/packages/std/src/bbstdStringTo.h b/packages/std/src/bbstdStringTo.h index 13ec026..748a439 100644 --- a/packages/std/src/bbstdStringTo.h +++ b/packages/std/src/bbstdStringTo.h @@ -3,43 +3,34 @@ #include "bbtkUserBlackBox.h" - namespace bbstd -{ - - +{ //================================================================= // UserBlackBox declaration template class StringTo : public bbtk::UserBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(StringTo,bbtk::UserBlackBox); - BBTK_DECLARE_INPUT(In,std::string); - BBTK_DECLARE_OUTPUT(Out,T); + BBTK_DECLARE_INPUT(In,std::string); + BBTK_DECLARE_OUTPUT(Out,T); BBTK_PROCESS(DoIt); void DoIt(); }; + //================================================================= - - - - //================================================================= // UserBlackBox description BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(StringTo); BBTK_NAME("StringTo"+bbtk::HumanTypeName()); BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); + BBTK_CATEGORY("adaptor"); BBTK_DEFAULT_ADAPTOR(); BBTK_DESCRIPTION("Converts the content of the input string to a "+bbtk::TypeName()); - BBTK_TEMPLATE_INPUT(StringTo, In,"Input",std::string); - BBTK_TEMPLATE_OUTPUT(StringTo, Out,"Output",T); + BBTK_TEMPLATE_INPUT(StringTo, In,"Input",std::string); + BBTK_TEMPLATE_OUTPUT(StringTo, Out,"Output",T); BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(StringTo); //================================================================= } // namespace bbstd #endif // __bbstdStringTo_h_INCLUDED__ - - - - diff --git a/packages/std/src/bbstdStringToVector.h b/packages/std/src/bbstdStringToVector.h index cd39769..bbb6de1 100644 --- a/packages/std/src/bbstdStringToVector.h +++ b/packages/std/src/bbstdStringToVector.h @@ -5,39 +5,35 @@ namespace bbstd { - //================================================================= // UserBlackBox declaration template class StringToVector : public bbtk::UserBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(StringToVector,bbtk::UserBlackBox); - BBTK_DECLARE_INPUT(In,std::string); - BBTK_DECLARE_OUTPUT(Out,std::vector); + BBTK_DECLARE_INPUT(In,std::string); + BBTK_DECLARE_OUTPUT(Out,std::vector); BBTK_PROCESS(DoIt); void DoIt(); T decode_item(const std::string&); }; -//================================================================= - - //================================================================= + // UserBlackBox description -BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(StringToVector); -BBTK_NAME("StringTo"+bbtk::TypeName >()); -BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); -BBTK_DEFAULT_ADAPTOR(); -BBTK_DESCRIPTION("Converts the content of the input string to a "+bbtk::TypeName >()); -BBTK_TEMPLATE_INPUT(StringToVector, In,"Input",std::string); -typedef std::vector Tvector; -BBTK_TEMPLATE_OUTPUT(StringToVector, Out,"Output",Tvector); -BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(StringToVector); -//================================================================= - - + BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(StringToVector); + BBTK_NAME("StringTo"+bbtk::TypeName >()); + BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); + BBTK_CATEGORY("adaptor"); + BBTK_DEFAULT_ADAPTOR(); + BBTK_DESCRIPTION("Converts the content of the input string to a "+bbtk::TypeName >()); + BBTK_TEMPLATE_INPUT(StringToVector, In,"Input",std::string); + typedef std::vector Tvector; + BBTK_TEMPLATE_OUTPUT(StringToVector, Out,"Output",Tvector); + BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(StringToVector); //================================================================= + template void StringToVector::DoIt() { @@ -71,4 +67,3 @@ void StringToVector::DoIt() } // namespace bbstd #endif //__bbstdStringToVector_INCLUDED_h__ - diff --git a/packages/std/src/bbstdToString.h b/packages/std/src/bbstdToString.h index 31c330d..8b887d2 100644 --- a/packages/std/src/bbstdToString.h +++ b/packages/std/src/bbstdToString.h @@ -4,33 +4,30 @@ #include "bbtkUserBlackBox.h" namespace bbstd -{ - +{ //================================================================= // UserBlackBox declaration template class ToString : public bbtk::UserBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(ToString,bbtk::UserBlackBox); - BBTK_DECLARE_INPUT(In,T); - BBTK_DECLARE_OUTPUT(Out,std::string); + BBTK_DECLARE_INPUT(In,T); + BBTK_DECLARE_OUTPUT(Out,std::string); BBTK_PROCESS(DoIt); void DoIt(); }; - //================================================================= - - - //================================================================= + // UserBlackBox description BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(ToString); BBTK_NAME(bbtk::TypeName()+"ToString"); BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); + BBTK_CATEGORY("adaptor"); BBTK_DEFAULT_ADAPTOR(); BBTK_DESCRIPTION("Converts a "+bbtk::TypeName()+" into a string"); - BBTK_TEMPLATE_INPUT(ToString, In,"Input",T); - BBTK_TEMPLATE_OUTPUT(ToString, Out,"Output",std::string); + BBTK_TEMPLATE_INPUT(ToString, In,"Input",T); + BBTK_TEMPLATE_OUTPUT(ToString, Out,"Output",std::string); BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(ToString); //================================================================= diff --git a/packages/std/src/bbstdVectorToString.h b/packages/std/src/bbstdVectorToString.h index 3c28ff1..f5fc510 100644 --- a/packages/std/src/bbstdVectorToString.h +++ b/packages/std/src/bbstdVectorToString.h @@ -5,58 +5,55 @@ namespace bbstd { - //================================================================= // UserBlackBox declaration template class VectorToString : public bbtk::UserBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(VectorToString,bbtk::UserBlackBox); - BBTK_DECLARE_INPUT(In,std::vector); - BBTK_DECLARE_INPUT(Separator,std::string); - BBTK_DECLARE_OUTPUT(Out,std::string); + BBTK_DECLARE_INPUT(In,std::vector); + BBTK_DECLARE_INPUT(Separator,std::string); + BBTK_DECLARE_OUTPUT(Out,std::string); BBTK_PROCESS(DoIt); void DoIt(); virtual void bbUserConstructor(); }; + //================================================================= - - - - //================================================================= + // UserBlackBox description BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(VectorToString); BBTK_NAME(bbtk::TypeName >()+"ToString"); BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr"); + BBTK_CATEGORY("adaptor"); BBTK_DEFAULT_ADAPTOR(); BBTK_DESCRIPTION("Converts the content of the input vector ("+bbtk::TypeName >()+") to a string in which each item is separated by the value of the input 'Separator'"); - typedef std::vector Tvector; - BBTK_TEMPLATE_INPUT(VectorToString, In,"Input",Tvector); - BBTK_TEMPLATE_INPUT(VectorToString, Separator,"Separator of item in the output string. Default is whitespace.",std::string); - BBTK_TEMPLATE_OUTPUT(VectorToString, Out,"Output",std::string); + typedef std::vector Tvector; + BBTK_TEMPLATE_INPUT(VectorToString, In,"Input",Tvector); + BBTK_TEMPLATE_INPUT(VectorToString, Separator,"Separator of item in the output string. Default is whitespace.",std::string); + BBTK_TEMPLATE_OUTPUT(VectorToString, Out,"Output",std::string); BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(VectorToString); - //================================================================= - - //================================================================= + template void VectorToString::DoIt() { std::string out; typename std::vector::const_iterator i; for (i=bbmInputIn.begin();i!=bbmInputIn.end();++i) - { - if (i!=bbmInputIn.begin()) out += bbGetInputSeparator(); - std::ostringstream s; - s << *i; - out += s.str(); - } + { + if (i!=bbmInputIn.begin()) + out += bbGetInputSeparator(); + std::ostringstream s; + s << *i; + out += s.str(); + } bbSetOutputOut(out); } - //================================================================= //================================================================= + template void VectorToString::bbUserConstructor() {