source: Sophya/trunk/SophyaPI/PIext/cxxexecutor.h@ 2615

Last change on this file since 2615 was 2322, checked in by cmv, 23 years ago
  • passage xxstream.h en xxstream
  • compile avec gcc_3.2, gcc_2.96 et cxx En 3.2 le seek from ::end semble marcher (voir Eval/COS/pbseekios.cc)

rz+cmv 11/2/2003

File size: 2.6 KB
Line 
1// This may look like C code, but it is really -*- C++ -*-
2// Classe CxxExecutor : Dynamic C++ compile/execution in piapp
3// (c) DAPNIA (CEA) LAL (IN2P3/CNRS)
4// C. Magneville 10/2000
5
6#ifndef CXXEXECUTOR_H_SEEN
7#define CXXEXECUTOR_H_SEEN
8
9#include "machdefs.h"
10#include <stdio.h>
11#include <stdlib.h>
12#include <iostream>
13
14#include <vector>
15#include <string>
16
17#include "piacmd.h"
18#include "nobjmgr.h"
19
20class CxxExecutor : public CmdExecutor {
21public:
22 CxxExecutor(PIACmd* piac, PIStdImgApp* app);
23 virtual ~CxxExecutor();
24
25 virtual int Execute(string& keyw,vector<string>& args, string& toks);
26
27 inline void SetPrtLevel(uint_2 lp=2) {mPrtLevel = lp;}
28
29 int ExecuteCXX(string usercode,string userfct="");
30
31 // if true , declare ObjMgr variables as $varname
32 inline void DeclareObjMgrVar(bool fg=false) { mFgPutVar=fg; }
33
34 int CrFile(string cfilename="",string func="");
35 void PutInclude(ofstream& os);
36 void PutIncludeUser(ofstream& os);
37 void PutObject(ofstream& os);
38 void PutVar(ofstream& os);
39
40 int FillUserCode(string& usercode,uint_4 first);
41 int FillUserCode(string filename);
42
43 int FillUserFctFrS(string userfctcode="");
44 int FillUserFctFrF(string filefctname="");
45
46 int Compile(string rootfilename="");
47 /* int CrMakefile(void); */
48
49 int Link(string libname="",string func="");
50 int Call(string func="");
51
52 void FillArgs(vector<string>& args);
53 void FillArgs(string& args);
54 string GetArgs(void);
55
56 void FillInclude(vector<string>& inc);
57 void FillInclude(string& inc);
58 string GetInclude(void);
59
60 void FillCompileOpt(vector<string>& copt);
61 void FillCompileOpt(string& copt);
62 string GetCompileOpt(void);
63
64 void FillLinkOpt(vector<string>& lopt);
65 void FillLinkOpt(string& lopt);
66 string GetLinkOpt(void);
67
68 void FillLinkLibs(vector<string>& llibs);
69 void FillLinkLibs(string& llibs);
70 string GetLinkLibs(void);
71
72 void FillModuleImport(vector<string>& import);
73 void FillModuleImport(string& import);
74 string GetModuleImport(void);
75
76private:
77 string mUserCodeFn;
78 string mUserFctFn;
79 string mCompOpt;
80 string mLinkOpt;
81 string mMyLibs;
82 vector<string> mIncList;
83 vector<string> mCallArgs;
84
85 // Import des modules
86 vector<string> mIncImportList;
87 vector<string> mModuleImportList;
88 vector<string> mModuleImportDefaultList;
89
90
91 // string mDefTmp; remplace par la methode TmpDir() - Reza 4/9/02
92 inline string const& TmpDir() { NamedObjMgr omg; return omg.GetTmpDir(); }
93 string mDefRoot;
94 string mDefFunc;
95
96 uint_2 mPrtLevel;
97 bool mFgPutVar; // if true , declare ObjMgr variables as $varname, default=false
98};
99
100#endif
Note: See TracBrowser for help on using the repository browser.