Index: trunk/SophyaLib/BaseTools/Makefile
===================================================================
--- trunk/SophyaLib/BaseTools/Makefile	(revision 1224)
+++ trunk/SophyaLib/BaseTools/Makefile	(revision 1225)
@@ -3,7 +3,7 @@
 all: $(LIB)libSysTools.a
 clean:
-	rm -f $(OBJ)ctimer.o $(OBJ)datacards.o $(OBJ)dvlist.o $(OBJ)fiondblock.o $(OBJ)mutyv.o $(OBJ)ndatablock.o $(OBJ)pdlmgr.o $(OBJ)periodic.o $(OBJ)pexceptions.o $(OBJ)ppersist.o $(OBJ)psighand.o $(OBJ)sophyainit.o $(OBJ)utils.o $(OBJ)gnumd5.o $(OBJ)srandgen.o $(OBJ)strutil.o $(OBJ)timing.o
+	rm -f $(OBJ)ctimer.o $(OBJ)datacards.o $(OBJ)datatype.o $(OBJ)dvlist.o $(OBJ)fiondblock.o $(OBJ)mutyv.o $(OBJ)ndatablock.o $(OBJ)pdlmgr.o $(OBJ)periodic.o $(OBJ)pexceptions.o $(OBJ)ppersist.o $(OBJ)psighand.o $(OBJ)sophyainit.o $(OBJ)utils.o $(OBJ)gnumd5.o $(OBJ)srandgen.o $(OBJ)strutil.o $(OBJ)timing.o
 	rm -f $(LIB)libSysTools.a
-$(LIB)libSysTools.a : $(OBJ)ctimer.o $(OBJ)datacards.o $(OBJ)dvlist.o $(OBJ)fiondblock.o $(OBJ)gnumd5.o $(OBJ)mutyv.o $(OBJ)ndatablock.o $(OBJ)pdlmgr.o $(OBJ)periodic.o $(OBJ)pexceptions.o $(OBJ)ppersist.o $(OBJ)psighand.o $(OBJ)sophyainit.o $(OBJ)srandgen.o $(OBJ)strutil.o $(OBJ)timing.o $(OBJ)utils.o
+$(LIB)libSysTools.a : $(OBJ)ctimer.o $(OBJ)datacards.o $(OBJ)datatype.o $(OBJ)dvlist.o $(OBJ)fiondblock.o $(OBJ)gnumd5.o $(OBJ)mutyv.o $(OBJ)ndatablock.o $(OBJ)pdlmgr.o $(OBJ)periodic.o $(OBJ)pexceptions.o $(OBJ)ppersist.o $(OBJ)psighand.o $(OBJ)sophyainit.o $(OBJ)srandgen.o $(OBJ)strutil.o $(OBJ)timing.o $(OBJ)utils.o
 	$(ARCXX) $(ARCXXFLAGS) $@ $?
 ifeq ($(CXX),cxx)
@@ -13,4 +13,5 @@
 $(OBJ)ctimer.o: ctimer.cc machdefs.h ctimer.h
 $(OBJ)datacards.o: datacards.cc machdefs.h datacards.h pexceptions.h
+$(OBJ)datatype.o: datatype.cc datatype.h machdefs.h
 $(OBJ)dvlist.o: dvlist.cc machdefs.h dvlist.h objfio.h anydataobj.h \
  ppersist.h pexceptions.h gnumd5.h mutyv.h strutil.h
