1 |
nikolas |
1.1 |
#ifndef PAMVMCSQLMGR_H |
2 |
|
|
#define PAMVMCSQLMGR_H |
3 |
|
|
#include <iostream> |
4 |
|
|
|
5 |
|
|
#include "GLTables.h" |
6 |
|
|
#include "TString.h" |
7 |
|
|
#include <TSQLServer.h> |
8 |
|
|
#include <TSystem.h> |
9 |
|
|
|
10 |
|
|
class PamVMCSQLMgr: public TObject { |
11 |
|
|
|
12 |
|
|
private: |
13 |
|
|
|
14 |
|
|
static PamVMCSQLMgr * fsql; |
15 |
|
|
|
16 |
|
|
TSQLServer * fdbc; |
17 |
|
|
GL_TABLES * fglt; |
18 |
|
|
GL_PARAM * fglparam; |
19 |
|
|
GL_ROOT * fglroot; |
20 |
|
|
GL_CALO_CALIB *fglcalo; |
21 |
|
|
|
22 |
|
|
TString fdbhost; |
23 |
|
|
TString fdbuser; |
24 |
|
|
TString fdbpsw; |
25 |
|
|
|
26 |
|
|
TString fpathtodata; |
27 |
|
|
|
28 |
|
|
protected: |
29 |
|
|
PamVMCSQLMgr(); |
30 |
|
|
|
31 |
|
|
public: |
32 |
|
|
|
33 |
|
|
~PamVMCSQLMgr(){ |
34 |
|
|
delete fdbc; |
35 |
|
|
delete fglt; |
36 |
|
|
delete fglparam; |
37 |
|
|
delete fglroot; |
38 |
|
|
delete fglcalo; |
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
static PamVMCSQLMgr * Instance(); |
42 |
|
|
|
43 |
|
|
TString GetDataPath(){ return fpathtodata; } |
44 |
|
|
|
45 |
|
|
TSQLServer * GetSQL(){ return fdbc; } |
46 |
|
|
|
47 |
|
|
GL_TABLES * GetTAB(){ return fglt; } |
48 |
|
|
|
49 |
|
|
GL_PARAM * GetPAR(){ return fglparam; } |
50 |
|
|
|
51 |
|
|
Int_t Query_GL_PARAM(UInt_t time, UInt_t type){ |
52 |
|
|
|
53 |
|
|
return fglparam->Query_GL_PARAM(time,type,fdbc); |
54 |
|
|
} |
55 |
|
|
|
56 |
|
|
GL_ROOT * GetROOT(){ return fglroot; } |
57 |
|
|
|
58 |
|
|
Int_t Query_GL_ROOT(UInt_t id){ |
59 |
|
|
|
60 |
|
|
return fglroot->Query_GL_ROOT(id,fdbc); |
61 |
|
|
} |
62 |
|
|
|
63 |
|
|
GL_CALO_CALIB * GetCaloCalib(){ return fglcalo; } |
64 |
|
|
|
65 |
|
|
Int_t Query_GL_CALO_CALIB(UInt_t time, UInt_t &uptime, |
66 |
|
|
UInt_t section){ |
67 |
|
|
|
68 |
|
|
return fglcalo->Query_GL_CALO_CALIB(time,uptime,section,fdbc); |
69 |
|
|
} |
70 |
|
|
|
71 |
|
|
|
72 |
|
|
}; |
73 |
|
|
|
74 |
|
|
#endif |