Index: /trunk/SophyaPI/PIext/cxxexecutor.cc
===================================================================
--- /trunk/SophyaPI/PIext/cxxexecutor.cc	(revision 1236)
+++ /trunk/SophyaPI/PIext/cxxexecutor.cc	(revision 1237)
@@ -3,4 +3,5 @@
 #include <typeinfo>
 
+#include "strutilxx.h"
 #include "dvlist.h"
 
@@ -9,16 +10,10 @@
 
 
-void FillVStringFrString(string s,vector<string>& vs,char sep = ' ');
-
-
 /* --Methode-- */
 CxxExecutor::CxxExecutor(PIACmd *mpiac, PIStdImgApp* /* app */)
-  : mCompOpt(""), mLinkOpt(""), mMyLibs("")
-{
-mUserCode.resize(0);
+  : mUserCodeFn(""), mCompOpt(""), mLinkOpt(""), mMyLibs("")
+{
 mIncList.resize(0);
 mCallArgs.resize(0);
-
-NamedObjMgr omg;
 
 // On enregistre les nouvelles commandes 
@@ -28,14 +23,17 @@
 kw = "c++exec";
 usage = "c++exec: Execute the following c++ user code\n";
-usage+= "Usage: c++exec c++ user code";
+usage+= "Usage: c++exec c++ user code\n";
+usage+= "Warning: c++ user code can be found in \"cxx_spiapp.h\"\n";
+usage+= "         total generated code can be found in \"cxx_spiapp.cc\"";
 mpiac->RegisterCommand(kw, usage, this, hgrp);
 
 kw = "c++execfrf";
 usage = "c++execfrf: Execute c++ user code contained in a file\n";
-usage+= "Usage: c++execfrf fileuser.cc";
+usage+= "Usage: c++execfrf fileuser.cc\n";
+usage+= "Warning: total generated code can be found in \"cxx_spiapp.cc\"";
 mpiac->RegisterCommand(kw, usage, this, hgrp);
 
 kw = "c++args";
-usage = "c++args: Define user function arguments\n";
+usage = "c++args: Define user function arguments for c++exec and c++execfrf\n";
 usage+= "Usage: c++args arg1 arg2 arg3 ...\n";
 usage+= "       c++args -? : give current arguments\n";
@@ -100,4 +98,5 @@
 
 
+//// A VIRER quand variable de objmanager OK  --> Pour Reza
 kw = "c++setvar";
 usage = "c++setvar: Setting test variable \n";
@@ -114,4 +113,5 @@
 usage+= "c++varlist  ";
 mpiac->RegisterCommand(kw, usage, this, hgrp);
+//// A VIRER quand variable de objmanager OK  --> Pour Reza
 
 }
@@ -193,5 +193,5 @@
 
 
-
+//// A VIRER quand variable de objmanager OK  --> Pour Reza
 } else if(kw == "c++setvar") {
   if(tokens.size()<2) {
@@ -215,4 +215,5 @@
   cout<<omg.GetVarList();
 }
+//// A VIRER quand variable de objmanager OK  --> Pour Reza
 
 
@@ -224,8 +225,7 @@
 {
 ofstream os(cfilename.c_str(),ios::out);
-if(!os) {
-  cout<<"CxxExecutor::CrFile: unable to open "<<cfilename<<endl;
-  return 1;
-}
+if(!os)
+  {cout<<"CxxExecutor::CrFile: unable to open "<<cfilename<<endl;
+   return 1;}
 
 PutInclude(os);
@@ -243,5 +243,4 @@
 os<<"NamedObjMgr omg;"<<endl;
 os<<"Services2NObjMgr& srvo = *omg.GetServiceObj();"<<endl;
-os<<"//omg.AddObj(OBJECT* object,string nom_object);"<<endl;
 os<<endl;
 
@@ -252,12 +251,16 @@
 os<<endl;
 
-PutUserCode(os);
-os<<endl;
-
-os<<endl;
+os<<"//--------------------------------------------//"<<endl;
+os<<"//------------- Code utilisateur -------------//"<<endl;
+os<<"//--------------------------------------------//"<<endl;
+os<<endl;
+os<<"#include \""<<mUserCodeFn<<"\""<<endl;
+os<<endl;
+
 os<<"return 0;"<<endl;
 os<<"}"<<endl;
 
 cout<<"File "<<cfilename<<" for function "<<func<<" created"<<endl;
+cout<<"User code is in file "<<mUserCodeFn<<" included in "<<cfilename<<endl;
 return 0;
 }
@@ -360,18 +363,8 @@
   string key = (*it).first;
   os<<"___nomobj = \""<<key<<"\";"<<endl;
-  os<<"MuTyV & "<<key<<" = omg.GetVarList().Get(___nomobj);"<<endl;
-}
-
-}
-
-/* --Methode-- */
-void CxxExecutor::PutUserCode(ofstream& os)
-{
-os<<"//--------------------------------------------//"<<endl;
-os<<"//------------- Code utilisateur -------------//"<<endl;
-os<<"//--------------------------------------------//"<<endl;
-os<<endl;
-if(mUserCode.size()<1) return;
-for(uint_4 i=0;i<mUserCode.size();i++) os<<mUserCode[i]<<endl;
+  os<<"MuTyV & $"<<key<<" = omg.GetVarList().Get(___nomobj);"<<endl;
+}
+
+return;
 }
 