Index: trunk/SophyaLib/BaseTools/datatype.cc
===================================================================
--- trunk/SophyaLib/BaseTools/datatype.cc	(revision 1225)
+++ trunk/SophyaLib/BaseTools/datatype.cc	(revision 1225)
@@ -0,0 +1,109 @@
+// This may look like C code, but it is really -*- C++ -*-
+// Classe pour nom, taille, ... de types de donnees
+//                         C.Magneville         10/2000
+// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
+
+#include "datatype.h"
+
+#include <complex>
+
+template <class T>
+DataType<T>::DataType()
+{
+}
+
+string DataType<uint_1>::getTypeName() { return("uint_1"); }
+string DataType<uint_2>::getTypeName() { return("uint_2"); }
+string DataType<int_2>::getTypeName() { return("int_2"); }
+string DataType<int_4>::getTypeName() { return("int_4"); }
+string DataType<int_8>::getTypeName() { return("int_8"); }
+string DataType<uint_4>::getTypeName() { return("uint_4"); }
+string DataType<uint_8>::getTypeName() { return("uint_8"); }
+string DataType<r_4>::getTypeName() { return("r_4"); }
+string DataType<r_8>::getTypeName() { return("r_8"); }
+string DataType< complex<r_4> >::getTypeName() { return(" complex<r_4> "); }
+string DataType< complex<r_8> >::getTypeName() { return(" complex<r_8> "); }
+
+
+
+string DecodeGCCTypeName(string gcctype)
+// seulement pour gcc/g++ qui ne code pas correctement
+{
+#if defined(__GNUG__)
+  string type("");
+  const char* str = gcctype.c_str();
+  int lstr = (int) strlen(str);
+  if(lstr<=0) return string("Linux Decoding error: lstr<=0");
+
+  // Le dernier caractere donne le type
+  lstr--;
+  if     (str[lstr]=='v') type = "void";
+  else if(str[lstr]=='b') type = "bool";
+  else if(str[lstr]=='c') type = "char";
+  else if(str[lstr]=='s') type = "short";
+  else if(str[lstr]=='i') type = "int";
+  else if(str[lstr]=='l') type = "long";
+  else if(str[lstr]=='x') type = "long long";
+  else if(str[lstr]=='f') type = "float";
+  else if(str[lstr]=='d') type = "double";
+  else if(str[lstr]=='r') type = "long double";
+  else return string("Linux Decoding error: bad last char");
+  if(lstr==0) return type;
+
+  // Les caracteres precedents donnent: signed, unsigned, *, & ou const.
+  // Mais si on a un Z, alors c'est un complexe (code ...t7complex1Z...)
+  for(int i=0; i<(int)strlen(str); i++) {
+    lstr--;
+    if     (str[lstr]=='U') type = "unsigned " + type;
+    else if(str[lstr]=='S') type = "signed " + type;
+    else if(str[lstr]=='P') type = type + "*";
+    else if(str[lstr]=='R') type = type + "&";
+    else if(str[lstr]=='C') type = "const " + type;
+    else if(str[lstr]=='Z') {  // Complexe
+      type = "complex<" + type + ">";
+      for(int j=0;j<(int)strlen(str);j++) {
+        if     (str[j]=='P') type = type + "*";
+        else if(str[j]=='R') type = type + "&";
+        else if(str[j]=='C') type = "const " + type;
+        else if(str[j]=='t') break;
+        else return string("Linux Decoding error: bad char 1,2 for Z");
+      }
+      break;
+    }
+    else return string("Linux Decoding error: bad last-1,last-2 char");
+    if(lstr==0) break;
+  }
+
+return type;
+#else
+return gcctype;
+#endif
+}
+
+#ifdef __CXX_PRAGMA_TEMPLATES__
+#pragma define_template DataType<uint_1>
+#pragma define_template DataType<uint_2>
+#pragma define_template DataType<int_2>
+#pragma define_template DataType<int_4>
+#pragma define_template DataType<int_8>
+#pragma define_template DataType<uint_4>
+#pragma define_template DataType<uint_8>
+#pragma define_template DataType<r_4>
+#pragma define_template DataType<r_8>
+#pragma define_template DataType< complex<r_4> >
+#pragma define_template DataType< complex<r_8> >
+#endif
+
+#if defined(ANSI_TEMPLATES) || defined(GNU_TEMPLATES)
+template class DataType<uint_1>;
+template class DataType<uint_2>;
+template class DataType<int_2>;
+template class DataType<int_4>;
+template class DataType<int_8>;
+template class DataType<uint_4>;
+template class DataType<uint_8>;
+template class DataType<r_4>;
+template class DataType<r_8>;
+template class DataType< complex<r_4> >;
+template class DataType< complex<r_8> >;
+#endif
Index: trunk/SophyaLib/BaseTools/datatype.h
===================================================================
--- trunk/SophyaLib/BaseTools/datatype.h	(revision 1225)
+++ trunk/SophyaLib/BaseTools/datatype.h	(revision 1225)
@@ -0,0 +1,26 @@
+// This may look like C code, but it is really -*- C++ -*-
+// Classe pour nom, taille, ... de types de donnees
+//                         C.Magneville         10/2000
+// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
+
+#ifndef DATATYPE_H
+#define DATATYPE_H
+
+#include "machdefs.h"
+
+#include <string>
+
+namespace SOPHYA {
+
+template <class T>
+class DataType {
+public:
+  static string getTypeName();
+  DataType();
+};
+
+string DecodeGCCTypeName(string gcctype);
+
+} // Fin du namespace
+
+#endif
Index: trunk/SophyaLib/BaseTools/dvlist.cc
===================================================================
--- trunk/SophyaLib/BaseTools/dvlist.cc	(revision 1224)
+++ trunk/SophyaLib/BaseTools/dvlist.cc	(revision 1225)
@@ -199,5 +199,5 @@
 ValList::const_iterator it = mvlist.find(key);
 if (it == mvlist.end())  return(def);
