Changeset 1297 in Sophya for trunk/SophyaPI/PIext/cxxexecutor.cc


Ignore:
Timestamp:
Nov 7, 2000, 2:08:10 PM (25 years ago)
Author:
ercodmgr
Message:

1-/ complete color map in pihisto2d
2-/ introcution de la notion de module additionnel

dans le C++EXECUTOR cmv 7/11/2000

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/cxxexecutor.cc

    r1291 r1297  
    1919mIncList.resize(0);
    2020mCallArgs.resize(0);
     21
     22mIncImportList.resize(0);
     23mModuleImportList.resize(0);
     24
     25// La liste de tous les modules que l'on peut ajouter
     26mModuleImportDefaultList.resize(0);
     27mModuleImportDefaultList.push_back("Samba");
     28mModuleImportDefaultList.push_back("SkyMap");
     29mModuleImportDefaultList.push_back("PMixer");
    2130
    2231// Gestion des fichiers par default dans TmpDir
     
    7483
    7584kw = "c++include";
    76 usage = "c++include: give personnal includes to be used\n";
     85usage = "c++include: add personnal includes to be used by executor\n";
    7786usage+= "Usage: c++include myinc1.h myinc2.h ...\n";
    78 usage+= "       c++include -? : give current include files\n";
    79 usage+= "       c++include    : reset current include files\n";
    80 usage+= "Warning: to be used before c++create... c++exec...";
     87usage+= "       c++include -? : list current additionnal include files\n";
     88usage+= "       c++include    : reset to no additionnal include files\n";
     89usage+= "Warning: to be used before c++create c++compile c++exec...";
    8190mpiac->RegisterCommand(kw, usage, this, hgrp);
    8291
    8392kw = "c++compileopt";
    84 usage = "c++compileopt: give additionnal compile options\n";
     93usage = "c++compileopt: add personnal compile options\n";
    8594usage+= "Usage: c++compileopt -g -O5 -IMy_Inc_Dir ...\n";
    86 usage+= "       c++compileopt -? : give current compile options\n";
    87 usage+= "       c++compileopt    : reset current compile options\n";
    88 usage+= "Warning: to be used before c++compile";
     95usage+= "       c++compileopt -? : list current additionnal compile options\n";
     96usage+= "       c++compileopt    : reset to no additionnal compile options\n";
     97usage+= "Warning: to be used before c++create c++compile c++exec ...";
    8998mpiac->RegisterCommand(kw, usage, this, hgrp);
    9099
    91100kw = "c++linkopt";
    92 usage = "c++linkopt: give additionnal link options\n";
     101usage = "c++linkopt: add personnal link options\n";
    93102usage+= "Usage: c++linkopt -g -O5 ...\n";
    94 usage+= "       c++linkopt -? : give current link options\n";
    95 usage+= "       c++linkopt    : reset current link options\n";
    96 usage+= "Warning: to be used before c++compile";
     103usage+= "       c++linkopt -? : list current additionnal link options\n";
     104usage+= "       c++linkopt    : reset to no additionnal link options\n";
     105usage+= "Warning: to be used before c++create c++compile c++exec ...";
    97106mpiac->RegisterCommand(kw, usage, this, hgrp);
    98107
    99108kw = "c++mylibs";
    100 usage = "c++mylibs: give additionnal libraries\n";
     109usage = "c++mylibs: add personnal libraries\n";
    101110usage+= "Usage: c++mylibs -LMy_Lib_Dir -lmylib1 -lmylib2 ...\n";
    102 usage+= "       c++mylibs -? : give current additionnal libraries\n";
    103 usage+= "       c++mylibs    : reset current additionnal libraries\n";
    104 usage+= "Warning: to be used before c++compile";
    105 mpiac->RegisterCommand(kw, usage, this, hgrp);
    106 
     111usage+= "       c++mylibs -? : list current additionnal libraries\n";
     112usage+= "       c++mylibs    : reset to no additionnal libraries\n";
     113usage+= "Warning: to be used before c++create c++compile c++exec ...";
     114mpiac->RegisterCommand(kw, usage, this, hgrp);
     115
     116kw = "c++import";
     117usage = "c++import: Sophya additionnal modules to be use in C++ executor\n";
     118usage+= "Usage: c++import module1 ... : set list of modules to be used by executor\n";
     119usage+= "       c++import all : set all modules known by executor\n";
     120usage+= "       c++import     : reset to no additionnal module\n";
     121usage+= "       c++import -?  : list modules currently used in executor\n";
     122usage+= "       c++import -?? : list of available modules for executor\n";
     123usage+= "Warning: to be used before c++create c++compile c++exec ...";
     124mpiac->RegisterCommand(kw, usage, this, hgrp);
    107125
    108126kw = "c++prtlevel";
     
    202220  FillLinkLibs(tokens);
    203221
     222} else if(kw == "c++import") {
     223  if(tokens.size()==1) {
     224    if(tokens[0]=="-?")
     225      {cout<<"c++import "<<GetModuleImport()<<endl; return(0);}
     226    if(tokens[0]=="-??") {
     227      cout<<"c++import possibilities :"<<endl;
     228      if(mModuleImportDefaultList.size()>0) {
     229        for(uint_4 i=0;i<mModuleImportDefaultList.size();i++)
     230          cout<<" "<<mModuleImportDefaultList[i];
     231        cout<<endl;
     232      }
     233      return(0);
     234    }
     235  }
     236  FillModuleImport(tokens);
     237
    204238} else if(kw == "c++prtlevel") {
    205239  if(tokens.size()==1) if(tokens[0]=="-?")
     
    291325void CxxExecutor::PutInclude(ofstream& os)
    292326{
    293 os<<"#include \"machdefs.h\""<<endl
    294   <<endl
    295 
    296   <<"//---- System et stdc++ include files"<<endl
     327os<<"#include \"machdefs.h\""<<endl<<endl;
     328
     329os<<"//---- System et stdc++ include files"<<endl
    297330  <<"#include <stdio.h>"<<endl
    298331  <<"#include <stdlib.h>"<<endl
     
    323356  <<"#include \"nobjmgr.h\""<<endl
    324357  <<"#include \"servnobjm.h\""<<endl
    325   <<endl
    326 
     358  <<endl;
     359
     360os<<"//---- Include files from additionnal modules"<<endl;
     361if(mIncImportList.size()>0)
     362  for(uint_4 i=0;i<mIncImportList.size();i++)
     363    os<<"#include \""<<mIncImportList[i]<<"\""<<endl;
     364os<<endl;
     365
     366os<<"//---- Objects and variables saving"<<endl
    327367  <<"#define KeepObj(obj) ___nomobj = #obj; omg.AddObj(obj,___nomobj);"<<endl
    328368  <<"#define KeepVar(var) ___nomobj = #var; omg.GetVarList().Get(___nomobj) = var ;"<<endl
     
    708748return mMyLibs;
    709749}
     750
     751/* --Methode-- */
     752void CxxExecutor::FillModuleImport(vector<string>& import)
     753{
     754mModuleImportList.resize(0);
     755mIncImportList.resize(0);
     756if(import.size()<1) return;
     757
     758if(import[0]=="all" || import[0]=="All" || import[0]=="ALL") {
     759  mModuleImportList = mModuleImportDefaultList;
     760} else {
     761  for(uint_4 i=0;i<import.size();i++) mModuleImportList.push_back(import[i]);
     762}
     763
     764// Set additionnal Includes
     765if(mModuleImportList.size()>0)
     766  for(uint_4 i=0;i<mModuleImportList.size();i++) {
     767    if(     mModuleImportList[i]=="Samba")  mIncImportList.push_back("samba.h");
     768    else if(mModuleImportList[i]=="SkyMap") mIncImportList.push_back("skymap.h");
     769    else if(mModuleImportList[i]=="PMixer") mIncImportList.push_back("pmixer.h");
     770}
     771
     772return;
     773}
     774
     775void CxxExecutor::FillModuleImport(string& import)
     776{
     777mModuleImportList.resize(0);
     778vector<string> vsimport;
     779FillVStringFrString(import,vsimport,' ');
     780FillModuleImport(vsimport);
     781}
     782
     783string CxxExecutor::GetModuleImport(void)
     784{
     785string dum = "";
     786if(mModuleImportList.size()<1) return dum;
     787for(uint_4 i=0;i<mModuleImportList.size();i++) dum += mModuleImportList[i] + " ";
     788return dum;
     789}
Note: See TracChangeset for help on using the changeset viewer.