source: trunk/MagicSoft/Mars/mbase/MParList.h@ 2772

Last change on this file since 2772 was 1965, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 3.2 KB
Line 
1#ifndef MARS_MParList
2#define MARS_MParList
3
4/////////////////////////////////////////////////////////////////////////////
5// //
6// MParList //
7// //
8// List of parameter containers (MParContainer) //
9// //
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef ROOT_TObjArray
13#include <TObjArray.h>
14#endif
15#ifndef MARS_MParContainer
16#include "MParContainer.h"
17#endif
18
19class TClass;
20class TOrdCollection;
21
22class MLog;
23
24class MParList : public MParContainer
25{
26private:
27 TOrdCollection *fContainer; // Collection of Parameter and Data Containers
28 TOrdCollection *fAutodelete; //! All what this list contains is deleted in the destructor
29
30 static TString GetClassName(const char *classname);
31 static TString GetObjectName(const char *classname, const char *objname);
32
33 enum { kIsOwner = BIT(14) };
34
35 void StreamPrimitive(ofstream &out) const;
36
37public:
38 enum { kDoNotReset = BIT(17) };
39
40 MParList(const char *name=NULL, const char *title=NULL);
41 MParList(MParList &ts);
42
43 virtual ~MParList();
44
45 Bool_t AddToList(MParContainer *obj, MParContainer *where = NULL);
46 void AddToList(TObjArray *list);
47
48 Bool_t Replace(MParContainer *obj);
49 void Remove(MParContainer *obj);
50
51 void SetLogStream(MLog *log);
52 void SetDisplay(MStatusDisplay *d);
53
54 TObject *FindObject(const char *name) const;
55 TObject *FindObject(const TObject *obj) const;
56
57 TObject *FindObject(const char *name, const char *classname) const;
58 TObject *FindObject(const TObject *obj, const char *classname) const;
59
60 MParContainer *FindCreateObj(const char *classname, const char *objname=NULL);
61
62 TObjArray FindObjectList(const char *name, UInt_t first, const UInt_t last) const;
63 TObjArray FindObjectList(const char *name, const UInt_t num) const
64 {
65 return FindObjectList(name, 0, num);
66 }
67
68 TObjArray FindCreateObjList(const char *cname, UInt_t first, const UInt_t last, const char *oname=NULL);
69 TObjArray FindCreateObjList(const char *cname, const UInt_t num, const char *oname=NULL)
70 {
71 return FindCreateObjList(cname, 0, num, oname);
72 }
73
74 static TObjArray CreateObjList(const char *cname, UInt_t first, const UInt_t last, const char *oname=NULL);
75 static TObjArray CreateObjList(const char *cname, const UInt_t num, const char *oname=NULL)
76 {
77 return CreateObjList(cname, 0, num, oname);
78 }
79
80 void Reset();
81 void SetReadyToSave(Bool_t flag=kTRUE);
82
83 void SetOwner(Bool_t enable=kTRUE);
84 Bool_t IsOwner() const { return TestBit(kIsOwner); }
85
86 void Print(Option_t *t = NULL) const;
87
88 void GetNames(TObjArray &arr) const;
89 void SetNames(TObjArray &arr);
90
91 void SavePrimitive(ofstream &out, Option_t *o="");
92
93 Bool_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
94 Bool_t WriteEnv(TEnv &env, TString prefix, Bool_t print=kFALSE) const;
95
96 ClassDef(MParList, 1) // list of parameter containers (MParContainer)
97};
98
99#endif
Note: See TracBrowser for help on using the repository browser.