From: jean-pierre roux Date: Wed, 25 Jun 2008 17:09:28 +0000 (+0000) Subject: Cosmetics X-Git-Tag: r0.6.1~14 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=3cb64980b8b0d54639f19b89b1a2c04a50a43e78;p=bbtk.git Cosmetics --- diff --git a/packages/std/bbs/appli/exampleAdd.bbs b/packages/std/bbs/appli/exampleAdd.bbs index 67a1b7b..d98b0aa 100644 --- a/packages/std/bbs/appli/exampleAdd.bbs +++ b/packages/std/bbs/appli/exampleAdd.bbs @@ -3,11 +3,17 @@ category "example" include std new Add a -set a.In1 1 -set a.In2 2 + set a.In1 1 + set a.In2 2 # In a print command, any string enclosed between dollars -# is interpreted as an output of a box (of the form 'box.output'). +# is interpreted as an output of a box (of the form 'boxName.outputName'). # Before printing, bbi substitutes it by the value of the output. # There must be an adaptor to string for that type of output. -print $a.Out$ + +print "The result is : $a.Out$" + +# Warning --> an implicit \n is postponed to the string + +print "That's all " +print "folks" diff --git a/packages/std/bbs/appli/exampleAscii.bbs b/packages/std/bbs/appli/exampleAscii.bbs index 4049bdd..f17bd94 100644 --- a/packages/std/bbs/appli/exampleAscii.bbs +++ b/packages/std/bbs/appli/exampleAscii.bbs @@ -1,8 +1,14 @@ +description "std::ASCII box example. Shows how to use it. " +category "example" + load std load wx +# new ASCII asciiA set asciiA.In "72 105 33" +// --> default is 0 +// set asciiB.type 0 new ASCII asciiB set asciiB.In "SOS" diff --git a/packages/std/bbs/appli/examplePrependDataPath.bbs b/packages/std/bbs/appli/examplePrependDataPath.bbs new file mode 100644 index 0000000..758ea42 --- /dev/null +++ b/packages/std/bbs/appli/examplePrependDataPath.bbs @@ -0,0 +1,10 @@ +description "std::PrependDataPath box example. Also shows how to invoke the default data path. " +category "example" + +include std + +#Use it as a 'normal' box, thought it's written as a bbs script +new PrependDataPath pdp + set pdp.In "MyDataFile" + +print "Full path name : $pdp.Out" diff --git a/packages/std/bbs/boxes/bbPrependDataPath.bbs b/packages/std/bbs/boxes/bbPrependDataPath.bbs index 0f6335e..9a4cdf2 100755 --- a/packages/std/bbs/boxes/bbPrependDataPath.bbs +++ b/packages/std/bbs/boxes/bbPrependDataPath.bbs @@ -1,9 +1,11 @@ load std +# --- Box Description --- define PrependDataPath std author "jpr@creatis.insa-lyon.fr" description "Prepends the input string file 'last name' with the default DataPath found in bbtk_config_xml" category "misc" +# --- --- # For getting default Data Path new Configuration c diff --git a/packages/std/bbs/boxes/bbPrependPackageDataPath.bbs b/packages/std/bbs/boxes/bbPrependPackageDataPath.bbs index cc26257..e231db1 100755 --- a/packages/std/bbs/boxes/bbPrependPackageDataPath.bbs +++ b/packages/std/bbs/boxes/bbPrependPackageDataPath.bbs @@ -1,9 +1,11 @@ load std +# --- Black Box Description --- define PrependPackageDataPath std author "laurent.guigues at creatis.insa-lyon.fr" description "Prepends the input file name 'In' with the path to the data directory of the package 'Package'" category "misc" +# --- --- # For getting bbtk Data Path new Configuration c @@ -13,11 +15,12 @@ define PrependPackageDataPath std new MakeFileName mfn2 connect c.DataPath mfn1.Directory - connect mfn1.Out mfn2.Directory + connect mfn1.Out mfn2.Directory - # inputs / outputs - input In mfn2.File "Last Filename" +# --- inputs / outputs --- + input In mfn2.File "Last Filename" input Package mfn1.File "Package name" - output Out mfn2.Out "Full path Filename" + output Out mfn2.Out "Full path Filename" +# --- --- endefine diff --git a/packages/std/src/bbstdASCII.cxx b/packages/std/src/bbstdASCII.cxx index c24da54..55be188 100644 --- a/packages/std/src/bbstdASCII.cxx +++ b/packages/std/src/bbstdASCII.cxx @@ -58,8 +58,7 @@ namespace bbstd } void ASCII::bbUserCopyConstructor() - { - + { } void ASCII::bbUserDestructor() diff --git a/packages/std/src/bbstdASCII.h b/packages/std/src/bbstdASCII.h index b246ae9..4ed0405 100644 --- a/packages/std/src/bbstdASCII.h +++ b/packages/std/src/bbstdASCII.h @@ -28,7 +28,7 @@ namespace bbstd BBTK_BEGIN_DESCRIBE_BLACK_BOX(ASCII,bbtk::AtomicBlackBox); BBTK_NAME("ASCII"); - BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr"); + BBTK_AUTHOR("eduardo.davila [at] creatis [dot] insa-lyon.fr"); BBTK_DESCRIPTION("ascii codes sequence to string - string to ascii codes sequence"); BBTK_CATEGORY("misc"); diff --git a/packages/std/src/bbstdCast.cxx b/packages/std/src/bbstdCast.cxx index a579cfd..59176d2 100644 --- a/packages/std/src/bbstdCast.cxx +++ b/packages/std/src/bbstdCast.cxx @@ -11,7 +11,6 @@ namespace bbstd //==================================================================== // Add the instanciated adaptors to the package - //typedef unsigned char uchar; BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,Cast,double,int8_t); BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,Cast,int8_t,double); diff --git a/packages/std/src/bbstdConcatStrings.cxx b/packages/std/src/bbstdConcatStrings.cxx index 098c95c..ee1cdfe 100644 --- a/packages/std/src/bbstdConcatStrings.cxx +++ b/packages/std/src/bbstdConcatStrings.cxx @@ -23,16 +23,16 @@ namespace bbstd void ConcatStrings::DoProcess() { - bbSetOutputOut( bbGetInputIn1() + - bbGetInputIn2() + - bbGetInputIn3() + - bbGetInputIn4() + - bbGetInputIn5() + - bbGetInputIn6() + - bbGetInputIn7() + - bbGetInputIn8() + - bbGetInputIn9() + - bbGetInputIn10() ); + bbSetOutputOut( bbGetInputIn1() + + bbGetInputIn2() + + bbGetInputIn3() + + bbGetInputIn4() + + bbGetInputIn5() + + bbGetInputIn6() + + bbGetInputIn7() + + bbGetInputIn8() + + bbGetInputIn9() + + bbGetInputIn10() ); } } // EO namespace bbstd diff --git a/packages/std/src/bbstdConfiguration.h b/packages/std/src/bbstdConfiguration.h index 9f3aced..35efb37 100644 --- a/packages/std/src/bbstdConfiguration.h +++ b/packages/std/src/bbstdConfiguration.h @@ -25,7 +25,7 @@ namespace bbstd BBTK_BEGIN_DESCRIBE_BLACK_BOX(Configuration,bbtk::AtomicBlackBox); BBTK_NAME("Configuration"); - BBTK_AUTHOR("jpr@creatis.insa-lyon.fr"); + BBTK_AUTHOR("jpr@creatis.insa-lyon [dot] fr"); BBTK_CATEGORY("misc"); BBTK_DESCRIPTION("Gets configuration informations"); BBTK_OUTPUT(Configuration,BinPath,"Binaries path",std::string,"directory name"); diff --git a/packages/std/src/bbstdDiv.xml b/packages/std/src/bbstdDiv.xml index 7a6ccfa..5a09058 100644 --- a/packages/std/src/bbstdDiv.xml +++ b/packages/std/src/bbstdDiv.xml @@ -6,8 +6,8 @@ Divides its inputs math - - + +
diff --git a/packages/std/src/bbstdExecBbiCommand.h b/packages/std/src/bbstdExecBbiCommand.h
index 8bf3f56..212cbba 100755
--- a/packages/std/src/bbstdExecBbiCommand.h
+++ b/packages/std/src/bbstdExecBbiCommand.h
@@ -8,17 +8,16 @@ namespace bbstd
 
   class ExecBbiCommand
     : 
