Index: trunk/SophyaPI/PIext/cxxexecutor.cc
===================================================================
--- trunk/SophyaPI/PIext/cxxexecutor.cc	(revision 1291)
+++ trunk/SophyaPI/PIext/cxxexecutor.cc	(revision 1297)
@@ -19,4 +19,13 @@
 mIncList.resize(0);
 mCallArgs.resize(0);
+
+mIncImportList.resize(0);
+mModuleImportList.resize(0);
+
+// La liste de tous les modules que l'on peut ajouter
+mModuleImportDefaultList.resize(0);
+mModuleImportDefaultList.push_back("Samba");
+mModuleImportDefaultList.push_back("SkyMap");
+mModuleImportDefaultList.push_back("PMixer");
 
 // Gestion des fichiers par default dans TmpDir 
@@ -74,35 +83,44 @@
 
 kw = "c++include";
-usage = "c++include: give personnal includes to be used\n";
+usage = "c++include: add personnal includes to be used by executor\n";
 usage+= "Usage: c++include myinc1.h myinc2.h ...\n";
-usage+= "       c++include -? : give current include files\n";
-usage+= "       c++include    : reset current include files\n";
-usage+= "Warning: to be used before c++create... c++exec...";
+usage+= "       c++include -? : list current additionnal include files\n";
+usage+= "       c++include    : reset to no additionnal include files\n";
+usage+= "Warning: to be used before c++create c++compile c++exec...";
 mpiac->RegisterCommand(kw, usage, this, hgrp);
 
 kw = "c++compileopt";
-usage = "c++compileopt: give additionnal compile options\n";
+usage = "c++compileopt: add personnal compile options\n";
 usage+= "Usage: c++compileopt -g -O5 -IMy_Inc_Dir ...\n";
-usage+= "       c++compileopt -? : give current compile options\n";
-usage+= "       c++compileopt    : reset current compile options\n";
-usage+= "Warning: to be used before c++compile";
+usage+= "       c++compileopt -? : list current additionnal compile options\n";
+usage+= "       c++compileopt    : reset to no additionnal compile options\n";
+usage+= "Warning: to be used before c++create c++compile c++exec ...";
 mpiac->RegisterCommand(kw, usage, this, hgrp);
 
 kw = "c++linkopt";
-usage = "c++linkopt: give additionnal link options\n";
+usage = "c++linkopt: add personnal link options\n";
 usage+= "Usage: c++linkopt -g -O5 ...\n";
-usage+= "       c++linkopt -? : give current link options\n";
-usage+= "       c++linkopt    : reset current link options\n";
-usage+= "Warning: to be used before c++compile";
+usage+= "       c++linkopt -? : list current additionnal link options\n";
+usage+= "       c++linkopt    : reset to no additionnal link options\n";
+usage+= "Warning: to be used before c++create c++compile c++exec ...";
 mpiac->RegisterCommand(kw, usage, this, hgrp);
 
 kw = "c++mylibs";
-usage = "c++mylibs: give additionnal libraries\n";
+usage = "c++mylibs: add personnal libraries\n";
 usage+= "Usage: c++mylibs -LMy_Lib_Dir -lmylib1 -lmylib2 ...\n";
-usage+= "       c++mylibs -? : give current additionnal libraries\n";
-usage+= "       c++mylibs    : reset current additionnal libraries\n";
-usage+= "Warning: to be used before c++compile";
-mpiac->RegisterCommand(kw, usage, this, hgrp);
-
+usage+= "       c++mylibs -? : list current additionnal libraries\n";
+usage+= "       c++mylibs    : reset to no additionnal libraries\n";
+usage+= "Warning: to be used before c++create c++compile c++exec ...";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
+
+kw = "c++import";
+usage = "c++import: Sophya additionnal modules to be use in C++ executor\n";
+usage+= "Usage: c++import module1 ... : set list of modules to be used by executor\n";
+usage+= "       c++import all : set all modules known by executor\n";
+usage+= "       c++import     : reset to no additionnal module\n";
+usage+= "       c++import -?  : list modules currently used in executor\n";
+usage+= "       c++import -?? : list of available modules for executor\n";
+usage+= "Warning: to be used before c++create c++compile c++exec ...";
+mpiac->RegisterCommand(kw, usage, this, hgrp);
 
 kw = "c++prtlevel";
