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