-    public bbtk::AtomicBlackBox
+  public bbtk::AtomicBlackBox
   {
+  public:
     BBTK_BLACK_BOX_INTERFACE(ExecBbiCommand,bbtk::AtomicBlackBox);
     BBTK_DECLARE_INPUT(In,std::string);
-    //    BBTK_DECLARE_OUTPUT(Out,std::string);
     BBTK_PROCESS(DoProcess);
     void DoProcess();
-    
+
   protected:
     virtual void bbUserConstructor();
-    
   };
 
   BBTK_BEGIN_DESCRIBE_BLACK_BOX(ExecBbiCommand,bbtk::AtomicBlackBox);
@@ -26,9 +25,8 @@ namespace bbstd
   BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
   BBTK_DESCRIPTION("Executes bbi commands");
   BBTK_INPUT(ExecBbiCommand,In,"bbi commands separated by ';' , use '' to indicate strings ex. help 'graph' ",std::string,"");  
-  //  BBTK_OUTPUT(ExecBbiCommand,Out,"Concatenated string",std::string);
   BBTK_END_DESCRIBE_BLACK_BOX(ExecBbiCommand);
-  
+
 } // EO namespace bbstd
 
 #endif //  __bbstdExecBbiCommand_h_INCLUDED__
diff --git a/packages/std/src/bbstdGetVectorElement.cxx b/packages/std/src/bbstdGetVectorElement.cxx
index d7a1896..e78650e 100644
--- a/packages/std/src/bbstdGetVectorElement.cxx
+++ b/packages/std/src/bbstdGetVectorElement.cxx
@@ -18,6 +18,7 @@ BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorElement,int16_t);
 BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorElement,uint16_t);
 BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorElement,int32_t);
 BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorElement,uint32_t);
