1 | #ifndef MARS_MParContainer
|
---|
2 | #define MARS_MParContainer
|
---|
3 |
|
---|
4 | //////////////////////////////////////////////////////////////////////////
|
---|
5 | // //
|
---|
6 | // MParContainer //
|
---|
7 | // //
|
---|
8 | // The basis for all parameter containers //
|
---|
9 | // //
|
---|
10 | //////////////////////////////////////////////////////////////////////////
|
---|
11 | #ifndef MARS_MAGIC
|
---|
12 | #include "MAGIC.h"
|
---|
13 | #endif
|
---|
14 |
|
---|
15 | #ifndef ROOT_TObject
|
---|
16 | #include <TObject.h>
|
---|
17 | #endif
|
---|
18 | #ifndef ROOT_TString
|
---|
19 | #include <TString.h>
|
---|
20 | #endif
|
---|
21 |
|
---|
22 | class ofstream;
|
---|
23 | class ifstream;
|
---|
24 |
|
---|
25 | class TDataMember;
|
---|
26 | class TMethodCall;
|
---|
27 |
|
---|
28 | class MParContainer : public TObject
|
---|
29 | {
|
---|
30 | protected:
|
---|
31 | TString fName; // parameter container identifier (name)
|
---|
32 | TString fTitle; // parameter container title
|
---|
33 |
|
---|
34 | MLog *fLog; // The general log facility for this object, initialized with the global object
|
---|
35 |
|
---|
36 | private:
|
---|
37 | Bool_t fReadyToSave; // should be set to true if the contents of the container is changed somehow
|
---|
38 |
|
---|
39 | public:
|
---|
40 | MParContainer(const char *name="", const char *title="") : fName(name), fTitle(title), fLog(&gLog), fReadyToSave(kFALSE) { }
|
---|
41 | MParContainer(const TString &name, const TString &title) : fName(name), fTitle(title), fLog(&gLog), fReadyToSave(kFALSE) { }
|
---|
42 | MParContainer(const MParContainer &named);
|
---|
43 | MParContainer& operator=(const MParContainer& rhs);
|
---|
44 | virtual ~MParContainer() {}
|
---|
45 |
|
---|
46 | virtual TObject *Clone(const char *newname="") const;
|
---|
47 | virtual Int_t Compare(const TObject *obj) const;
|
---|
48 | virtual void Copy(TObject &named);
|
---|
49 | virtual void FillBuffer(char *&buffer);
|
---|
50 |
|
---|
51 | virtual const char *GetDescriptor() const { return Form("%s [%s]", fName.Data(), ClassName()); }
|
---|
52 | virtual const char *GetName() const { return fName.Data(); }
|
---|
53 | virtual const char *GetTitle() const { return fTitle.Data(); }
|
---|
54 | virtual ULong_t Hash() const { return fName.Hash(); }
|
---|
55 | virtual Bool_t IsSortable() const { return kTRUE; }
|
---|
56 |
|
---|
57 | virtual void SetName(const char *name); // *MENU*
|
---|
58 | virtual void SetObject(const char *name, const char *title);
|
---|
59 | virtual void SetTitle(const char *title=""); // *MENU*
|
---|
60 | virtual void ls(Option_t *option="") const;
|
---|
61 | virtual void Print(Option_t *option="") const;
|
---|
62 | virtual Int_t Sizeof() const;
|
---|
63 |
|
---|
64 | virtual void SetLogStream(MLog *lg) { fLog = lg; }
|
---|
65 | virtual void Reset() { }
|
---|
66 | virtual Bool_t IsReadyToSave() { return fReadyToSave; }
|
---|
67 | virtual void SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; }
|
---|
68 |
|
---|
69 | TMethodCall *GetterMethod(const char *name) const;
|
---|
70 |
|
---|
71 | Bool_t WriteDataMember(ostream &out, const char *member, Double_t scale=1) const;
|
---|
72 | Bool_t WriteDataMember(ostream &out, const TDataMember *member, Double_t scale=1) const;
|
---|
73 | Bool_t WriteDataMember(ostream &out, const TList *list) const;
|
---|
74 |
|
---|
75 | virtual void AsciiRead(ifstream &fin);
|
---|
76 | virtual Bool_t AsciiWrite(ostream &out) const;
|
---|
77 |
|
---|
78 | ClassDef(MParContainer, 0) //The basis for all parameter containers
|
---|
79 | };
|
---|
80 |
|
---|
81 | /*
|
---|
82 | class MParContainer : public TNamed
|
---|
83 | {
|
---|
84 | protected:
|
---|
85 | MLog *fLog; //! The general log facility for this object, initialized with the global object
|
---|
86 |
|
---|
87 | private:
|
---|
88 | Bool_t fReadyToSave; //! should be set to true if the contents of the container is changed somehow
|
---|
89 |
|
---|
90 | public:
|
---|
91 | MParContainer(const char *name="", const char *title="") : TNamed(name, title), fLog(&gLog), fReadyToSave(kFALSE) { }
|
---|
92 | MParContainer(const TString &name, const TString &title) : TNamed(name, title), fLog(&gLog), fReadyToSave(kFALSE) { }
|
---|
93 |
|
---|
94 | void SetLogStream(MLog *lg) { fLog = lg; }
|
---|
95 |
|
---|
96 | virtual void Reset() { }
|
---|
97 |
|
---|
98 | virtual Bool_t IsReadyToSave() { return fReadyToSave; }
|
---|
99 | virtual void SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; }
|
---|
100 |
|
---|
101 | virtual void AsciiRead(ifstream &fin);
|
---|
102 | virtual void AsciiWrite(ofstream &fout) const;
|
---|
103 |
|
---|
104 | ClassDef(MParContainer, 0) //The basis for all parameter containers
|
---|
105 | };
|
---|
106 | */
|
---|
107 | #endif
|
---|
108 |
|
---|
109 |
|
---|