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

Last change on this file since 1492 was 1477, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 2.8 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 MParList(const char *name=NULL, const char *title=NULL);
39 MParList(MParList &ts);
40
41 virtual ~MParList();
42
43 Bool_t AddToList(MParContainer *obj, MParContainer *where = NULL);
44 void AddToList(TObjArray *list);
45
46 Bool_t Replace(MParContainer *obj);
47
48 void SetLogStream(MLog *log);
49
50 TObject *FindObject(const char *name) const;
51 TObject *FindObject(const TObject *obj) const;
52
53 TObject *FindObject(const char *name, const char *classname) const;
54 TObject *FindObject(const TObject *obj, const char *classname) const;
55
56 MParContainer *FindCreateObj(const char *classname, const char *objname=NULL);
57
58 TObjArray FindObjectList(const char *name, UInt_t first, const UInt_t last) const;
59 TObjArray FindObjectList(const char *name, const UInt_t num) const
60 {
61 return FindObjectList(name, 0, num);
62 }
63
64 TObjArray FindCreateObjList(const char *cname, UInt_t first, const UInt_t last, const char *oname=NULL);
65 TObjArray FindCreateObjList(const char *cname, const UInt_t num, const char *oname=NULL)
66 {
67 return FindCreateObjList(cname, 0, num, oname);
68 }
69
70 static TObjArray CreateObjList(const char *cname, UInt_t first, const UInt_t last, const char *oname=NULL);
71 static TObjArray CreateObjList(const char *cname, const UInt_t num, const char *oname=NULL)
72 {
73 return CreateObjList(cname, 0, num, oname);
74 }
75
76 void Reset();
77 void SetReadyToSave(Bool_t flag=kTRUE);
78
79 void SetOwner(Bool_t enable=kTRUE);
80
81 void Print(Option_t *t = NULL) const;
82
83 void GetNames(TObjArray &arr) const;
84 void SetNames(TObjArray &arr);
85
86 ClassDef(MParList, 1) // list of parameter containers (MParContainer)
87};
88
89#endif
Note: See TracBrowser for help on using the repository browser.