Index: /trunk/SophyaProg/Tests/tstppfwrapstl.cc
===================================================================
--- /trunk/SophyaProg/Tests/tstppfwrapstl.cc	(revision 2659)
+++ /trunk/SophyaProg/Tests/tstppfwrapstl.cc	(revision 2659)
@@ -0,0 +1,155 @@
+#include "sopnamsp.h"
+#include "machdefs.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "math.h"
+#include <iostream>
+#include <string>
+
+#include <typeinfo>
+#include "timing.h"
+#include "histinit.h"
+#include "pexceptions.h"
+#include "ppfwrapstlv.h" 
+
+/*  Programme test du PPFWrapper pour les vecteurs de la STL */
+/*  SOPHYA - R. Ansari (LAL)  -   Avril 2005                 */
+ 
+int main(int narg, char* arg[])
+{
+  if ((narg > 1) && (strcmp(arg[1],"-h") == 0) ) {
+    cout << " tstppfwrapstl : Test classes PPFWrapper \n"
+	 << "   Usage: tstppfwrapstl [VectorSize=10] [prtlev=0,1] " << endl;
+    return 0;
+  }
+  cout << " ---- Programme tstppfwrapstl.cc ---- \n" 
+       << "      ::: Test classes PPFWrapper de std::vector ::: " << endl;
+  int prtlev = 0;
+  int SZV = 10;
+  if (narg > 1) SZV = atoi(arg[1]); 
+  if (narg > 2) prtlev = atoi(arg[2]);
+  cout << " ----- Test PPFWrapperSTLVector<T> Size= " << SZV << " PrtLev= " 
+       << prtlev << endl;
+  int rc = 0;
+  try {
+    SophyaInit();
+
+    InitTim(); 
+    vector<float> vw(SZV);
+    for(int k=0; k<SZV; k++) vw[k] = 3.141596*k;
+    #define MyNSC 6 
+    char * strcst[MyNSC] = { "Langage C++" , "Programmation Objet", "Calcul scientifique",
+			   "Librairie de classes", "SOPHYA", " et Java alors ?"};
+
+    cout << "1/ Initialisation  vector<float> vf , vector<int> vi , vector<string> vs " << endl;
+    
+    vector<float> vf(SZV);
+    vector<string> vs(SZV); 
+    vector<int> vi(SZV);
+    for(int k=0; k<SZV; k++) { 
+      vf[k] = 3.141596*k;
+      vs[k] = strcst[k%MyNSC];
+      vi[k] = random();
+    }
+    if (prtlev > 0) {
+      cout << "  vector<float> vf Size= " << vf.size() << " values: \n" ;
+      int k;
+      for(k=0; k<vf.size(); k++) cout << vf[k] << " ;  ";
+      cout << endl;
+      cout << "  vector<int> vi Size= " << vi.size() << " values: \n" ;
+      for(k=0; k<vi.size(); k++) cout << vi[k] << " ;  ";
+      cout << endl;
+      cout << "  vector<string> vs Size= " << vs.size() << " values: \n" ;
+      for(k=0; k<vs.size(); k++) cout << vs[k] << " ;  ";
+      cout << endl;
+    }
+    {
+      cout << "2/  Ecriture vf vi vs ds  fichier wrapstl.ppf" << endl;
+      POutPersist so("wrapstl.ppf");
+      so << PPFNameTag("STLVec<float>") << vf; 
+      so << PPFNameTag("STLVec<string>") << vs; 
+      so << PPFNameTag("STLVec<int>") << vi; 
+    }
+    vector<string> vsr;
+    vector<int> vir;
+    vector<float> vfr;
+    {
+      cout << "3/ Relecture vfr vir vsr depuis fichier wrapstl.ppf " << endl;
+      PInPersist si("wrapstl.ppf");
+      si >> PPFNameTag("STLVec<string>") >> vsr >> vir; 
+      si >> PPFNameTag("STLVec<float>") >> vfr;
+      if (prtlev > 0) {
+	cout << "  vector<float> vfr Size= " << vfr.size() << " values: \n" ;
+	int k;
+	for(k=0; k<vfr.size(); k++) cout << vfr[k] << " ;  ";
+	cout << endl;
+	cout << "  vector<int> vir Size= " << vir.size() << " values: \n" ;
+	for(k=0; k<vir.size(); k++) cout << vir[k] << " ;  ";
+	cout << endl;
+	cout << "  vector<string> vsr Size= " << vsr.size() << " values: \n" ;
+	for(k=0; k<vsr.size(); k++) cout << vsr[k] << " ;  ";
+	cout << endl;
+      }
+    }
+    cout << "3/ Comparaison vfr<>vf vir<>vr vsr<>vr  " << endl;
+    int k;
+    if (vfr.size() != vf.size()) {
+      cout << "  ... Difference de taille vf et vfr " << endl;
+      rc += 1;
+    }
+    else {
+      int ndiff = 0;
+      for(k=0; k<vfr.size(); k++) 
+	if (vfr[k] != vf[k]) ndiff ++;
+      if (ndiff != 0) { 
+	cout << " vf <> vfr  NDiff = " << ndiff << endl;
+	rc += 2;
+      }
+    }
+    if (vir.size() != vi.size()) {
+      cout << "  ... Difference de taille vi et vir " << endl;
+      rc += 4;
+    }
+    else {
+      int ndiff = 0;
+      for(k=0; k<vir.size(); k++) 
+	if (vir[k] != vi[k]) ndiff ++;
+      if (ndiff != 0) { 
+	cout << " vi <> vir  NDiff = " << ndiff << endl;
+	rc += 8;
+      }
+    }
+    if (vsr.size() != vs.size()) {
+      cout << "  ... Difference de taille vi et vir " << endl;
+      rc += 16;
+    }
+    else {
+      int ndiff = 0;
+      for(k=0; k<vsr.size(); k++) 
+	if (vsr[k] != vs[k]) ndiff ++;
+      if (ndiff != 0) { 
+	cout << " vs <> vsr  NDiff = " << ndiff << endl;
+	rc += 32;
+      }
+    }
+    if (rc == 0) cout << " .... Comparaison OK " << endl;
+
+  }
+  catch (PThrowable & exc) {
+    cerr << " tstppfwrapstl.cc: Catched Exception (PThrowable)" << (string)typeid(exc).name() 
+	 << " - Msg= " << exc.Msg() << endl;
+    rc = 99;
+  }
+  catch (std::exception & e) {
+    cerr << " tstppfwrapstl.cc: Catched std::xception "  
+	 << " - what()= " << e.what() << endl;
+    rc = 98;
+  }
+  catch (...) {
+    cerr << " tstppfwrapstl.cc: some other exception (...) was caught ! " << endl;
+    rc = 97;
+  }
+  PrtTim("End tstppfwrapstl  " );
+  cout << " ---- Programme tstppfwrapstl.cc -  FIN  (Rc=" << rc << ") --- " << endl;
+  return rc;
+}
Index: /trunk/SophyaProg/Tests/tstsegdb.cc
===================================================================
--- /trunk/SophyaProg/Tests/tstsegdb.cc	(revision 2659)
+++ /trunk/SophyaProg/Tests/tstsegdb.cc	(revision 2659)
@@ -0,0 +1,114 @@
+#include "sopnamsp.h"
+#include "machdefs.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "math.h"
+#include <iostream>
+#include <string>
+
+#include <typeinfo>
+#include "timing.h"
+#include "histinit.h"
+#include "pexceptions.h"
+#include "segdatablock.h"
+#include "fiosegdb.h" 
+#include "swsegdb.h" 
+#include "ppfswapper.h" 
+#include "ppfwrapstlv.h"
+
+/*  Programme test des classes  SegDataBlock<T> et son PPF writer */
+/*  SwSegDataBlock<T> avec le swapper PPF                         */
+/*  SOPHYA - R. Ansari (LAL)  -   Avril 2005                      */
+ 
+int main(int narg, char* arg[])
+{
+  cout << " ---- Programme tstsegdb.cc ----- \n" 
+       << "     Test classe SegDataBlock<T> et  SwSegDataBlock<T>  " << endl;
+  int rc = 0;
+  try {
+      SophyaInit();
+
+    InitTim(); 
+    cout << "1/ Test SegDataBlock Creation,remplissage, impression (segi, ssegi, sgds" << endl;
+    SegDataBlock<int> segi;
+    segi.Extend();
+    cout << segi;
+
+    SegDataBlock<int> ssegi(segi);
+    segi = 432;
+    ssegi.Extend(); 
+    ssegi.Print(cout, 4, " , ");
+    SegDataBlock<string> sgds(5,3); 
+    cout << sgds;
+    sgds[2] = "bonjour";  sgds[5] = "AAAA"; 
+    sgds[8] = "BbbBBbb";
+    sgds.Print(cout, 4, " ; ");
+ 
+    {
+      cout << "2/ Ecriture segi sgds et ssegi dans segdb.ppf " << endl;
+      POutPersist so("segdb.ppf");
+      so << segi << sgds << ssegi;
+    }
+    {
+      cout << "3/ Lecture depuis segdb.ppf et print " << endl;
+      SegDataBlock<int> rsd1, rsd2;
+      SegDataBlock<string> rsds;
+      PInPersist si("segdb.ppf");
+      si >> rsd1 >> rsds >> rsd2;
+      rsds.Print(cout, 4, " ; ");
+      cout << "4/ On modifie certains elements de rsd1 et on verifie le partage de reference en lecture" << endl;
+      for(int jj=0; jj<rsd1.Size(); jj += 9) 
+	rsd1[jj] = 999;
+      rsd1.Print(cout, 4, " , ");
+      rsd2.Print(cout, 4, " , ");
+    }
+    cout << "5/ Test  SwSegDataBlock<T>  creation/remplissage  " << endl;
+    int SWSEGSZ = 4;
+    {
+      cout << " Creation PPFDataSwapper<float> swout(so) avec swseg.ppf " << endl;
+      POutPersist so("swseg.ppf");
+      PPFDataSwapper<float> swout(so);
+      SwSegDataBlock<float> swsd(swout, SWSEGSZ, 3);
+      float * fp = swsd.GetSegment(0);
+      fp[0] = 6.54321;   fp[1] = 65.4321;  fp[2] = 654.321;  fp[3] = 6543.21;
+      fp = swsd.GetSegment(1);
+      fp[0] = 2.56789;   fp[1] = 25.6789;  fp[2] = 256.789;  fp[3] = 2567.89;
+      fp = swsd.GetSegment(2);
+      fp[0] = 12.567;   fp[1] = 225.67;  fp[2] = 3256.7;  fp[3] = 42567.;
+      vector<int_8> tags = swsd.GetSwapPosTagTable();
+      so << tags;
+    }
+    {
+      cout << "6/ Creation PPFDataSwapper<float> avec lecture depuis swseg.ppf " << endl;
+      PInPersist si("swseg.ppf");
+      PPFDataSwapper<float> swin(si);
+      vector<int_8> tags;
+      si >> tags;
+      SwSegDataBlock<float> swsd(swin, tags, SWSEGSZ);
+      cout <<"7/ Recopie ds SegDataBlock<float> depuis SwSegDataBlock<float> et print" << endl;
+      SegDataBlock<float> segf,segf2;
+      segf = swsd;
+      segf.Print(cout, 4, "  ");
+      segf2 = swsd;
+      segf2.Print(cout, 4, "  ");
+    }
+   
+  }
+  catch (PThrowable & exc) {
+    cerr << " tstsegdb.cc: Catched Exception (PThrowable)" << (string)typeid(exc).name() 
+	 << " - Msg= " << exc.Msg() << endl;
+    rc = 99;
+  }
+  catch (std::exception & e) {
+    cerr << " tstsegdb.cc: Catched std::xception "  
+	 << " - what()= " << e.what() << endl;
+    rc = 98;
+  }
+  catch (...) {
+    cerr << " tstsegdb.cc: some other exception (...) was caught ! " << endl;
+    rc = 97;
+  }
+  PrtTim("End tstsegdb " );
+  cout << " ---- Programme tstsegdb.cc -  FIN  (Rc=" << rc << ") --- " << endl;
+  return rc;
+}
Index: /trunk/SophyaProg/Tests/ttimestamp.cc
===================================================================
--- /trunk/SophyaProg/Tests/ttimestamp.cc	(revision 2658)
+++ /trunk/SophyaProg/Tests/ttimestamp.cc	(revision 2659)
@@ -12,4 +12,7 @@
 #include "histinit.h"
 #include "pexceptions.h"
