1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // $Id: EsafConfigurable.hh 2804 2008-10-09 12:10:06Z biktem $ |
---|
3 | // D. De Marco, M. Pallavicini created Jan, 18 2002 |
---|
4 | // class description: |
---|
5 | // base class for all objects that need to access to Config parameters |
---|
6 | // |
---|
7 | |
---|
8 | #ifndef __EUSOCONFIGURABLE_HH_ |
---|
9 | #define __EUSOCONFIGURABLE_HH_ |
---|
10 | |
---|
11 | #include "euso.hh" |
---|
12 | #include "RConfig.h" |
---|
13 | #include "BaseDialogFactory.hh" |
---|
14 | #include "ConfigFileParser.hh" |
---|
15 | |
---|
16 | class TGTransientFrame; // root class for Dialog window |
---|
17 | class SimuApplication; |
---|
18 | class TGMainFrame; |
---|
19 | class TGWindow; |
---|
20 | |
---|
21 | // macro used by all children of this class |
---|
22 | // defines a ClassType and a ClassName through ROOT TObject |
---|
23 | #define EsafConfigClass(type,name) \ |
---|
24 | public: \ |
---|
25 | virtual const char* ClassType() const {return _QUOTE_(type);} \ |
---|
26 | virtual const char* ClassName() const {return _QUOTE_(name);} |
---|
27 | |
---|
28 | // each sub-class should add the previous macro providing a class type |
---|
29 | // and a class name |
---|
30 | class EsafConfigurable { |
---|
31 | public: |
---|
32 | EsafConfigurable(const char* ClassName=0, const char* parent=0 ); |
---|
33 | |
---|
34 | virtual ~EsafConfigurable(); |
---|
35 | |
---|
36 | static void SelectFactory( BaseDialogFactory* f ) { gFactory=f;} |
---|
37 | |
---|
38 | virtual const char* ClassType() const = 0; |
---|
39 | virtual const char* ClassName() const = 0; |
---|
40 | |
---|
41 | virtual ConfigFileParser* Conf(const char* name=0) const; |
---|
42 | // virtual ConfigFileParser* Conf(const char* type,const char* name) const; |
---|
43 | |
---|
44 | virtual TGTransientFrame *GetDialog( SimuApplication* pApp, TGWindow* pWin, |
---|
45 | TGMainFrame* pMain) const; |
---|
46 | private: |
---|
47 | static BaseDialogFactory *gFactory; |
---|
48 | ClassDef(EsafConfigurable,0) |
---|
49 | }; |
---|
50 | |
---|
51 | #endif /* __EUSOCONFIGURABLE_HH_ */ |
---|
52 | |
---|