]> Creatis software - bbtk.git/commitdiff
Cosmetics
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 25 Jun 2008 17:09:28 +0000 (17:09 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 25 Jun 2008 17:09:28 +0000 (17:09 +0000)
19 files changed:
packages/std/bbs/appli/exampleAdd.bbs
packages/std/bbs/appli/exampleAscii.bbs
packages/std/bbs/appli/examplePrependDataPath.bbs [new file with mode: 0644]
packages/std/bbs/boxes/bbPrependDataPath.bbs
packages/std/bbs/boxes/bbPrependPackageDataPath.bbs
packages/std/src/bbstdASCII.cxx
packages/std/src/bbstdASCII.h
packages/std/src/bbstdCast.cxx
packages/std/src/bbstdConcatStrings.cxx
packages/std/src/bbstdConfiguration.h
packages/std/src/bbstdDiv.xml
packages/std/src/bbstdExecBbiCommand.h
packages/std/src/bbstdGetVectorElement.cxx
packages/std/src/bbstdMagicBox.cxx
packages/std/src/bbstdMagicBox.h
packages/std/src/bbstdMakeFileName.h
packages/std/src/bbstdRelay.h
packages/std/src/bbstdStringToVector.cxx
packages/std/src/bbstdVectorToString.cxx

index 67a1b7b7911a53b20c0bbd8fb8061e740fdd4c3f..d98b0aa42c02e8d202868a99cbeea0925a859462 100644 (file)
@@ -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"
index 4049bdd02a2fe1c9e957fcce95838766a33bd02b..f17bd946effad27fe2f0c9a22f7812fdd309aa4d 100644 (file)
@@ -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 (file)
index 0000000..758ea42
--- /dev/null
@@ -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"
index 0f6335e1a0a90d500945e83beb7b59741f6ef44b..9a4cdf2dad437e231c239ceda68e75f3df21234a 100755 (executable)
@@ -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
index cc262572d651f8e37c55070675a35ab9adf08970..e231db1f39d5a809c953e696556385ff008d4eb8 100755 (executable)
@@ -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
 
index c24da54f26b8be29ef98e7bf766fd637e50eca74..55be1887d73b63bfdb3e7b962de6385524414fdf 100644 (file)
@@ -58,8 +58,7 @@ namespace bbstd
   }
   
   void ASCII::bbUserCopyConstructor()
-  {
-    
+  {    
   }
   
   void ASCII::bbUserDestructor()
index b246ae9e593ecf2982fd05f21cc24dc16861967b..4ed04052e49acb92a911e9982ef1e09a921cbf43 100644 (file)
@@ -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");
index a579cfdd21c7f6589d8d14324e0a2eb2ba135bb9..59176d2145f72f4f98408c2ad20beb38dfda9051 100644 (file)
@@ -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);
index 098c95c1ba3e6cfe40c8c6e9de3946f4c25ce1ac..ee1cdfefe21505e805f82379f8221d32a40f8208 100644 (file)
@@ -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
index 9f3aced1acec41991955e65a4adf07598264b06c..35efb37e56fc0e08a400d5fa272b1b8264adad11 100644 (file)
@@ -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");
index 7a6ccfa42beb86de9ab5d0d7ec6bf48b91a99647..5a090581012b9bd2764b13ae23c2641c522eeae4 100644 (file)
@@ -6,8 +6,8 @@
   <description>Divides its inputs</description>
   <category>math</category>
 
-  <input name="In1" type="double" description="Numerator"/>
-  <input name="In2" type="double" description="Denominator"/>
+  <input name="In1"  type="double" description="Numerator"/>
+  <input name="In2"  type="double" description="Denominator"/>
   <output name="Out" type="double" description="Result"/>
 
   <process><PRE>
