source: trunk/Mars/mbase/MEvtLoop.h@ 20067

Last change on this file since 20067 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: 3.1 KB
Line 
1#ifndef MARS_MEvtLoop
2#define MARS_MEvtLoop
3
4/////////////////////////////////////////////////////////////////////////////
5// //
6// MEvtLoop //
7// //
8// Class to execute the tasks in a tasklist //
9// //
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef MARS_MParContainer
13#include "MParContainer.h"
14#endif
15
16class MTask;
17class MParList;
18class MTaskList;
19class TGProgressBar;
20#ifdef __MARS__
21class MProgressBar;
22#endif
23
24class MEvtLoop : public MParContainer
25{
26private:
27 MParList *fParList;
28 MTaskList *fTaskList; //!
29
30 TGProgressBar *fProgress; //!
31
32 ULong_t fNumEvents; //!
33
34 enum { kIsOwner = BIT(14), kPrivateDisplay = BIT(15) };
35
36 Bool_t HasDuplicateNames(const TString txt) const;
37 Bool_t HasDuplicateNames(TObjArray &arr, const TString txt) const;
38
39 void StreamPrimitive(std::ostream &out) const;
40
41 Bool_t ProcessGuiEvents(Int_t num, Int_t rc);
42
43public:
44 enum Statistics_t {
45 kNoStatistics = 0,
46 kStdStatistics = 1,
47 kFullStatistics = 2
48 };
49
50 MEvtLoop(const char *name="Evtloop");
51 virtual ~MEvtLoop();
52
53 void SetName(const char *name);
54
55 void SetParList(MParList *p);
56 MParList *GetParList() const { return fParList; }
57 MTaskList *GetTaskList() const { return fTaskList; }
58
59 MTask *FindTask(const char *name) const;
60 MTask *FindTask(const MTask *obj) const;
61
62 MStatusDisplay *GetDisplay() { return fDisplay; }
63 void SetDisplay(MStatusDisplay *d);
64 void SetPrivateDisplay(Bool_t b=kTRUE) { b ? SetBit(kPrivateDisplay) : ResetBit(kPrivateDisplay); } // Prevent status display from being cascaded in PreProcess
65
66 void SetOwner(Bool_t enable=kTRUE);
67
68 void SetProgressBar(TGProgressBar *bar);
69#ifdef __MARS__
70 void SetProgressBar(MProgressBar *bar);
71#endif
72
73 Bool_t PreProcess();
74 Int_t Process(UInt_t maxcnt);
75 Bool_t PostProcess() const;
76
77 Bool_t Eventloop(UInt_t maxcnt=0, Statistics_t printstat=kStdStatistics);
78
79 void MakeMacro(const char *filename="evtloop.C");
80
81 void SavePrimitive(std::ostream &out, Option_t *o="");
82 void SavePrimitive(std::ofstream &out, Option_t *o="");
83
84 Int_t Read(const char *name="Evtloop");
85 Int_t Write(const char *name="Evtloop", Int_t option=0, Int_t bufsize=0) const;
86 Int_t Write(const char *name="Evtloop", Int_t option=0, Int_t bufsize=0)
87 {
88 return const_cast<MEvtLoop*>(this)->Write(name, option, bufsize);
89 }
90
91 void Print(Option_t *opt="") const;
92
93 Int_t ReadEnv(const TEnv &env, TString prefix="", Bool_t print=kFALSE);
94 Bool_t WriteEnv(TEnv &env, TString prefix="", Bool_t print=kFALSE) const;
95
96 Bool_t ReadEnv(const char *config, Bool_t print=kFALSE);
97
98 void RecursiveRemove(TObject *obj);
99
100 static UInt_t GetMemoryUsage();
101
102 ClassDef(MEvtLoop, 1) // Class to execute the tasks in a tasklist
103};
104
105#endif
Note: See TracBrowser for help on using the repository browser.