Changeset 1297 in Sophya for trunk/SophyaPI/PIext/cxxexecutor.cc
- Timestamp:
- Nov 7, 2000, 2:08:10 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/cxxexecutor.cc
r1291 r1297 19 19 mIncList.resize(0); 20 20 mCallArgs.resize(0); 21 22 mIncImportList.resize(0); 23 mModuleImportList.resize(0); 24 25 // La liste de tous les modules que l'on peut ajouter 26 mModuleImportDefaultList.resize(0); 27 mModuleImportDefaultList.push_back("Samba"); 28 mModuleImportDefaultList.push_back("SkyMap"); 29 mModuleImportDefaultList.push_back("PMixer"); 21 30 22 31 // Gestion des fichiers par default dans TmpDir … … 74 83 75 84 kw = "c++include"; 76 usage = "c++include: give personnal includes to be used\n";85 usage = "c++include: add personnal includes to be used by executor\n"; 77 86 usage+= "Usage: c++include myinc1.h myinc2.h ...\n"; 78 usage+= " c++include -? : give currentinclude files\n";79 usage+= " c++include : reset currentinclude files\n";80 usage+= "Warning: to be used before c++create ...c++exec...";87 usage+= " c++include -? : list current additionnal include files\n"; 88 usage+= " c++include : reset to no additionnal include files\n"; 89 usage+= "Warning: to be used before c++create c++compile c++exec..."; 81 90 mpiac->RegisterCommand(kw, usage, this, hgrp); 82 91 83 92 kw = "c++compileopt"; 84 usage = "c++compileopt: give additionnal compile options\n";93 usage = "c++compileopt: add personnal compile options\n"; 85 94 usage+= "Usage: c++compileopt -g -O5 -IMy_Inc_Dir ...\n"; 86 usage+= " c++compileopt -? : give currentcompile options\n";87 usage+= " c++compileopt : reset currentcompile options\n";88 usage+= "Warning: to be used before c++c ompile";95 usage+= " c++compileopt -? : list current additionnal compile options\n"; 96 usage+= " c++compileopt : reset to no additionnal compile options\n"; 97 usage+= "Warning: to be used before c++create c++compile c++exec ..."; 89 98 mpiac->RegisterCommand(kw, usage, this, hgrp); 90 99 91 100 kw = "c++linkopt"; 92 usage = "c++linkopt: give additionnal link options\n";101 usage = "c++linkopt: add personnal link options\n"; 93 102 usage+= "Usage: c++linkopt -g -O5 ...\n"; 94 usage+= " c++linkopt -? : give currentlink options\n";95 usage+= " c++linkopt : reset currentlink options\n";96 usage+= "Warning: to be used before c++c ompile";103 usage+= " c++linkopt -? : list current additionnal link options\n"; 104 usage+= " c++linkopt : reset to no additionnal link options\n"; 105 usage+= "Warning: to be used before c++create c++compile c++exec ..."; 97 106 mpiac->RegisterCommand(kw, usage, this, hgrp); 98 107 99 108 kw = "c++mylibs"; 100 usage = "c++mylibs: give additionnal libraries\n";109 usage = "c++mylibs: add personnal libraries\n"; 101 110 usage+= "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 111 usage+= " c++mylibs -? : list current additionnal libraries\n"; 112 usage+= " c++mylibs : reset to no additionnal libraries\n"; 113 usage+= "Warning: to be used before c++create c++compile c++exec ..."; 114 mpiac->RegisterCommand(kw, usage, this, hgrp); 115 116 kw = "c++import"; 117 usage = "c++import: Sophya additionnal modules to be use in C++ executor\n"; 118 usage+= "Usage: c++import module1 ... : set list of modules to be used by executor\n"; 119 usage+= " c++import all : set all modules known by executor\n"; 120 usage+= " c++import : reset to no additionnal module\n"; 121 usage+= " c++import -? : list modules currently used in executor\n"; 122 usage+= " c++import -?? : list of available modules for executor\n"; 123 usage+= "Warning: to be used before c++create c++compile c++exec ..."; 124 mpiac->RegisterCommand(kw, usage, this, hgrp); 107 125 108 126 kw = "c++prtlevel"; … … 202 220 FillLinkLibs(tokens); 203 221 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 204 238 } else if(kw == "c++prtlevel") { 205 239 if(tokens.size()==1) if(tokens[0]=="-?") … … 291 325 void CxxExecutor::PutInclude(ofstream& os) 292 326 { 293 os<<"#include \"machdefs.h\""<<endl 294 <<endl 295 296 <<"//---- System et stdc++ include files"<<endl 327 os<<"#include \"machdefs.h\""<<endl<<endl; 328 329 os<<"//---- System et stdc++ include files"<<endl 297 330 <<"#include <stdio.h>"<<endl 298 331 <<"#include <stdlib.h>"<<endl … … 323 356 <<"#include \"nobjmgr.h\""<<endl 324 357 <<"#include \"servnobjm.h\""<<endl 325 <<endl 326 358 <<endl; 359 360 os<<"//---- Include files from additionnal modules"<<endl; 361 if(mIncImportList.size()>0) 362 for(uint_4 i=0;i<mIncImportList.size();i++) 363 os<<"#include \""<<mIncImportList[i]<<"\""<<endl; 364 os<<endl; 365 366 os<<"//---- Objects and variables saving"<<endl 327 367 <<"#define KeepObj(obj) ___nomobj = #obj; omg.AddObj(obj,___nomobj);"<<endl 328 368 <<"#define KeepVar(var) ___nomobj = #var; omg.GetVarList().Get(___nomobj) = var ;"<<endl … … 708 748 return mMyLibs; 709 749 } 750 751 /* --Methode-- */ 752 void CxxExecutor::FillModuleImport(vector<string>& import) 753 { 754 mModuleImportList.resize(0); 755 mIncImportList.resize(0); 756 if(import.size()<1) return; 757 758 if(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 765 if(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 772 return; 773 } 774 775 void CxxExecutor::FillModuleImport(string& import) 776 { 777 mModuleImportList.resize(0); 778 vector<string> vsimport; 779 FillVStringFrString(import,vsimport,' '); 780 FillModuleImport(vsimport); 781 } 782 783 string CxxExecutor::GetModuleImport(void) 784 { 785 string dum = ""; 786 if(mModuleImportList.size()<1) return dum; 787 for(uint_4 i=0;i<mModuleImportList.size();i++) dum += mModuleImportList[i] + " "; 788 return dum; 789 }
Note:
See TracChangeset
for help on using the changeset viewer.