[165] | 1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
| 2 | // Classe interpreteur de commande pour piapp
|
---|
| 3 | // Reza Aout 97 , Juillet,Aout 98
|
---|
| 4 | // LAL-IN2P3/CNRS
|
---|
| 5 |
|
---|
| 6 | #ifndef PIACMD_H_SEEN
|
---|
| 7 | #define PIACMD_H_SEEN
|
---|
| 8 |
|
---|
[293] | 9 | #include "machdefs.h"
|
---|
[2463] | 10 | #include "commander.h"
|
---|
[165] | 11 | #include <string>
|
---|
[293] | 12 | #include <vector>
|
---|
[2536] | 13 | #include <queue>
|
---|
[2486] | 14 | #include "zthread.h"
|
---|
[165] | 15 |
|
---|
| 16 | #include "dlftypes.h"
|
---|
| 17 |
|
---|
[293] | 18 | // Forward declaration of some classes ...
|
---|
[165] | 19 | class NamedObjMgr;
|
---|
| 20 | class PIStdImgApp;
|
---|
[1251] | 21 |
|
---|
| 22 | class PIAHelpWind; // Fenetre d'aide en ligne
|
---|
| 23 | class CxxExecWind; // Fenetre pour CxxExecutor
|
---|
| 24 | class CxxOptionWind; // Option de CxxExecutor
|
---|
| 25 |
|
---|
[293] | 26 | // ---------------------------------------------------------------------
|
---|
| 27 | // Classe Interpreteur de commande, gestionnaire de module chargeable,
|
---|
| 28 | // et de fonctions dynamiquement linke pour PIStdImgApp
|
---|
| 29 | // Permet de gerer plusieurs Interpreter differents
|
---|
| 30 | // ---------------------------------------------------------------------
|
---|
[165] | 31 |
|
---|
[330] | 32 |
|
---|
[2486] | 33 | class PIACmd : public Commander, public ZThread {
|
---|
[165] | 34 | public:
|
---|
[2463] | 35 | // static PIACmd* GetInterpreter();
|
---|
[165] | 36 |
|
---|
[2490] | 37 | PIACmd(PIStdImgApp* app);
|
---|
[293] | 38 | virtual ~PIACmd();
|
---|
| 39 |
|
---|
[2486] | 40 | // Thread execution <ZThread>
|
---|
| 41 | virtual void run();
|
---|
| 42 | void AddInputLine(string const & line);
|
---|
| 43 | void StopThread();
|
---|
| 44 | inline bool isRunning(int& ninp)
|
---|
| 45 | { ninp = inputlines.size(); return fg_threxe; }
|
---|
| 46 | // ---- FIN ---- Thread execution <ZThread>
|
---|
[293] | 47 |
|
---|
[2463] | 48 | void ShowHelpWindow();
|
---|
| 49 | void ShowCxxOptionWindow();
|
---|
| 50 | void ShowCxxExecWindow();
|
---|
[293] | 51 |
|
---|
[2463] | 52 | // inline CmdInterpreter* CurrentInterpreter() { return(curcmdi); }
|
---|
[293] | 53 |
|
---|
[2465] | 54 | inline CmdExecutor* BaseExecutor() { return(basexec); }
|
---|
| 55 | inline CmdExecutor* ContExecutor() { return(cntexec); } //_OP_
|
---|
| 56 | inline PIStdImgApp* GetImgApp() { return(mImgApp); }
|
---|
[293] | 57 |
|
---|
[330] | 58 | // Pour utilisation par PIAHelpWind uniquement
|
---|
| 59 | virtual void UpdateHelpList(PIAHelpWind* hw, int gid);
|
---|
| 60 |
|
---|
[293] | 61 | protected:
|
---|
[2474] | 62 | virtual int ExecuteCommandLine(string & kw, vector<string> & tokens,
|
---|
| 63 | string & toks);
|
---|
| 64 |
|
---|
[2465] | 65 | virtual bool CheckHelpGrp(string& grp, int& gid, string& desc);
|
---|
| 66 | virtual void InitializeHelpWindowMenu();
|
---|
[330] | 67 |
|
---|
[2463] | 68 | virtual void SetCurrentPrompt(const char* pr);
|
---|
| 69 | virtual void ShowMessage(const char * msg, int att);
|
---|
[2236] | 70 |
|
---|
[165] | 71 | NamedObjMgr* mObjMgr;
|
---|
| 72 | PIStdImgApp* mImgApp;
|
---|
| 73 |
|
---|
[2781] | 74 | CmdExecutor* basexec; // base command executor
|
---|
| 75 | CmdExecutor* graphexec; // graphic command executor
|
---|
[1224] | 76 | CmdExecutor* fitexec; // Fit command executor
|
---|
| 77 | CmdExecutor* pawexec; // paw-like command executor
|
---|
| 78 | CmdExecutor* cxxexec; // on-line c++ compile/execution command executor
|
---|
[293] | 79 |
|
---|
[1828] | 80 | CmdExecutor *cntexec; // contour executor _OP_
|
---|
[1920] | 81 | CmdExecutor *flwexec; // flow chart executor _OP_
|
---|
[1828] | 82 |
|
---|
[293] | 83 | // Fenetre d'aide interactive
|
---|
| 84 | PIAHelpWind* helpwin;
|
---|
[2465] | 85 | bool helpwin_initdone;
|
---|
| 86 | // Fenetres d'execution interactive de C++ , options correspondantes
|
---|
[1251] | 87 | CxxExecWind* cxxexwin;
|
---|
| 88 | CxxOptionWind* cxxoptwin;
|
---|
[2486] | 89 |
|
---|
[2536] | 90 | // Queue des entrees et controle de thread
|
---|
| 91 | queue<string> inputlines;
|
---|
[2486] | 92 | bool fg_thrstop;
|
---|
| 93 | ZMutex mutx_inps;
|
---|
| 94 | bool fg_threxe;
|
---|
| 95 |
|
---|
[165] | 96 | };
|
---|
| 97 |
|
---|
[293] | 98 |
|
---|
| 99 |
|
---|
[165] | 100 | #endif
|
---|