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

Last change on this file since 4037 was 2755, checked in by ansari, 20 years ago

1/ Correction bug trace des lignes ds PINTuple
2/ Ajout methode IsThreadable() (declaration conformite thread separe pour certaines commandes) ds baseexecut.h .cc (plot2d plot3d ...) , ds pawexecut.cc (n/plot ...) et ds cxxexecutor.h .cc (c++exec c++execfrf ...)
3/ Ajout de ZMutex (et ZSync) pour la gestion des commandes threadable - ds les
executeurs et ds servnobjm.h .cc
4/ bug d'execution en thread identifie et corrige ds nobjmgr.h .cc (ajout des
methodes GetObj_P() GetObjAdapter_P() et ReadObj_P()
5/ Ajout de l'appel a ZSync::NOp() pour eviter les warnings 'unused variable zs ...'

Reza 23 Mai 2005

File size: 2.7 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 virtual bool IsThreadable(string const & keyw);
27
28 inline void SetPrtLevel(uint_2 lp=2) {mPrtLevel = lp;}
29
30 int ExecuteCXX(string usercode,string userfct="");
31
32 // if true , declare ObjMgr variables as $varname
33 inline void DeclareObjMgrVar(bool fg=false) { mFgPutVar=fg; }
34
35 int CrFile(string cfilename="",string func="");
36 void PutInclude(ofstream& os);
37 void PutIncludeUser(ofstream& os);
38 void PutObject(ofstream& os);
39 void PutVar(ofstream& os);
40
41 int FillUserCode(string& usercode,uint_4 first);
42 int FillUserCode(string filename);
43
44 int FillUserFctFrS(string userfctcode="");
45 int FillUserFctFrF(string filefctname="");
46
47 int Compile(string rootfilename="");
48 /* int CrMakefile(void); */
49
50 int Link(string libname="",string func="");
51 int Call(string func="");
52
53 void FillArgs(vector<string>& args);
54 void FillArgs(string& args);
55 string GetArgs(void);
56
57 void FillInclude(vector<string>& inc);
58 void FillInclude(string& inc);
59 string GetInclude(void);
60
61 void FillCompileOpt(vector<string>& copt);
62 void FillCompileOpt(string& copt);
63 string GetCompileOpt(void);
64
65 void FillLinkOpt(vector<string>& lopt);
66 void FillLinkOpt(string& lopt);
67 string GetLinkOpt(void);
68
69 void FillLinkLibs(vector<string>& llibs);
70 void FillLinkLibs(string& llibs);
71 string GetLinkLibs(void);
72
73 void FillModuleImport(vector<string>& import);
74 void FillModuleImport(string& import);
75 string GetModuleImport(void);
76
77private:
78 string mUserCodeFn;
79 string mUserFctFn;
80 string mCompOpt;
81 string mLinkOpt;
82 string mMyLibs;
83 vector<string> mIncList;
84 vector<string> mCallArgs;
85
86 // Import des modules
87 vector<string> mIncImportList;
88 vector<string> mModuleImportList;
89 vector<string> mModuleImportDefaultList;
90
91
92 // string mDefTmp; remplace par la methode TmpDir() - Reza 4/9/02
93 inline string const& TmpDir() { NamedObjMgr omg; return omg.GetTmpDir(); }
94 string mDefRoot;
95 string mDefFunc;
96
97 uint_2 mPrtLevel;
98 bool mFgPutVar; // if true , declare ObjMgr variables as $varname, default=false
99
100 // Mutex de controle de thread pour dynamic-link
101 ZMutex mutx_cxxe;
102
103};
104
105#endif
Note: See TracBrowser for help on using the repository browser.