| 1 | // This may look like C code, but it is really -*- C++ -*-
|
|---|
| 2 | // Classe de services destinee a NamedObjMgr pour piapp
|
|---|
| 3 | // Reza Aout 98
|
|---|
| 4 | // CEA-DAPNIA LAL-IN2P3/CNRS
|
|---|
| 5 |
|
|---|
| 6 | #ifndef SERVNOBJM_H_SEEN
|
|---|
| 7 | #define SERVNOBJM_H_SEEN
|
|---|
| 8 |
|
|---|
| 9 | #include "machdefs.h"
|
|---|
| 10 | #include <string>
|
|---|
| 11 | #include <list>
|
|---|
| 12 | #include <map>
|
|---|
| 13 | #if defined(__KCC__)
|
|---|
| 14 | using std::string ;
|
|---|
| 15 | #include <list.h>
|
|---|
| 16 | #include <map.h>
|
|---|
| 17 | #endif
|
|---|
| 18 |
|
|---|
| 19 | #include "pdlmgr.h"
|
|---|
| 20 | #include "dlftypes.h"
|
|---|
| 21 | #include "nomgadapter.h"
|
|---|
| 22 |
|
|---|
| 23 | class NTuple;
|
|---|
| 24 | class Histo;
|
|---|
| 25 | class Histo2D;
|
|---|
| 26 | class HProf;
|
|---|
| 27 | class PIStdImgApp;
|
|---|
| 28 |
|
|---|
| 29 | class Services2NObjMgr {
|
|---|
| 30 | public:
|
|---|
| 31 | Services2NObjMgr(PIStdImgApp* app, string& tmpdir);
|
|---|
| 32 | ~Services2NObjMgr();
|
|---|
| 33 |
|
|---|
| 34 | // Pour enregistrer les objets de donnees et leurs adaptateurs
|
|---|
| 35 | void RegisterClass(AnyDataObj* o, NObjMgrAdapter* oa);
|
|---|
| 36 | // Pour recuperer l'adaptateur pour un objet o
|
|---|
| 37 | NObjMgrAdapter* GetAdapter(AnyDataObj* o);
|
|---|
| 38 |
|
|---|
| 39 | inline void SetImgApp(PIStdImgApp* app) {mImgapp = app; }
|
|---|
| 40 |
|
|---|
| 41 | void Nobj_ComputeExpressions(NObjMgrAdapter* obja, string& expx, string& expy, string& expz,
|
|---|
| 42 | string& expwt, string& expcut,
|
|---|
| 43 | NTuple* nt=NULL, Histo* h1=NULL,
|
|---|
| 44 | Histo2D* h2=NULL, HProf* hp=NULL);
|
|---|
| 45 | PlotExprFunc LinkExprFunc(string& vardec, string& expx, string& expy, string& expz,
|
|---|
| 46 | string& wt, string& cut);
|
|---|
| 47 | DlFunction LinkFunctionFromFile(string& fnamer, char* funcname);
|
|---|
| 48 | void CloseDLL();
|
|---|
| 49 |
|
|---|
| 50 | string FileName2Name(string const & fn);
|
|---|
| 51 | int DecodeDispOption(string& dopt, bool& fgsrgr);
|
|---|
| 52 |
|
|---|
| 53 | protected:
|
|---|
| 54 | void InitGrAttNames();
|
|---|
| 55 |
|
|---|
| 56 | // Pour enregister les objets et leurs adaptateurs pour NamedObjMgr
|
|---|
| 57 | struct dataobj_adapter {
|
|---|
| 58 | AnyDataObj* obj; NObjMgrAdapter* obja;
|
|---|
| 59 | };
|
|---|
| 60 | typedef list<dataobj_adapter> ObjAdaptList;
|
|---|
| 61 | ObjAdaptList objadaplist;
|
|---|
| 62 |
|
|---|
| 63 | // Variables membre , en public pour le moment
|
|---|
| 64 | struct gratt_item {
|
|---|
| 65 | int a1, a2;
|
|---|
| 66 | };
|
|---|
| 67 | typedef map<string, gratt_item, less<string> > GrAttNames;
|
|---|
| 68 |
|
|---|
| 69 | // Pour les changements d'attributs graphiques / de visualisation
|
|---|
| 70 | GrAttNames GrAcolors;
|
|---|
| 71 | GrAttNames GrAlines;
|
|---|
| 72 | GrAttNames GrAmarkers;
|
|---|
| 73 | GrAttNames GrAfonts;
|
|---|
| 74 | GrAttNames GrAcmap;
|
|---|
| 75 | GrAttNames GrAzoom;
|
|---|
| 76 | GrAttNames GrAaxes;
|
|---|
| 77 |
|
|---|
| 78 | PDynLinkMgr * dynlink; // shared-lib lib.so
|
|---|
| 79 | string TmpDir; // Pour fichiers temporaires
|
|---|
| 80 |
|
|---|
| 81 | PIStdImgApp* mImgapp;
|
|---|
| 82 |
|
|---|
| 83 | };
|
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 | #endif
|
|---|