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

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