@@ -202,4 +220,20 @@
   FillLinkLibs(tokens);
 
+} else if(kw == "c++import") {
+  if(tokens.size()==1) {
+    if(tokens[0]=="-?")
+      {cout<<"c++import "<<GetModuleImport()<<endl; return(0);}
+    if(tokens[0]=="-??") {
+      cout<<"c++import possibilities :"<<endl;
+      if(mModuleImportDefaultList.size()>0) {
+        for(uint_4 i=0;i<mModuleImportDefaultList.size();i++)
+          cout<<" "<<mModuleImportDefaultList[i];
+        cout<<endl;
+      }
+      return(0);
+    }
+  }
+  FillModuleImport(tokens);
+
 } else if(kw == "c++prtlevel") {
   if(tokens.size()==1) if(tokens[0]=="-?")
@@ -291,8 +325,7 @@
 void CxxExecutor::PutInclude(ofstream& os)
 {
-os<<"#include \"machdefs.h\""<<endl
-  <<endl
-
-  <<"//---- System et stdc++ include files"<<endl
+os<<"#include \"machdefs.h\""<<endl<<endl;
+
+os<<"//---- System et stdc++ include files"<<endl
   <<"#include <stdio.h>"<<endl
   <<"#include <stdlib.h>"<<endl
@@ -323,6 +356,13 @@
   <<"#include \"nobjmgr.h\""<<endl
   <<"#include \"servnobjm.h\""<<endl
-  <<endl
-
+  <<endl;
+
+os<<"//---- Include files from additionnal modules"<<endl;
+if(mIncImportList.size()>0)
+  for(uint_4 i=0;i<mIncImportList.size();i++)
+    os<<"#include \""<<mIncImportList[i]<<"\""<<endl;
+os<<endl;
+
+os<<"//---- Objects and variables saving"<<endl
   <<"#define KeepObj(obj) ___nomobj = #obj; omg.AddObj(obj,___nomobj);"<<endl
   <<"#define KeepVar(var) ___nomobj = #var; omg.GetVarList().Get(___nomobj) = var ;"<<endl
@@ -708,2 +748,42 @@
 return mMyLibs;
 }
+
+/* --Methode-- */
+void CxxExecutor::FillModuleImport(vector<string>& import)
+{
+mModuleImportList.resize(0);
+mIncImportList.resize(0);
+if(import.size()<1) return;
+
+if(import[0]=="all" || import[0]=="All" || import[0]=="ALL") {
+  mModuleImportList = mModuleImportDefaultList;
+} else {
+  for(uint_4 i=0;i<import.size();i++) mModuleImportList.push_back(import[i]);
+}
+
+// Set additionnal Includes
+if(mModuleImportList.size()>0)
+  for(uint_4 i=0;i<mModuleImportList.size();i++) {
+    if(     mModuleImportList[i]=="Samba")  mIncImportList.push_back("samba.h");
+    else if(mModuleImportList[i]=="SkyMap") mIncImportList.push_back("skymap.h");
+    else if(mModuleImportList[i]=="PMixer") mIncImportList.push_back("pmixer.h");
+}
+
+return;
+}
+
+void CxxExecutor::FillModuleImport(string& import)
+{
+mModuleImportList.resize(0);
+vector<string> vsimport;
+FillVStringFrString(import,vsimport,' ');
+FillModuleImport(vsimport);
+}
+
+string CxxExecutor::GetModuleImport(void)
+{
+string dum = "";
+if(mModuleImportList.size()<1) return dum;
+for(uint_4 i=0;i<mModuleImportList.size();i++) dum += mModuleImportList[i] + " ";
+return dum;
+}