@@ -379,17 +372,18 @@
 int CxxExecutor::FillUserCode(vector<string>& usercode,uint_4 first)
 // - first is the first position in the vector<> where the code starts
-{
-mUserCode.resize(0);
+// User code is read from input. It is put into file "cxx_spiapp.h".
+{
+mUserCodeFn = "";
 uint_4 nus = usercode.size();
-if(nus<=first) {
-  cout<<"CxxExecutor::FillUserCode: no user code"<<endl;
-  return 1;
-}
-string dum = "";
+if(nus<=first) {cout<<"CxxExecutor::FillUserCode: no user code"<<endl;
+                return 1;}
+mUserCodeFn = "cxx_spiapp.h";
+ofstream os(mUserCodeFn.c_str(),ios::out);
+if(!os) {cout<<"CxxExecutor::FillUserCode: unable to open "
+             <<mUserCodeFn<<endl;  mUserCodeFn = ""; return 1;}
 // On ajoute un blanc pour les chaines de caracteres contenant des blancs
-for(uint_4 i=first;i<nus;i++) dum += " " + usercode[i];
-// Tout dans une seule ligne pour eviter les pbs (cf au bas du fichier)
-mUserCode.push_back(dum);
-cout<<"User code filled from standard input"<<endl;
+for(uint_4 i=first;i<nus;i++) os<<" "<<usercode[i];
+os<<endl;
+cout<<"User code filled from standard input into "<<mUserCodeFn<<endl;
 return 0;
 }
@@ -397,23 +391,7 @@
 /* --Methode-- */
 int CxxExecutor::FillUserCode(string filename)
-{
-mUserCode.resize(0);
-
-ifstream is(filename.c_str());
-if(!is) {
-  cout<<"CxxExecutor::FillUserCode: unable to open "<<filename<<endl;
-  return 1;
-}
-
-int nline = 4096; // Au plus 4096 characters par ligne!
-char *str = new char[nline+2];
-while(is)
-  {is.getline(str,nline); mUserCode.push_back((string) str);}
-delete [] str;
-if(mUserCode.size()<=0) {
-  return 2;
-  cout<<"CxxExecutor::FillUserCode: no user code"<<endl;
-}
-
+// User code is read from "filename".
+{
+mUserCodeFn = filename;
 cout<<"User code filled from file "<<filename<<endl;
 return 0;
@@ -501,5 +479,5 @@
 vector<string> arg; arg.push_back(func);
 if(mCallArgs.size()>0)
-  for(int i=0;i<mCallArgs.size();i++) arg.push_back(mCallArgs[i]);
+  for(uint_4 i=0;i<mCallArgs.size();i++) arg.push_back(mCallArgs[i]);
 mpiac->ExecuteCommand(key,arg);
 return 0;
@@ -609,7 +587,6 @@
 /* --Methode--  DO NOT DELETE.... cmv property !!!
 int CxxExecutor::FillUserCode(vector<string>& usercode,uint_4 first)
-// - first is the first position in the vector<> where the code starts
-{
-mUserCode.resize(0);
+{
+mUserCodeFn = "";
 uint_4 nus = usercode.size();
 if(nus<=first) {
@@ -617,4 +594,9 @@
   return 1;
 }
+mUserCodeFn = "cxx_spiapp.h";
+ofstream os(mUserCodeFn.c_str(),ios::out);
+if(!os)
+  {cout<<"CxxExecutor::FillUserCode: unable to open "<<mUserCodeFn<<endl;
+   mUserCodeFn = ""; return 1;}
 // **** 1er probleme ****
 // - Pour la lisibilite et eviter les bugs avec les chaines de caracteres
@@ -653,45 +635,9 @@
     //                                2-/ c'est le dernier charactere
     if((str[j]==';' && !comment) || lastchar)
-      {mUserCode.push_back(dum); dum = "";}
+      {os<<dum<<endl; dum = "";}
   }
 }
-cout<<"User code filled from standard input"<<endl;
+cout<<"User code filled from standard input into "<<mUserCodeFn<<endl;
 return 0;
 }
 */
-
-
-void FillVStringFrString(string s,vector<string>& vs,char sep)
-// Use string "s" to fill vector of strings "vs"
-// considering char "sep" as a separator.
-// Vector is filled from its end (no reset done).
-// Tp write a "sep" char, use \'sep'
-// Warning: separator "sep" could not be set to '\'
-// Ex: sep=' ': s="aaa   bbb cc d " -> vs=(aaa,bbb,cc,d)
-// Ex: sep=';': s="aaa   ;bbb; cc;d " -> vs=(aaa   ,bbb, cc,d )
-// Ex: sep=';': s=";aaa\;bbb;;;ccc;ddd" -> vs=(aaa;bbb,ccc,ddd)
-// Ex: sep=';': s=";aaa\;bbb;;;ccc;ddd\" -> vs=(aaa;bbb,ccc,ddd\)
-{
-uint_4 ls = s.size();
-if(ls<=0 || sep=='\\') return;
-s += sep; // add a separator at the end
-const char* str = s.c_str();
-ls = strlen(str); // str[ls-1]==sep cf ci-dessus
-string dum = "";
-for(uint_4 i=0; i<ls; i++) {
-  if(i==0 && str[i]==sep) {
-    continue;
-  } else if(str[i]=='\\') {
-    if(str[i+1]!=sep || i==ls-2) dum += str[i];
-  } else if(str[i]!=sep) {
-    dum += str[i];
-  } else {  // C'est un "sep" mais est-ce vraiment un separateur?
-    if(str[i-1]=='\\' && i!=ls-1) dum += str[i];
-    else {  // C'est un separateur, ne delimite t-il pas d'autres separateurs?
-      if(dum.size()<=0) continue;
-      vs.push_back(dum);
-      dum = "";
-    }
-  }
-}
-}
Index: /trunk/SophyaPI/PIext/cxxexecutor.h
===================================================================
--- /trunk/SophyaPI/PIext/cxxexecutor.h	(revision 1236)
+++ /trunk/SophyaPI/PIext/cxxexecutor.h	(revision 1237)
@@ -1,4 +1,4 @@
 // This may look like C code, but it is really -*- C++ -*-
-// Classe CxxExecutor  : Dynmamic C++ compile/execution in piapp
+// Classe CxxExecutor  : Dynamic C++ compile/execution in piapp
 // (c) DAPNIA (CEA)                 LAL (IN2P3/CNRS)
 //                           C. Magneville  10/2000
@@ -30,5 +30,4 @@
        void PutObject(ofstream& os);
        void PutVar(ofstream& os);
-       void PutUserCode(ofstream& os);
 
   int  FillUserCode(vector<string>& usercode,uint_4 first);
@@ -62,8 +61,8 @@
 
 private:
+  string mUserCodeFn;
   string mCompOpt;
   string mLinkOpt;
   string mMyLibs;
-  vector<string> mUserCode;
   vector<string> mIncList;
   vector<string> mCallArgs;
Index: /trunk/SophyaPI/PIext/nomimagadapter.cc
===================================================================
--- /trunk/SophyaPI/PIext/nomimagadapter.cc	(revision 1236)
+++ /trunk/SophyaPI/PIext/nomimagadapter.cc	(revision 1237)
@@ -52,5 +52,5 @@
 string type = "Image< ";
 // type +=  DecodeTypeIdName(typeid(T).name());
-type += DataType<T>::getTypeName();
+type += DataTypeInfo<T>::getTypeName();
 type +=  " > ";
 return(type);
Index: /trunk/SophyaPI/PIext/nomskymapadapter.cc
===================================================================
--- /trunk/SophyaPI/PIext/nomskymapadapter.cc	(revision 1236)
+++ /trunk/SophyaPI/PIext/nomskymapadapter.cc	(revision 1237)
@@ -88,5 +88,5 @@
 
 // type +=  DecodeTypeIdName(typeid(T).name());
-type += DataType<T>::getTypeName();
+type += DataTypeInfo<T>::getTypeName();
 type +=  " > ";
 return(type);
Index: /trunk/SophyaPI/PIext/nomtmatvecadapter.cc
===================================================================
--- /trunk/SophyaPI/PIext/nomtmatvecadapter.cc	(revision 1236)
+++ /trunk/SophyaPI/PIext/nomtmatvecadapter.cc	(revision 1237)
@@ -56,5 +56,5 @@
 
 // type +=  DecodeTypeIdName(typeid(T).name());
-type += DataType<T>::getTypeName();
+type += DataTypeInfo<T>::getTypeName();
 type +=  " > ";
 return(type);