+
+/*  Programme test de la classe TimeStamp             */
+/*  SOPHYA - R. Ansari (LAL)  -   Mars 2005           */
 
 int main(int narg, char* arg[])
@@ -35,19 +38,19 @@
   }
   catch (PThrowable & exc) {
-    cerr << " tsphereecp.cc: Catched Exception (PThrowable)" << (string)typeid(exc).name() 
+    cerr << " ttimestamp.cc: Catched Exception (PThrowable)" << (string)typeid(exc).name() 
 	 << " - Msg= " << exc.Msg() << endl;
     rc = 99;
   }
   catch (std::exception & e) {
-    cerr << " tsphereecp.cc: Catched std::xception "  
+    cerr << " ttimestamp.cc: Catched std::xception "  
 	 << " - what()= " << e.what() << endl;
     rc = 98;
   }
   catch (...) {
-    cerr << " ssphereecp.cc: some other exception (...) was caught ! " << endl;
+    cerr << " ttimestamp.cc: some other exception (...) was caught ! " << endl;
     rc = 97;
   }
-  PrtTim("End tsphereecp " );
-  cout << " ---- Programme tsphereecp.cc -  FIN  (Rc=" << rc << ") --- " << endl;
+  PrtTim("End ttimestamp " );
+  cout << " ---- Programme ttimestamp.cc-  FIN  (Rc=" << rc << ") --- " << endl;
   return rc;
 }
