source: trunk/MagicSoft/Mars/mbase/MEvtLoop.h@ 5456

Last change on this file since 5456 was 4601, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 2.5 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) };
35
36 Bool_t HasDuplicateNames(const TString txt) const;
37 Bool_t HasDuplicateNames(TObjArray &arr, const TString txt) const;
38
39 void StreamPrimitive(ofstream &out) const;
40
41 Bool_t ProcessGuiEvents(Int_t num);
42
43public:
44 MEvtLoop(const char *name="Evtloop");
45 virtual ~MEvtLoop();
46
47 void SetParList(MParList *p);
48 MParList *GetParList() const { return fParList; }
49 MTaskList *GetTaskList() const { return fTaskList; }
50
51 MTask *FindTask(const char *name) const;
52 MTask *FindTask(const MTask *obj) const;
53
54 MStatusDisplay *GetDisplay() { return fDisplay; }
55 void SetDisplay(MStatusDisplay *d);
56
57 void SetOwner(Bool_t enable=kTRUE);
58
59 void SetProgressBar(TGProgressBar *bar);
60#ifdef __MARS__
61 void SetProgressBar(MProgressBar *bar);
62#endif
63
64 Bool_t PreProcess(const char *tlist="MTaskList");
65 Int_t Process(UInt_t maxcnt);
66 Bool_t PostProcess() const;
67
68 Bool_t Eventloop(UInt_t maxcnt=0, const char *tlist="MTaskList");
69
70 void MakeMacro(const char *filename="evtloop.C");
71
72 void SavePrimitive(ofstream &out, Option_t *o="");
73
74 Int_t Read(const char *name="Evtloop");
75 Int_t Write(const char *name="Evtloop", Int_t option=0, Int_t bufsize=0);
76
77 void Print(Option_t *opt="") const;
78
79 Int_t ReadEnv(const TEnv &env, TString prefix="", Bool_t print=kFALSE);
80 Bool_t WriteEnv(TEnv &env, TString prefix="", Bool_t print=kFALSE) const;
81
82 Bool_t ReadEnv(const char *config);
83
84 void RecursiveRemove(TObject *obj);
85
86 ClassDef(MEvtLoop, 1) // Class to execute the tasks in a tasklist
87};
88
89#endif
Note: See TracBrowser for help on using the repository browser.