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

Last change on this file since 1472 was 1471, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 4.2 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 TDataMember;
26class TMethodCall;
27
28class MParContainer : public TObject
29{
30protected:
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
36private:
37 Bool_t fReadyToSave; // should be set to true if the contents of the container is changed somehow
38
39public:
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 virtual void SavePrimitive(ofstream &out, Option_t *o="");
64
65 virtual void SetLogStream(MLog *lg) { fLog = lg; }
66 virtual void Reset() { }
67 virtual Bool_t IsReadyToSave() const { return fReadyToSave; }
68 virtual void SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; }
69
70 TMethodCall *GetterMethod(const char *name) const;
71
72 Bool_t WriteDataMember(ostream &out, const char *member, Double_t scale=1) const;
73 Bool_t WriteDataMember(ostream &out, const TDataMember *member, Double_t scale=1) const;
74 Bool_t WriteDataMember(ostream &out, const TList *list) const;
75
76 virtual void AsciiRead(ifstream &fin);
77 virtual Bool_t AsciiWrite(ostream &out) const;
78
79 ClassDef(MParContainer, 0) //The basis for all parameter containers
80};
81
82/*
83class MParContainer : public TNamed
84{
85protected:
86 MLog *fLog; //! The general log facility for this object, initialized with the global object
87
88private:
89 Bool_t fReadyToSave; //! should be set to true if the contents of the container is changed somehow
90
91public:
92 MParContainer(const char *name="", const char *title="") : TNamed(name, title), fLog(&gLog), fReadyToSave(kFALSE) { }
93 MParContainer(const TString &name, const TString &title) : TNamed(name, title), fLog(&gLog), fReadyToSave(kFALSE) { }
94
95 void SetLogStream(MLog *lg) { fLog = lg; }
96
97 virtual void Reset() { }
98
99 virtual Bool_t IsReadyToSave() { return fReadyToSave; }
100 virtual void SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; }
101
102 virtual void AsciiRead(ifstream &fin);
103 virtual void AsciiWrite(ofstream &fout) const;
104
105 ClassDef(MParContainer, 0) //The basis for all parameter containers
106};
107*/
108#endif
109
110
Note: See TracBrowser for help on using the repository browser.