+///\todo : diff between uint32_t and long?
 BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorElement,long);
 BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorElement,float);
 BBTK_ADD_TEMPLATE_BLACK_BOX_TO_PACKAGE(std,GetVectorElement,double);
diff --git a/packages/std/src/bbstdMagicBox.cxx b/packages/std/src/bbstdMagicBox.cxx
index f11eb89..19e534b 100644
--- a/packages/std/src/bbstdMagicBox.cxx
+++ b/packages/std/src/bbstdMagicBox.cxx
@@ -8,5 +8,3 @@ namespace bbstd
   
 }
 // EO namespace bbstd
-
-
diff --git a/packages/std/src/bbstdMagicBox.h b/packages/std/src/bbstdMagicBox.h
index 55f0d7c..b336342 100644
--- a/packages/std/src/bbstdMagicBox.h
+++ b/packages/std/src/bbstdMagicBox.h
@@ -39,8 +39,9 @@ namespace bbstd
     
     /// Construction with the pointer on the Set method
     MagicBoxSetFunctor(SetMethodPointerType s) :
-      mSetMethodPointer(s) 
-    {}
+       mSetMethodPointer(s) 
+       {
+       }
     
     /// Concrete application of the Set method of object o
     void Set(bbtk::AtomicBlackBox* o, const bbtk::Data& d)
