source: trunk/Mars/mbase/MStatusArray.h@ 19760

Last change on this file since 19760 was 19760, checked in by tbretz, 5 years ago
They are added to the ListOfCleanups. This is implemented as a THashTable. According to the root documentation, it is required to rehash the table whenever the name of an object in the table changes. This is now guranteed if name change happens via SetName
File size: 2.3 KB
Line 
1#ifndef MARS_MStatusArray
2#define MARS_MStatusArray
3
4#ifndef ROOT_TObjArray
5#include <TObjArray.h>
6#endif
7
8class TClass;
9class TCanvas;
10class TVirtualPad;
11
12class MStatusDisplay;
13
14class MStatusArray : public TObjArray
15{
16private:
17 enum {
18 kMyCanDelete = BIT(30)
19 };
20
21 void SetCleanup(TObject *obj) const;
22 Bool_t RecursiveDelete(TVirtualPad *p, const char id=0) const;
23
24 void SetCanDelete(const TCollection *list) const;
25 void SetMyCanDelete(const TCollection *list) const;
26 void ResetMyCanDelete(const TCollection *list) const;
27 void PrintObjectsInPad(const TCollection *list, const TString &name, Int_t lvl=0) const;
28 TObject *FindObjectInPad(TVirtualPad *pad, const char *object, TClass *base) const;
29 void RecursiveRemove(TCollection *c, TObject *o);
30
31public:
32 MStatusArray() : TObjArray() { }
33 MStatusArray(const MStatusDisplay &d);
34 ~MStatusArray();
35
36 void SetName(const char *name);
37
38 TObject *DisplayIn(Option_t *o=0) const; // *MENU*
39 void DisplayIn(MStatusDisplay &d, const char *tab=0) const;
40 TObject *Display() const { return DisplayIn(); } // *MENU*
41
42 TCanvas *FindCanvas(const char *name) const;
43
44 TObject *FindObjectInCanvas(const char *object, const char *base, const char *canvas) const;
45 TObject *FindObjectInCanvas(const char *object, const char *canvas) const;
46
47 void Print(Option_t *o="") const;
48 void Print(const Option_t *o, Option_t *) const { Print(o); }
49 void Print(const Option_t *o, Int_t) const { Print(o); }
50 void Print(const Option_t *o, const char*, Int_t) const { Print(o); }
51 void Print(const Option_t *o, TPRegexp&, Int_t) const { Print(o); }
52
53 TObject *FindObject(const char *object, const char *base) const;
54 TObject *FindObject(const char *object) const;
55 TObject *FindObject(const TObject *) const { return 0; }
56
57 Int_t Read(const char *name=NULL);
58 Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0) const;
59 Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
60 {
61 return const_cast<const MStatusArray*>(this)->Write(name, option, bufsize);
62 }
63
64 void EnableTH1Workaround(const TCollection *list=0) const;
65 void Delete(Option_t *option="");
66
67 void RecursiveRemove(TObject *o);
68
69 ClassDef(MStatusArray, 0) // Helper class for status display
70};
71
72#endif
Note: See TracBrowser for help on using the repository browser.