| 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 |
|
|---|
| 24 | class MParList : public MParContainer
|
|---|
| 25 | {
|
|---|
| 26 | private:
|
|---|
| 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 | public:
|
|---|
| 36 | MParList(const char *name=NULL, const char *title=NULL);
|
|---|
| 37 | MParList(MParList &ts);
|
|---|
| 38 |
|
|---|
| 39 | virtual ~MParList();
|
|---|
| 40 |
|
|---|
| 41 | Bool_t AddToList(MParContainer *obj, MParContainer *where = NULL);
|
|---|
| 42 | void AddToList(TObjArray *list);
|
|---|
| 43 |
|
|---|
| 44 | Bool_t Replace(MParContainer *obj);
|
|---|
| 45 |
|
|---|
| 46 | void SetLogStream(MLog *log);
|
|---|
| 47 |
|
|---|
| 48 | TObject *FindObject(const char *name) const;
|
|---|
| 49 | TObject *FindObject(const TObject *obj) const;
|
|---|
| 50 |
|
|---|
| 51 | TObject *FindObject(const char *name, const char *classname) const;
|
|---|
| 52 | TObject *FindObject(const TObject *obj, const char *classname) const;
|
|---|
| 53 |
|
|---|
| 54 | MParContainer *FindCreateObj(const char *classname, const char *objname=NULL);
|
|---|
| 55 |
|
|---|
| 56 | TObjArray FindObjectList(const char *name, UInt_t first, const UInt_t last) const;
|
|---|
| 57 | TObjArray FindObjectList(const char *name, const UInt_t num) const
|
|---|
| 58 | {
|
|---|
| 59 | return FindObjectList(name, 0, num);
|
|---|
| 60 | }
|
|---|
| 61 |
|
|---|
| 62 | TObjArray FindCreateObjList(const char *cname, UInt_t first, const UInt_t last, const char *oname=NULL);
|
|---|
| 63 | TObjArray FindCreateObjList(const char *cname, const UInt_t num, const char *oname=NULL)
|
|---|
| 64 | {
|
|---|
| 65 | return FindCreateObjList(cname, 0, num, oname);
|
|---|
| 66 | }
|
|---|
| 67 |
|
|---|
| 68 | static TObjArray CreateObjList(const char *cname, UInt_t first, const UInt_t last, const char *oname=NULL);
|
|---|
| 69 | static TObjArray CreateObjList(const char *cname, const UInt_t num, const char *oname=NULL)
|
|---|
| 70 | {
|
|---|
| 71 | return CreateObjList(cname, 0, num, oname);
|
|---|
| 72 | }
|
|---|
| 73 |
|
|---|
| 74 | void Reset();
|
|---|
| 75 | void SetReadyToSave(Bool_t flag=kTRUE);
|
|---|
| 76 |
|
|---|
| 77 | void SetOwner(Bool_t enable=kTRUE);
|
|---|
| 78 |
|
|---|
| 79 | void Print(Option_t *t = NULL) const;
|
|---|
| 80 |
|
|---|
| 81 | ClassDef(MParList, 0) // list of parameter containers (MParContainer)
|
|---|
| 82 | };
|
|---|
| 83 |
|
|---|
| 84 | #endif
|
|---|