source: trunk/MagicSoft/Mars/mbase/MParContainer.h@ 1028

Last change on this file since 1028 was 1014, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 5.8 KB
Line 
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
22class ofstream;
23class ifstream;
24/*
25class MParContainer : public TObject
26{
27private:
28 void Init(const char *name, const char *title)
29 {
30 fName = new TString;
31 (*fName) = name;
32 fTitle = new TString;
33 (*fTitle) = title;
34
35 cout << " <***> " << flush;
36 }
37
38protected:
39 MLog *fLog; //! The general log facility for this object, initialized with the global object
40
41 TString *fName; //! parameter container identifier (name)
42 TString *fTitle; //! parameter container title
43
44 Bool_t fReadyToSave; //! should be set to true if the contents of the container is changed somehow
45
46public:
47 MParContainer(const char *name="", const char *title="") : fLog(&gLog), fReadyToSave(kFALSE) { Init(name, title); }
48 MParContainer(const TString &name, const TString &title) : fLog(&gLog), fReadyToSave(kFALSE) { Init(name, title); }
49 MParContainer(const MParContainer &named);
50 MParContainer& operator=(const MParContainer& rhs);
51
52 void SetLogStream(MLog *lg) { fLog = lg; }
53
54 virtual ~MParContainer() {
55 //delete fName; delete fTitle;
56 }
57 virtual TObject *Clone(const char *newname) const;
58 virtual Int_t Compare(const TObject *obj) const;
59 virtual void Copy(TObject &named);
60 virtual void FillBuffer(char *&buffer);
61 virtual const char *GetName() const {return fName->Data();}
62 virtual const char *GetTitle() const {return fTitle->Data();}
63 virtual ULong_t Hash() { return fName->Hash(); }
64 virtual Bool_t IsSortable() const { return kTRUE; }
65 virtual void SetName(const char *name); // *MENU*
66 virtual void SetObject(const char *name, const char *title);
67 virtual void SetTitle(const char *title=""); // *MENU*
68 virtual void ls(Option_t *option="") const;
69 virtual void Print(Option_t *option="") const;
70 virtual Int_t Sizeof() const;
71
72 virtual void Reset() {};
73
74 virtual Bool_t IsReadyToSave() { return fReadyToSave; }
75 virtual void SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; }
76
77 virtual void AsciiRead(ifstream &fin);
78 virtual void AsciiWrite(ofstream &fout) const;
79
80 ClassDef(MParContainer, 0) //The basis for all parameter containers
81};
82*/
83
84class MParContainer : public TObject
85{
86protected:
87 TString fName; // parameter container identifier (name)
88 TString fTitle; // parameter container title
89
90 MLog *fLog; // The general log facility for this object, initialized with the global object
91
92private:
93 Bool_t fReadyToSave; // should be set to true if the contents of the container is changed somehow
94
95public:
96 MParContainer(const char *name="", const char *title="") : fName(name), fTitle(title), fLog(&gLog), fReadyToSave(kFALSE) { }
97 MParContainer(const TString &name, const TString &title) : fName(name), fTitle(title), fLog(&gLog), fReadyToSave(kFALSE) { }
98 MParContainer(const MParContainer &named);
99 MParContainer& operator=(const MParContainer& rhs);
100
101 void SetLogStream(MLog *lg) { fLog = lg; }
102
103 virtual TObject *Clone(const char *newname="") const;
104 virtual Int_t Compare(const TObject *obj) const;
105 virtual void Copy(TObject &named);
106 virtual void FillBuffer(char *&buffer);
107 virtual const char *GetName() const { return fName.Data(); }
108 virtual const char *GetTitle() const { return fTitle.Data(); }
109 virtual ULong_t Hash() { return fName.Hash(); }
110 virtual Bool_t IsSortable() const { return kTRUE; }
111 virtual void SetName(const char *name); // *MENU*
112 virtual void SetObject(const char *name, const char *title);
113 virtual void SetTitle(const char *title=""); // *MENU*
114 virtual void ls(Option_t *option="") const;
115 virtual void Print(Option_t *option="") const;
116 virtual Int_t Sizeof() const;
117
118 virtual void Reset() { }
119
120 virtual Bool_t IsReadyToSave() { return fReadyToSave; }
121 virtual void SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; }
122
123 virtual void AsciiRead(ifstream &fin);
124 virtual void AsciiWrite(ofstream &fout) const;
125
126 ClassDef(MParContainer, 0) //The basis for all parameter containers
127};
128
129/*
130class MParContainer : public TNamed
131{
132protected:
133 MLog *fLog; //! The general log facility for this object, initialized with the global object
134
135private:
136 Bool_t fReadyToSave; //! should be set to true if the contents of the container is changed somehow
137
138public:
139 MParContainer(const char *name="", const char *title="") : TNamed(name, title), fLog(&gLog), fReadyToSave(kFALSE) { }
140 MParContainer(const TString &name, const TString &title) : TNamed(name, title), fLog(&gLog), fReadyToSave(kFALSE) { }
141
142 void SetLogStream(MLog *lg) { fLog = lg; }
143
144 virtual void Reset() { }
145
146 virtual Bool_t IsReadyToSave() { return fReadyToSave; }
147 virtual void SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; }
148
149 virtual void AsciiRead(ifstream &fin);
150 virtual void AsciiWrite(ofstream &fout) const;
151
152 ClassDef(MParContainer, 0) //The basis for all parameter containers
153};
154*/
155#endif
156
157
Note: See TracBrowser for help on using the repository browser.