Fork me on GitHub

source: git/external/ExRootAnalysis/ExRootConfReader.h@ d97a18b

ImprovedOutputFile Timing dual_readout llp
Last change on this file since d97a18b was bd8c884, checked in by Pavel Demin <pavel.demin@…>, 8 years ago

add source command to ExRootConfReader

  • Property mode set to 100644
File size: 1.8 KB
Line 
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
17struct Tcl_Obj;
18struct Tcl_Interp;
19
20class ExRootConfParam
21{
22public:
23
24 ExRootConfParam(const char *name = 0, Tcl_Obj *object = 0, Tcl_Interp *interp = 0);
25
26 int GetInt(int defaultValue = 0);
27 long GetLong(long defaultValue = 0);
28 double GetDouble(double defaultValue = 0.0);
29 bool GetBool(bool defaultValue = false);
30 const char *GetString(const char *defaultValue = "");
31
32 int GetSize();
33 ExRootConfParam operator[](int index);
34
35private:
36
37 const char *fName; //!
38 Tcl_Obj *fObject; //!
39 Tcl_Interp *fTclInterp; //!
40};
41
42//------------------------------------------------------------------------------
43
44class ExRootConfReader : public TNamed
45{
46public:
47 typedef std::map<TString, TString> ExRootTaskMap;
48
49 ExRootConfReader();
50 ~ExRootConfReader();
51
52 void ReadFile(const char *fileName, bool isTop = true);
53
54 int GetInt(const char *name, int defaultValue, int index = -1);
55 long GetLong(const char *name, long defaultValue, int index = -1);
56 double GetDouble(const char *name, double defaultValue, int index = -1);
57 bool GetBool(const char *name, bool defaultValue, int index = -1);
58 const char *GetString(const char *name, const char *defaultValue, int index = -1);
59 ExRootConfParam GetParam(const char *name);
60
61 const ExRootTaskMap *GetModules() const { return &fModules; }
62
63 void AddModule(const char *className, const char *moduleName);
64
65 const char *GetTopDir() const { return fTopDir; }
66
67private:
68
69 const char *fTopDir; //!
70
71 Tcl_Interp *fTclInterp; //!
72
73 ExRootTaskMap fModules; //!
74
75 ClassDef(ExRootConfReader, 1)
76};
77
78#endif
79
Note: See TracBrowser for help on using the repository browser.