Changeset 2181 in Sophya


Ignore:
Timestamp:
Sep 4, 2002, 10:58:08 AM (23 years ago)
Author:
ansari
Message:

Correction TmpDir() ds cxxexecutor.cc + exception Peida nullPtrError en long , Reza 04/09/2002

Location:
trunk/SophyaPI/PIext
Files:
2 edited

Legend:

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

    r2123 r2181  
    1515  : mUserCodeFn(""), mUserFctFn("")
    1616  , mCompOpt(""), mLinkOpt(""), mMyLibs("")
    17   , mDefTmp(""), mDefRoot("cxx_spiapp"), mDefFunc("usercxx"), mPrtLevel(2)
     17  , mDefRoot("cxx_spiapp"), mDefFunc("usercxx"), mPrtLevel(2)
    1818{
    1919mIncList.resize(0);
     
    3232mModuleImportDefaultList.push_back("LinAlg");
    3333mModuleImportDefaultList.push_back("XAstroPack");
    34 
    35 // Gestion des fichiers par default dans TmpDir
    36 NamedObjMgr omg;
    37 string tmpdir = omg.GetTmpDir();
    38 if(tmpdir.size()>1) mDefTmp = tmpdir;
    3934
    4035// On enregistre les nouvelles commandes
     
    270265// Si un nom n'est pas precise alors TmpDir/cxx_spiapp.cc
    271266{
    272 if(cfilename.size()<1) cfilename = mDefTmp + mDefRoot + ".cc";
     267if(cfilename.size()<1) cfilename = TmpDir() + mDefRoot + ".cc";
    273268
    274269if(func.size()<1) func = mDefFunc;
     
    440435    <<" = dynamic_cast< "<<obtype<<" * >(omg.GetObj(___nomobj));"<<endl;
    441436#ifdef SANS_EVOLPLANCK
     437  long mExcErr = nullPtrErr;
    442438  os<<"if("<<stmp<<"==NULL) { \n"
    443439    <<" cerr << \"CxxExecutor::PutObject: Non existing object "
    444440    <<" ... please update file \\n \" ;"
    445     <<" throw nullPtrErr ; \n } "<<endl;
     441    <<" throw mExcErr ; \n } "<<endl;
    446442#else
    447443  os<<"if("<<stmp<<"==NULL) throw NullPtrError"
     
    501497
    502498// Fill the file with user code
    503 mUserCodeFn = mDefTmp + mDefRoot + ".h";
     499mUserCodeFn = TmpDir() + mDefRoot + ".h";
    504500ofstream os(mUserCodeFn.c_str(),ios::out);
    505501if(!os) {cout<<"CxxExecutor::FillUserCode: unable to open "
     
    518514mUserFctFn  = "";
    519515if(userfctcode.size()<1) return 0;
    520 mUserFctFn  = mDefTmp + mDefRoot + "_fct.h";
     516mUserFctFn  = TmpDir() + mDefRoot + "_fct.h";
    521517ofstream os(mUserFctFn.c_str(),ios::out);
    522518if(!os) {cout<<"CxxExecutor::FillUserFctFrS: unable to open "
     
    559555//--------------------------------------------------------//
    560556{
    561 if(rootfilename.size()<1) rootfilename = mDefTmp + mDefRoot;
     557if(rootfilename.size()<1) rootfilename = TmpDir() + mDefRoot;
    562558if(mPrtLevel>1) cout<<"Compile "<<rootfilename<<endl;
    563559
     
    570566CxxCompilerLinker cxx(true,true,true);
    571567#endif
    572 if(mDefTmp.size()>0) cxx.SetTmpDir(mDefTmp);
     568if(TmpDir().size()>0) cxx.SetTmpDir(TmpDir());
    573569if(mPrtLevel>0) cxx.SetVerbose(true);
    574570  else          cxx.SetVerbose(false);
     
    619615// Ne marche pas si TmpDir != ""
    620616//{
    621 //string makename = mDefTmp + mDefRoot + "_Makefile";
     617//string makename = TmpDir() + mDefRoot + "_Makefile";
    622618//ofstream os(makename.c_str(),ios::out);
    623619//if(!os)
     
    660656int CxxExecutor::Link(string libname,string func)
    661657{
    662 if(libname.size()<1) libname = mDefTmp + mDefRoot + ".so";
    663   else               libname = mDefTmp + libname;
     658if(libname.size()<1) libname = TmpDir() + mDefRoot + ".so";
     659  else               libname = TmpDir() + libname;
    664660if(func.size()<1) func = mDefFunc;
    665661
  • trunk/SophyaPI/PIext/cxxexecutor.h

    r1297 r2181  
    8686
    8787
    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(); }
    8990  string mDefRoot;
    9091  string mDefFunc;
Note: See TracChangeset for help on using the changeset viewer.