| 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 MParList;
|
|---|
| 17 | class MTaskList;
|
|---|
| 18 | class TGProgressBar;
|
|---|
| 19 | #ifdef __MARS__
|
|---|
| 20 | class MProgressBar;
|
|---|
| 21 | #endif
|
|---|
| 22 |
|
|---|
| 23 | class MEvtLoop : public MParContainer
|
|---|
| 24 | {
|
|---|
| 25 | private:
|
|---|
| 26 | MParList *fParList;
|
|---|
| 27 | MTaskList *fTaskList; //!
|
|---|
| 28 |
|
|---|
| 29 | TGProgressBar *fProgress; //!
|
|---|
| 30 |
|
|---|
| 31 | enum { kIsOwner = BIT(14) };
|
|---|
| 32 |
|
|---|
| 33 | Bool_t HasDuplicateNames(const TString txt) const;
|
|---|
| 34 | Bool_t HasDuplicateNames(TObjArray &arr, const TString txt) const;
|
|---|
| 35 |
|
|---|
| 36 | void StreamPrimitive(ofstream &out) const;
|
|---|
| 37 |
|
|---|
| 38 | public:
|
|---|
| 39 | MEvtLoop();
|
|---|
| 40 | virtual ~MEvtLoop();
|
|---|
| 41 |
|
|---|
| 42 | void SetParList(MParList *p) { fParList = p; }
|
|---|
| 43 | MParList *GetParList() const { return fParList; }
|
|---|
| 44 | MTaskList *GetTaskList() const { return fTaskList; }
|
|---|
| 45 |
|
|---|
| 46 | void SetOwner(Bool_t enable=kTRUE);
|
|---|
| 47 |
|
|---|
| 48 | void SetProgressBar(TGProgressBar *bar) { fProgress = bar; }
|
|---|
| 49 | #ifdef __MARS__
|
|---|
| 50 | void SetProgressBar(MProgressBar *bar);
|
|---|
| 51 | #endif
|
|---|
| 52 |
|
|---|
| 53 | Bool_t PreProcess(const char *tlist="MTaskList");
|
|---|
| 54 | Bool_t Process(Int_t maxcnt) const;
|
|---|
| 55 | Bool_t PostProcess() const;
|
|---|
| 56 |
|
|---|
| 57 | Bool_t Eventloop(Int_t maxcnt=-1, const char *tlist="MTaskList");
|
|---|
| 58 |
|
|---|
| 59 | void MakeMacro(const char *filename="evtloop.C");
|
|---|
| 60 |
|
|---|
| 61 | void SavePrimitive(ofstream &out, Option_t *o="");
|
|---|
| 62 |
|
|---|
| 63 | Int_t Read(const char *name="Evtloop");
|
|---|
| 64 | Int_t Write(const char *name="Evtloop", Int_t option=0, Int_t bufsize=0);
|
|---|
| 65 |
|
|---|
| 66 | void Print(Option_t *opt="") const;
|
|---|
| 67 |
|
|---|
| 68 | ClassDef(MEvtLoop, 1) // Class to execute the tasks in a tasklist
|
|---|
| 69 | };
|
|---|
| 70 |
|
|---|
| 71 | R__EXTERN TList *gListOfPrimitives; // instantiation in MEvtLoop
|
|---|
| 72 |
|
|---|
| 73 | #endif
|
|---|