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

Last change on this file since 770 was 609, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 2.5 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
42public:
43 MParContainer(const char *name="", const char *title="") : fLog(&gLog) { Init(name, title); }
44 MParContainer(const TString &name, const TString &title) : fLog(&gLog) { Init(name, title); }
45 MParContainer(const MParContainer &named);
46 MParContainer& operator=(const MParContainer& rhs);
47
48 void SetLogStream(MLog *log) { fLog = log; }
49
50 virtual ~MParContainer() {
51 //delete fName; delete fTitle;
52 }
53 virtual Int_t Compare(TObject *obj);
54 virtual void Copy(TObject &named);
55 virtual void FillBuffer(char *&buffer);
56 virtual const char *GetName() const {return fName->Data();}
57 virtual const char *GetTitle() const {return fTitle->Data();}
58 virtual ULong_t Hash() { return fName->Hash(); }
59 virtual Bool_t IsSortable() const { return kTRUE; }
60 virtual void SetName(const char *name); // *MENU*
61 virtual void SetObject(const char *name, const char *title);
62 virtual void SetTitle(const char *title=""); // *MENU*
63 virtual void ls(Option_t *option="");
64 virtual void Print(Option_t *option="");
65 virtual Int_t Sizeof() const;
66
67 virtual void AsciiRead(ifstream &fin) {};
68 virtual void AsciiWrite(ofstream &fout) const {};
69
70 ClassDef(MParContainer, 1) //The basis for all parameter containers
71};
72
73#endif
74
75
Note: See TracBrowser for help on using the repository browser.