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

Last change on this file since 3520 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
RevLine 
[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>
[2322]12#include <iostream>
[1224]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();
[1230]24
[1268]25 virtual int Execute(string& keyw,vector<string>& args, string& toks);
[2755]26 virtual bool IsThreadable(string const & keyw);
[1224]27
[1289]28 inline void SetPrtLevel(uint_2 lp=2) {mPrtLevel = lp;}
[1269]29
30 int ExecuteCXX(string usercode,string userfct="");
31
[2287]32 // if true , declare ObjMgr variables as $varname
33 inline void DeclareObjMgrVar(bool fg=false) { mFgPutVar=fg; }
34
[1268]35 int CrFile(string cfilename="",string func="");
[1224]36 void PutInclude(ofstream& os);
37 void PutIncludeUser(ofstream& os);
38 void PutObject(ofstream& os);
39 void PutVar(ofstream& os);
40
[1268]41 int FillUserCode(string& usercode,uint_4 first);
[1269]42 int FillUserCode(string filename);
[1230]43
[1287]44 int FillUserFctFrS(string userfctcode="");
[1269]45 int FillUserFctFrF(string filefctname="");
46
[1268]47 int Compile(string rootfilename="");
[1287]48 /* int CrMakefile(void); */
[1230]49
[1268]50 int Link(string libname="",string func="");
51 int Call(string func="");
[1224]52
[1230]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
[1297]73 void FillModuleImport(vector<string>& import);
74 void FillModuleImport(string& import);
75 string GetModuleImport(void);
76
[1224]77private:
[1237]78 string mUserCodeFn;
[1268]79 string mUserFctFn;
[1224]80 string mCompOpt;
81 string mLinkOpt;
82 string mMyLibs;
83 vector<string> mIncList;
84 vector<string> mCallArgs;
[1268]85
[1297]86 // Import des modules
87 vector<string> mIncImportList;
88 vector<string> mModuleImportList;
89 vector<string> mModuleImportDefaultList;
90
91
[2181]92 // string mDefTmp; remplace par la methode TmpDir() - Reza 4/9/02
93 inline string const& TmpDir() { NamedObjMgr omg; return omg.GetTmpDir(); }
[1268]94 string mDefRoot;
95 string mDefFunc;
[1269]96
97 uint_2 mPrtLevel;
[2287]98 bool mFgPutVar; // if true , declare ObjMgr variables as $varname, default=false
[2755]99
100 // Mutex de controle de thread pour dynamic-link
101 ZMutex mutx_cxxe;
102
[1224]103};
104
105#endif
Note: See TracBrowser for help on using the repository browser.