1 | #ifndef ExRootConfReader_h
|
---|
2 | #define ExRootConfReader_h
|
---|
3 |
|
---|
4 | /** \class ExRootConfReader
|
---|
5 | *
|
---|
6 | * Class handling output ROOT tree
|
---|
7 | *
|
---|
8 | * \author P. Demin - UCL, Louvain-la-Neuve
|
---|
9 | *
|
---|
10 | */
|
---|
11 |
|
---|
12 | #include "TNamed.h"
|
---|
13 |
|
---|
14 | #include <map>
|
---|
15 | #include <utility>
|
---|
16 |
|
---|
17 | struct Tcl_Obj;
|
---|
18 | struct Tcl_Interp;
|
---|
19 |
|
---|
20 | class ExRootConfParam
|
---|
21 | {
|
---|
22 | public:
|
---|
23 | ExRootConfParam(const char *name = 0, Tcl_Obj *object = 0, Tcl_Interp *interp = 0);
|
---|
24 |
|
---|
25 | int GetInt(int defaultValue = 0);
|
---|
26 | long GetLong(long defaultValue = 0);
|
---|
27 | double GetDouble(double defaultValue = 0.0);
|
---|
28 | bool GetBool(bool defaultValue = false);
|
---|
29 | const char *GetString(const char *defaultValue = "");
|
---|
30 |
|
---|
31 | int GetSize();
|
---|
32 | ExRootConfParam operator[](int index);
|
---|
33 |
|
---|
34 | private:
|
---|
35 | const char *fName; //!
|
---|
36 | Tcl_Obj *fObject; //!
|
---|
37 | Tcl_Interp *fTclInterp; //!
|
---|
38 | };
|
---|
39 |
|
---|
40 | //------------------------------------------------------------------------------
|
---|
41 |
|
---|
42 | class ExRootConfReader: public TNamed
|
---|
43 | {
|
---|
44 | public:
|
---|
45 | typedef std::map<TString, TString> ExRootTaskMap;
|
---|
46 |
|
---|
47 | ExRootConfReader();
|
---|
48 | ~ExRootConfReader();
|
---|
49 |
|
---|
50 | void ReadFile(const char *fileName, bool isTop = true);
|
---|
51 |
|
---|
52 | int GetInt(const char *name, int defaultValue, int index = -1);
|
---|
53 | long GetLong(const char *name, long defaultValue, int index = -1);
|
---|
54 | double GetDouble(const char *name, double defaultValue, int index = -1);
|
---|
55 | bool GetBool(const char *name, bool defaultValue, int index = -1);
|
---|
56 | const char *GetString(const char *name, const char *defaultValue, int index = -1);
|
---|
57 | ExRootConfParam GetParam(const char *name);
|
---|
58 |
|
---|
59 | const ExRootTaskMap *GetModules() const { return &fModules; }
|
---|
60 |
|
---|
61 | void AddModule(const char *className, const char *moduleName);
|
---|
62 |
|
---|
63 | const char *GetTopDir() const { return fTopDir; }
|
---|
64 |
|
---|
65 | private:
|
---|
66 | const char *fTopDir; //!
|
---|
67 |
|
---|
68 | Tcl_Interp *fTclInterp; //!
|
---|
69 |
|
---|
70 | ExRootTaskMap fModules; //!
|
---|
71 |
|
---|
72 | ClassDef(ExRootConfReader, 1)
|
---|
73 | };
|
---|
74 |
|
---|
75 | #endif
|
---|