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

Last change on this file since 951 was 858, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 2.8 KB
Line 
1#ifndef MPARCONTAINER_H
2#define MPARCONTAINER_H
3
4//////////////////////////////////////////////////////////////////////////
5// //
6// MParContainer //
7// //
8// The basis for all parameter containers //
9// //
10//////////////////////////////////////////////////////////////////////////
11#ifndef MAGIC_H
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
36protected:
37 MLog *fLog; //! The general log facility for this object, initialized with the global object
38
39 TString *fName; //! parameter container identifier (name)
40 TString *fTitle; //! parameter container title
41
42 Bool_t fReadyToSave; //! should be set to true if the contents of the container is changed somehow
43
44public:
45 MParContainer(const char *name="", const char *title="") : fLog(&gLog), fReadyToSave(kFALSE) { Init(name, title); }
46 MParContainer(const TString &name, const TString &title) : fLog(&gLog), fReadyToSave(kFALSE) { Init(name, title); }
47 MParContainer(const MParContainer &named);
48 MParContainer& operator=(const MParContainer& rhs);
49
50 void SetLogStream(MLog *lg) { fLog = lg; }
51
52 virtual ~MParContainer() {
53 //delete fName; delete fTitle;
54 }
55 virtual Int_t Compare(TObject *obj);
56 virtual void Copy(TObject &named);
57 virtual void FillBuffer(char *&buffer);
58 virtual const char *GetName() const {return fName->Data();}
59 virtual const char *GetTitle() const {return fTitle->Data();}
60 virtual ULong_t Hash() { return fName->Hash(); }
61 virtual Bool_t IsSortable() const { return kTRUE; }
62 virtual void SetName(const char *name); // *MENU*
63 virtual void SetObject(const char *name, const char *title);
64 virtual void SetTitle(const char *title=""); // *MENU*
65 virtual void ls(Option_t *option="");
66 virtual void Print(Option_t *option="");
67 virtual Int_t Sizeof() const;
68
69 virtual void Reset() {};
70
71 virtual Bool_t IsReadyToSave() { return fReadyToSave; }
72 virtual void SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; }
73
74 virtual void AsciiRead(ifstream &fin);
75 virtual void AsciiWrite(ofstream &fout) const;
76
77 ClassDef(MParContainer, 1) //The basis for all parameter containers
78};
79
80#endif
81
82
Note: See TracBrowser for help on using the repository browser.