diff --git a/packages/std/src/bbstdMakeFileName.h b/packages/std/src/bbstdMakeFileName.h
index d9d6eab..d7129f9 100644
--- a/packages/std/src/bbstdMakeFileName.h
+++ b/packages/std/src/bbstdMakeFileName.h
@@ -10,10 +10,10 @@ namespace bbstd
   public bbtk::AtomicBlackBox
   {
     BBTK_BLACK_BOX_INTERFACE(MakeFileName,bbtk::AtomicBlackBox);
-    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();
 
@@ -28,8 +28,8 @@ namespace bbstd
   BBTK_CATEGORY("misc");
   BBTK_DESCRIPTION("Makes a kosher file name");
   BBTK_INPUT(MakeFileName,Directory,"Directory Name",std::string,"directory name");
-  BBTK_INPUT(MakeFileName,File,"File Name",std::string,"file name");
-  BBTK_INPUT(MakeFileName,Extent,"Extention",std::string,"file extension");
+  BBTK_INPUT(MakeFileName,File,     "File Name",     std::string,"file name");
+  BBTK_INPUT(MakeFileName,Extent,   "Extention",     std::string,"file extension");
   
   BBTK_OUTPUT(MakeFileName,Out,"Full File Name",std::string,"file name");
   BBTK_END_DESCRIBE_BLACK_BOX(MakeFileName);
diff --git a/packages/std/src/bbstdRelay.h b/packages/std/src/bbstdRelay.h
index c0ef92d..cc0334f 100644
--- a/packages/std/src/bbstdRelay.h
+++ b/packages/std/src/bbstdRelay.h
@@ -9,7 +9,7 @@ namespace bbstd
   template 
   class Relay
     :
-    public bbtk::AtomicBlackBox
+  public bbtk::AtomicBlackBox
   {
     BBTK_TEMPLATE_BLACK_BOX_INTERFACE(Relay,bbtk::AtomicBlackBox,T);
     BBTK_DECLARE_INPUT(In,T);
diff --git a/packages/std/src/bbstdStringToVector.cxx b/packages/std/src/bbstdStringToVector.cxx
index 0d1f506..b3ceb3e 100644
--- a/packages/std/src/bbstdStringToVector.cxx
+++ b/packages/std/src/bbstdStringToVector.cxx
@@ -9,9 +9,6 @@ namespace bbstd
 					 bbtk::AtomicBlackBox);
   //====================================================================
   
-  
-  
-  
   //====================================================================
   // Template specialization of decode_item
   template <> int8_t StringToVector ::decode_item(const std::string& s)
diff --git a/packages/std/src/bbstdVectorToString.cxx b/packages/std/src/bbstdVectorToString.cxx
index d6c164d..f95c8bc 100644
--- a/packages/std/src/bbstdVectorToString.cxx
+++ b/packages/std/src/bbstdVectorToString.cxx
@@ -8,62 +8,6 @@ namespace bbstd
   BBTK_BLACK_BOX_TEMPLATE_IMPLEMENTATION(VectorToString,
 					 bbtk::AtomicBlackBox);
   //====================================================================
-  
-  
-  
-  /*
-  //====================================================================
-  // Template specialization of encode_item
-  template <> int8_t VectorToString ::encode_item(const std::string& s)
-  {
-    return (int8_t)atoi ( s.c_str() );
-  }
-  
-  template <> uint8_t VectorToString ::encode_item(const std::string& s)
-  {
-    return (uint8_t)atoi ( s.c_str() );
-}
-
-template <> int16_t VectorToString ::encode_item(const std::string& s)
-{
-  return (int16_t)atoi ( s.c_str() );
-}
-
-template <> uint16_t VectorToString ::encode_item(const std::string& s)
-{
-  return (uint16_t)atoi ( s.c_str() );
-}
-
-template <> int32_t VectorToString ::encode_item(const std::string& s)
-{
-  return (int32_t)atoi ( s.c_str() );
-}
-
-template <> uint32_t VectorToString ::encode_item(const std::string& s) 
-{
-  return (uint32_t)atoi ( s.c_str() );
-}
-
-template <> long VectorToString ::encode_item(const std::string& s)
-{
-  return (long)atoi ( s.c_str() );
-}
-
-template <> float VectorToString ::encode_item(const std::string& s)
-{
-  return (float)atof ( s.c_str() );
-}
-
-template <> double VectorToString ::encode_item(const std::string& s)
-{
-  return atof ( s.c_str() );
-}
-
-template <> std::string VectorToString ::encode_item(const std::string& s)
-{
-  return s;
-}
-  */
 
 //====================================================================