[1224] | 1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
| 2 | // Classe CxxExecutor : Dynmamic 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.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 |
|
---|
[1224] | 25 | virtual int Execute(string& keyw,vector<string>& args);
|
---|
| 26 |
|
---|
| 27 | int CrFile(string cfilename="cxx_spiapp.cc",string func="usercxx");
|
---|
| 28 | void PutInclude(ofstream& os);
|
---|
| 29 | void PutIncludeUser(ofstream& os);
|
---|
| 30 | void PutObject(ofstream& os);
|
---|
| 31 | void PutVar(ofstream& os);
|
---|
| 32 | void PutUserCode(ofstream& os);
|
---|
| 33 |
|
---|
| 34 | int FillUserCode(vector<string>& usercode,uint_4 first);
|
---|
| 35 | int FillUserCode(string filename);
|
---|
[1230] | 36 |
|
---|
[1224] | 37 | int Compile(string rootfilename="cxx_spiapp");
|
---|
| 38 | int CrMakefile(void);
|
---|
[1230] | 39 |
|
---|
[1224] | 40 | int Link(string libname="cxx_spiapp.so",string func="usercxx");
|
---|
| 41 | int Call(string func="usercxx");
|
---|
| 42 |
|
---|
[1230] | 43 | void FillArgs(vector<string>& args);
|
---|
| 44 | void FillArgs(string& args);
|
---|
| 45 | string GetArgs(void);
|
---|
| 46 |
|
---|
| 47 | void FillInclude(vector<string>& inc);
|
---|
| 48 | void FillInclude(string& inc);
|
---|
| 49 | string GetInclude(void);
|
---|
| 50 |
|
---|
| 51 | void FillCompileOpt(vector<string>& copt);
|
---|
| 52 | void FillCompileOpt(string& copt);
|
---|
| 53 | string GetCompileOpt(void);
|
---|
| 54 |
|
---|
| 55 | void FillLinkOpt(vector<string>& lopt);
|
---|
| 56 | void FillLinkOpt(string& lopt);
|
---|
| 57 | string GetLinkOpt(void);
|
---|
| 58 |
|
---|
| 59 | void FillLinkLibs(vector<string>& llibs);
|
---|
| 60 | void FillLinkLibs(string& llibs);
|
---|
| 61 | string GetLinkLibs(void);
|
---|
| 62 |
|
---|
[1224] | 63 | private:
|
---|
| 64 | string mCompOpt;
|
---|
| 65 | string mLinkOpt;
|
---|
| 66 | string mMyLibs;
|
---|
| 67 | vector<string> mUserCode;
|
---|
| 68 | vector<string> mIncList;
|
---|
| 69 | vector<string> mCallArgs;
|
---|
| 70 | };
|
---|
| 71 |
|
---|
| 72 | #endif
|
---|