-return((*it).second.elval.iv);
+return( (int_8)((*it).second.elval) );
 }
 
@@ -209,5 +209,5 @@
 ValList::const_iterator it = mvlist.find(key);
 if (it == mvlist.end())  return(def);
-return((*it).second.elval.dv);
+return( (r_8)((*it).second.elval) );
 }
 
@@ -219,5 +219,5 @@
 ValList::const_iterator it = mvlist.find(key);
 if (it == mvlist.end())  return(def);
-return((*it).second.elval.dv);
+return( (complex<r_8>)((*it).second.elval) );
 }
 
@@ -229,5 +229,5 @@
 ValList::const_iterator it = mvlist.find(key);
 if (it == mvlist.end())  return(def);
-return(*((*it).second.elval.strv));
+return( (string)((*it).second.elval) );
 }
 
Index: trunk/SophyaLib/BaseTools/mutyv.cc
===================================================================
--- trunk/SophyaLib/BaseTools/mutyv.cc	(revision 1224)
+++ trunk/SophyaLib/BaseTools/mutyv.cc	(revision 1225)
@@ -70,6 +70,8 @@
 {
   typ = a.typ;  iv = a.iv;  dv = a.dv;  dv_im = a.dv_im; 
-  if (typ == 'S')  strv = new string(*(a.strv));
-  else strv = NULL;
+  if (typ == 'S')  { 
+    if (strv) *strv = *(a.strv);  
+    else strv = new string(*(a.strv));
+  }
   return(*this);
 }
@@ -79,5 +81,6 @@
 {
   typ = 'S';
-  strv = new string(s);
+  if (strv) *strv = s;  
+  else strv = new string(s);
   mutyv_decodestr(s, dv, dv_im);
   iv = (int_8)dv;
@@ -89,5 +92,6 @@
 {
   typ = 'S';
-  strv = new string(s);
+  if (strv) *strv = s;  
+  else strv = new string(s);
   mutyv_decodestr(s.c_str(), dv, dv_im);
   iv = (int_8)dv;
Index: trunk/SophyaLib/BaseTools/objlist.list
===================================================================
--- trunk/SophyaLib/BaseTools/objlist.list	(revision 1224)
+++ trunk/SophyaLib/BaseTools/objlist.list	(revision 1225)
@@ -1,4 +1,5 @@
 ctimer.o
 datacards.o
+datatype.o
 dvlist.o
 fiondblock.o
Index: trunk/SophyaLib/BaseTools/sversion.h
===================================================================
--- trunk/SophyaLib/BaseTools/sversion.h	(revision 1224)
+++ trunk/SophyaLib/BaseTools/sversion.h	(revision 1225)
@@ -3,6 +3,6 @@
 
 #define SOPHYA_VERSION   0.9 
-#define SOPHYA_REVISION  91
-#define SOPHYA_TAG       "V_Aou2000"
+#define SOPHYA_REVISION  93
+#define SOPHYA_TAG       "V_Sep2000"
 
 #endif
