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


Ignore:
Timestamp:
Oct 27, 2000, 6:30:28 PM (25 years ago)
Author:
ercodmgr
Message:

Reorganisation classe PIACmd (interpreteur de piapp) - Utilisation des services de NameObjMgr pour les variables de l'interpreteur - Reza 27/10/2000

File:
1 edited

Legend:

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

    r1247 r1262  
    9696mpiac->RegisterCommand(kw, usage, this, hgrp);
    9797
    98 
    99 
    100 //// A VIRER quand variable de objmanager OK  --> Pour Reza
    101 kw = "c++setvar";
    102 usage = "c++setvar: Setting test variable \n";
    103 usage+= "Usage: c++setvar varname varcontent ";
    104 mpiac->RegisterCommand(kw, usage, this, hgrp);
    105 
    106 kw = "c++getvar";
    107 usage = "c++getvar: Getting test variable content\n";
    108 usage+= "Usage: c++getvar varname ";
    109 mpiac->RegisterCommand(kw, usage, this, hgrp);
    110 
    111 kw = "c++varlist";
    112 usage = "c++getvar: Printing test variable list\n";
    113 usage+= "Usage: c++varlist  ";
    114 mpiac->RegisterCommand(kw, usage, this, hgrp);
    115 //// A VIRER quand variable de objmanager OK  --> Pour Reza
    11698
    11799}
     
    222204
    223205/* --Methode-- */
     206int CxxExecutor::ExecuteCxx(string const & code)
     207{
     208  int rc;
     209
     210  mUserCodeFn = "";
     211  mUserCodeFn = "cxx_spiapp.h";
     212  ofstream os(mUserCodeFn.c_str(),ios::out);
     213  if(!os) {cout<<"CxxExecutor::ExecuteCxx(): unable to open "
     214               <<mUserCodeFn<<endl;  mUserCodeFn = ""; return 1;}
     215 
     216  os << code ;
     217  os << endl ;
     218
     219  cout<<"CxxExecutor: User code filled from standard input into "
     220      <<mUserCodeFn<<endl;
     221 
     222  rc = CrFile();   if(rc) return(1);
     223  rc = Compile();  if(rc) return(1);
     224  rc = Link();     if(rc) return(1);
     225  rc = Call();     if(rc) return(1);
     226  return(rc);
     227}
     228
     229/* --Methode-- */
    224230int CxxExecutor::CrFile(string cfilename,string func)
    225231{
     
    362368for(it=varlist.Begin(); it!=varlist.End(); it++) {
    363369  string key = (*it).first;
    364   os<<"___nomobj = \""<<key<<"\";"<<endl;
    365   os<<"MuTyV & $"<<key<<" = omg.GetVarList().Get(___nomobj);"<<endl;
     370  if (isalpha(key[0]) ) {
     371    os<<"___nomobj = \""<<key<<"\";"<<endl;
     372    os<<"MuTyV & $"<<key<<" = omg.GetVarList().Get(___nomobj);"<<endl;
     373  }
    366374}
    367375
Note: See TracChangeset for help on using the changeset viewer.