index 8bf3f56f9dab1265659cbbfa6aee47b2e172917c..212cbba07fe753ff9933d8e6022b26fc9d76fc8e 100755 (executable)
@@ -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__
index d7a18966071deffff5c2f7c38ead815c508bafd0..e78650e8ff78428fb467cdb0fbcfd43a6eac1131 100644 (file)
@@ -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);
index f11eb89fc8bc511f30224e8050b2173aba28f985..19e534b8b4c984b6e6758c40daa3a83604041276 100644 (file)
@@ -8,5 +8,3 @@ namespace bbstd
   
 }
 // EO namespace bbstd
-
-
index 55f0d7ca8c893931001eaabbe22cd528bf80178c..b336342b0106e1d5eb6cea59cea99432f1be2448 100644 (file)
@@ -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)
index d9d6eab01d5684cb62202ddc1f98c12a307fe222..d7129f96db43d2bdecf7f0bb8e67f1ccf5d9883a 100644 (file)
@@ -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);
index c0ef92d0ab181cb5922c4e10aa8dad484737297a..cc0334f98ca1e48fa96495ced8151bf4a836e72b 100644 (file)
@@ -9,7 +9,7 @@ namespace bbstd
   template <class T>
   class Relay
     :
-    public bbtk::AtomicBlackBox
+  public bbtk::AtomicBlackBox
   {
     BBTK_TEMPLATE_BLACK_BOX_INTERFACE(Relay,bbtk::AtomicBlackBox,T);
     BBTK_DECLARE_INPUT(In,T);
index 0d1f50639f1a35a7fa16b37783c006fca43f4cf0..b3ceb3ee3c7c2e0cb2c101e244bcf87c957867dc 100644 (file)
@@ -9,9 +9,6 @@ namespace bbstd
                                         bbtk::AtomicBlackBox);
   //====================================================================
   
-  
-  
-  
   //====================================================================
   // Template specialization of decode_item
   template <> int8_t StringToVector<int8_t> ::decode_item(const std::string& s)
index d6c164d77653e15871eff79f98d440f7730ab862..f95c8bce1cbb44692fd747a6a0fcef455b7db016 100644 (file)
@@ -8,62 +8,6 @@ namespace bbstd
   BBTK_BLACK_BOX_TEMPLATE_IMPLEMENTATION(VectorToString,
                                         bbtk::AtomicBlackBox);
   //====================================================================
-  
-  
-  
-  /*
-  //====================================================================
-  // Template specialization of encode_item
-  template <> int8_t VectorToString<int8_t> ::encode_item(const std::string& s)
-  {
-    return (int8_t)atoi ( s.c_str() );
-  }
-  
-  template <> uint8_t VectorToString<uint8_t> ::encode_item(const std::string& s)
-  {
-    return (uint8_t)atoi ( s.c_str() );
-}
-
-template <> int16_t VectorToString<int16_t> ::encode_item(const std::string& s)
-{
-  return (int16_t)atoi ( s.c_str() );
-}
-
-template <> uint16_t VectorToString<uint16_t> ::encode_item(const std::string& s)
-{
-  return (uint16_t)atoi ( s.c_str() );
-}
-
-template <> int32_t VectorToString<int32_t> ::encode_item(const std::string& s)
-{
-  return (int32_t)atoi ( s.c_str() );
-}
-
-template <> uint32_t VectorToString<uint32_t> ::encode_item(const std::string& s) 
-{
-  return (uint32_t)atoi ( s.c_str() );
-}
-
-template <> long VectorToString<long> ::encode_item(const std::string& s)
-{
-  return (long)atoi ( s.c_str() );
-}
-
-template <> float VectorToString<float> ::encode_item(const std::string& s)
-{
-  return (float)atof ( s.c_str() );
-}
-
-template <> double VectorToString<double> ::encode_item(const std::string& s)
-{
-  return atof ( s.c_str() );
-}
-
-template <> std::string VectorToString<std::string> ::encode_item(const std::string& s)
-{
-  return s;
-}
-  */
 
 //====================================================================