Changeset 2181 in Sophya
- Timestamp:
- Sep 4, 2002, 10:58:08 AM (23 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/cxxexecutor.cc
r2123 r2181 15 15 : mUserCodeFn(""), mUserFctFn("") 16 16 , mCompOpt(""), mLinkOpt(""), mMyLibs("") 17 , mDef Tmp(""), mDefRoot("cxx_spiapp"), mDefFunc("usercxx"), mPrtLevel(2)17 , mDefRoot("cxx_spiapp"), mDefFunc("usercxx"), mPrtLevel(2) 18 18 { 19 19 mIncList.resize(0); … … 32 32 mModuleImportDefaultList.push_back("LinAlg"); 33 33 mModuleImportDefaultList.push_back("XAstroPack"); 34 35 // Gestion des fichiers par default dans TmpDir36 NamedObjMgr omg;37 string tmpdir = omg.GetTmpDir();38 if(tmpdir.size()>1) mDefTmp = tmpdir;39 34 40 35 // On enregistre les nouvelles commandes … … 270 265 // Si un nom n'est pas precise alors TmpDir/cxx_spiapp.cc 271 266 { 272 if(cfilename.size()<1) cfilename = mDefTmp+ mDefRoot + ".cc";267 if(cfilename.size()<1) cfilename = TmpDir() + mDefRoot + ".cc"; 273 268 274 269 if(func.size()<1) func = mDefFunc; … … 440 435 <<" = dynamic_cast< "<<obtype<<" * >(omg.GetObj(___nomobj));"<<endl; 441 436 #ifdef SANS_EVOLPLANCK 437 long mExcErr = nullPtrErr; 442 438 os<<"if("<<stmp<<"==NULL) { \n" 443 439 <<" cerr << \"CxxExecutor::PutObject: Non existing object " 444 440 <<" ... please update file \\n \" ;" 445 <<" throw nullPtrErr ; \n } "<<endl;441 <<" throw mExcErr ; \n } "<<endl; 446 442 #else 447 443 os<<"if("<<stmp<<"==NULL) throw NullPtrError" … … 501 497 502 498 // Fill the file with user code 503 mUserCodeFn = mDefTmp+ mDefRoot + ".h";499 mUserCodeFn = TmpDir() + mDefRoot + ".h"; 504 500 ofstream os(mUserCodeFn.c_str(),ios::out); 505 501 if(!os) {cout<<"CxxExecutor::FillUserCode: unable to open " … … 518 514 mUserFctFn = ""; 519 515 if(userfctcode.size()<1) return 0; 520 mUserFctFn = mDefTmp+ mDefRoot + "_fct.h";516 mUserFctFn = TmpDir() + mDefRoot + "_fct.h"; 521 517 ofstream os(mUserFctFn.c_str(),ios::out); 522 518 if(!os) {cout<<"CxxExecutor::FillUserFctFrS: unable to open " … … 559 555 //--------------------------------------------------------// 560 556 { 561 if(rootfilename.size()<1) rootfilename = mDefTmp+ mDefRoot;557 if(rootfilename.size()<1) rootfilename = TmpDir() + mDefRoot; 562 558 if(mPrtLevel>1) cout<<"Compile "<<rootfilename<<endl; 563 559 … … 570 566 CxxCompilerLinker cxx(true,true,true); 571 567 #endif 572 if( mDefTmp.size()>0) cxx.SetTmpDir(mDefTmp);568 if(TmpDir().size()>0) cxx.SetTmpDir(TmpDir()); 573 569 if(mPrtLevel>0) cxx.SetVerbose(true); 574 570 else cxx.SetVerbose(false); … … 619 615 // Ne marche pas si TmpDir != "" 620 616 //{ 621 //string makename = mDefTmp+ mDefRoot + "_Makefile";617 //string makename = TmpDir() + mDefRoot + "_Makefile"; 622 618 //ofstream os(makename.c_str(),ios::out); 623 619 //if(!os) … … 660 656 int CxxExecutor::Link(string libname,string func) 661 657 { 662 if(libname.size()<1) libname = mDefTmp+ mDefRoot + ".so";663 else libname = mDefTmp+ libname;658 if(libname.size()<1) libname = TmpDir() + mDefRoot + ".so"; 659 else libname = TmpDir() + libname; 664 660 if(func.size()<1) func = mDefFunc; 665 661 -
trunk/SophyaPI/PIext/cxxexecutor.h
r1297 r2181 86 86 87 87 88 string mDefTmp; 88 // string mDefTmp; remplace par la methode TmpDir() - Reza 4/9/02 89 inline string const& TmpDir() { NamedObjMgr omg; return omg.GetTmpDir(); } 89 90 string mDefRoot; 90 91 string mDefFunc;
Note:
See TracChangeset
for help on using the changeset viewer.