| 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 |
|
|---|
| 16 | class MTask;
|
|---|
| 17 | class MParList;
|
|---|
| 18 | class MTaskList;
|
|---|
| 19 | class TGProgressBar;
|
|---|
| 20 | #ifdef __MARS__
|
|---|
| 21 | class MProgressBar;
|
|---|
| 22 | #endif
|
|---|
| 23 |
|
|---|
| 24 | class MEvtLoop : public MParContainer
|
|---|
| 25 | {
|
|---|
| 26 | private:
|
|---|
| 27 | MParList *fParList;
|
|---|
| 28 | MTaskList *fTaskList; //!
|
|---|
| 29 |
|
|---|
| 30 | TGProgressBar *fProgress; //!
|
|---|
| 31 |
|
|---|
| 32 | enum { kIsOwner = BIT(14) };
|
|---|
| 33 |
|
|---|
| 34 | Bool_t HasDuplicateNames(const TString txt) const;
|
|---|
| 35 | Bool_t HasDuplicateNames(TObjArray &arr, const TString txt) const;
|
|---|
| 36 |
|
|---|
| 37 | void StreamPrimitive(ofstream &out) const;
|
|---|
| 38 |
|
|---|
| 39 | Bool_t ProcessGuiEvents(Int_t num, Int_t entries);
|
|---|
| 40 |
|
|---|
| 41 | public:
|
|---|
| 42 | MEvtLoop(const char *name="Evtloop");
|
|---|
| 43 | virtual ~MEvtLoop();
|
|---|
| 44 |
|
|---|
| 45 | void SetParList(MParList *p);
|
|---|
| 46 | MParList *GetParList() const { return fParList; }
|
|---|
| 47 | MTaskList *GetTaskList() const { return fTaskList; }
|
|---|
| 48 |
|
|---|
| 49 | MTask *FindTask(const char *name) const;
|
|---|
| 50 | MTask *FindTask(const MTask *obj) const;
|
|---|
| 51 |
|
|---|
| 52 | MStatusDisplay *GetDisplay() { return fDisplay; }
|
|---|
| 53 | void SetDisplay(MStatusDisplay *d);
|
|---|
| 54 |
|
|---|
| 55 | void SetOwner(Bool_t enable=kTRUE);
|
|---|
| 56 |
|
|---|
| 57 | void SetProgressBar(TGProgressBar *bar);
|
|---|
| 58 | #ifdef __MARS__
|
|---|
| 59 | void SetProgressBar(MProgressBar *bar);
|
|---|
| 60 | #endif
|
|---|
| 61 |
|
|---|
| 62 | Bool_t PreProcess(const char *tlist="MTaskList");
|
|---|
| 63 | Int_t Process(Int_t maxcnt);
|
|---|
| 64 | Bool_t PostProcess() const;
|
|---|
| 65 |
|
|---|
| 66 | Bool_t Eventloop(Int_t maxcnt=-1, const char *tlist="MTaskList");
|
|---|
| 67 |
|
|---|
| 68 | void MakeMacro(const char *filename="evtloop.C");
|
|---|
| 69 |
|
|---|
| 70 | void SavePrimitive(ofstream &out, Option_t *o="");
|
|---|
| 71 |
|
|---|
| 72 | Int_t Read(const char *name="Evtloop");
|
|---|
| 73 | Int_t Write(const char *name="Evtloop", Int_t option=0, Int_t bufsize=0);
|
|---|
| 74 |
|
|---|
| 75 | void Print(Option_t *opt="") const;
|
|---|
| 76 |
|
|---|
| 77 | Bool_t ReadEnv(const TEnv &env, TString prefix="", Bool_t print=kFALSE);
|
|---|
| 78 | Bool_t WriteEnv(TEnv &env, TString prefix="", Bool_t print=kFALSE) const;
|
|---|
| 79 |
|
|---|
| 80 | void RecursiveRemove(TObject *obj);
|
|---|
| 81 |
|
|---|
| 82 | ClassDef(MEvtLoop, 1) // Class to execute the tasks in a tasklist
|
|---|
| 83 | };
|
|---|
| 84 |
|
|---|
| 85 | // FIXME: Move as (persistent) static data member to MParContainer
|
|---|
| 86 | R__EXTERN TList *gListOfPrimitives; // instantiation in MEvtLoop
|
|---|
| 87 |
|
|---|
| 88 | #endif
|
|---|