[1224] | 1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
[1237] | 2 | // Classe CxxExecutor : Dynamic C++ compile/execution in piapp
|
---|
[1224] | 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.h>
|
---|
| 13 |
|
---|
| 14 | #include <vector>
|
---|
| 15 | #include <string>
|
---|
| 16 |
|
---|
| 17 | #include "piacmd.h"
|
---|
| 18 | #include "nobjmgr.h"
|
---|
| 19 |
|
---|
| 20 | class CxxExecutor : public CmdExecutor {
|
---|
| 21 | public:
|
---|
| 22 | CxxExecutor(PIACmd* piac, PIStdImgApp* app);
|
---|
| 23 | virtual ~CxxExecutor();
|
---|
[1230] | 24 |
|
---|
[1268] | 25 | virtual int Execute(string& keyw,vector<string>& args, string& toks);
|
---|
[1224] | 26 |
|
---|
[1269] | 27 | inline void SetPrtLevel(uint_2 lp=0) {mPrtLevel = lp;}
|
---|
| 28 |
|
---|
| 29 | int ExecuteCXX(string usercode,string userfct="");
|
---|
| 30 |
|
---|
[1268] | 31 | int CrFile(string cfilename="",string func="");
|
---|
[1224] | 32 | void PutInclude(ofstream& os);
|
---|
| 33 | void PutIncludeUser(ofstream& os);
|
---|
| 34 | void PutObject(ofstream& os);
|
---|
| 35 | void PutVar(ofstream& os);
|
---|
| 36 |
|
---|
[1268] | 37 | int FillUserCode(string& usercode,uint_4 first);
|
---|
[1269] | 38 | int FillUserCode(string filename);
|
---|
[1230] | 39 |
|
---|
[1269] | 40 | int FillUserFctFrS(string userfct="");
|
---|
| 41 | int FillUserFctFrF(string filefctname="");
|
---|
| 42 |
|
---|
[1268] | 43 | int Compile(string rootfilename="");
|
---|
[1224] | 44 | int CrMakefile(void);
|
---|
[1230] | 45 |
|
---|
[1268] | 46 | int Link(string libname="",string func="");
|
---|
| 47 | int Call(string func="");
|
---|
[1224] | 48 |
|
---|
[1230] | 49 | void FillArgs(vector<string>& args);
|
---|
| 50 | void FillArgs(string& args);
|
---|
| 51 | string GetArgs(void);
|
---|
| 52 |
|
---|
| 53 | void FillInclude(vector<string>& inc);
|
---|
| 54 | void FillInclude(string& inc);
|
---|
| 55 | string GetInclude(void);
|
---|
| 56 |
|
---|
| 57 | void FillCompileOpt(vector<string>& copt);
|
---|
| 58 | void FillCompileOpt(string& copt);
|
---|
| 59 | string GetCompileOpt(void);
|
---|
| 60 |
|
---|
| 61 | void FillLinkOpt(vector<string>& lopt);
|
---|
| 62 | void FillLinkOpt(string& lopt);
|
---|
| 63 | string GetLinkOpt(void);
|
---|
| 64 |
|
---|
| 65 | void FillLinkLibs(vector<string>& llibs);
|
---|
| 66 | void FillLinkLibs(string& llibs);
|
---|
| 67 | string GetLinkLibs(void);
|
---|
| 68 |
|
---|
[1224] | 69 | private:
|
---|
[1237] | 70 | string mUserCodeFn;
|
---|
[1268] | 71 | string mUserFctFn;
|
---|
[1224] | 72 | string mCompOpt;
|
---|
| 73 | string mLinkOpt;
|
---|
| 74 | string mMyLibs;
|
---|
| 75 | vector<string> mIncList;
|
---|
| 76 | vector<string> mCallArgs;
|
---|
[1268] | 77 |
|
---|
| 78 | string mDefTmp;
|
---|
| 79 | string mDefRoot;
|
---|
| 80 | string mDefFunc;
|
---|
[1269] | 81 |
|
---|
| 82 | uint_2 mPrtLevel;
|
---|
[1224] | 83 | };
|
---|
| 84 |
|
---|
| 85 | #endif
|
---|