| 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(); | 
|---|
| 24 | virtual int Execute(string& keyw,vector<string>& args); | 
|---|
| 25 |  | 
|---|
| 26 | int  CrFile(string cfilename="cxx_spiapp.cc",string func="usercxx"); | 
|---|
| 27 | void PutInclude(ofstream& os); | 
|---|
| 28 | void PutIncludeUser(ofstream& os); | 
|---|
| 29 | void PutObject(ofstream& os); | 
|---|
| 30 | void PutVar(ofstream& os); | 
|---|
| 31 | void PutUserCode(ofstream& os); | 
|---|
| 32 |  | 
|---|
| 33 | int  FillUserCode(vector<string>& usercode,uint_4 first); | 
|---|
| 34 | int  FillUserCode(string filename); | 
|---|
| 35 | int  Compile(string rootfilename="cxx_spiapp"); | 
|---|
| 36 | int CrMakefile(void); | 
|---|
| 37 | int  Link(string libname="cxx_spiapp.so",string func="usercxx"); | 
|---|
| 38 | int  Call(string func="usercxx"); | 
|---|
| 39 | //int  FillArgs(vector<string>& args); | 
|---|
| 40 | //int  FillArgs(string& args); | 
|---|
| 41 | //string GetArgs(void); | 
|---|
| 42 | // etc... | 
|---|
| 43 | //int  FillInclude(vector<string>& inc); | 
|---|
| 44 | //int  FillCompileOpt(vector<string>& copt); | 
|---|
| 45 | //int  FillLinkOpt(vector<string>& lopt); | 
|---|
| 46 | //int  FillLinkLibs(vector<string>& llibs); | 
|---|
| 47 |  | 
|---|
| 48 | private: | 
|---|
| 49 | string mCompOpt; | 
|---|
| 50 | string mLinkOpt; | 
|---|
| 51 | string mMyLibs; | 
|---|
| 52 | vector<string> mUserCode; | 
|---|
| 53 | vector<string> mIncList; | 
|---|
| 54 | vector<string> mCallArgs; | 
|---|
| 55 | }; | 
|---|
| 56 |  | 
|---|
| 57 |  | 
|---|
| 58 | #endif | 
|---|