source: trunk/MagicSoft/Mars/mbase/MTaskInteractive.h@ 9469

Last change on this file since 9469 was 7184, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 1.9 KB
Line 
1#ifndef MARS_MTaskInteractive
2#define MARS_MTaskInteractive
3
4#ifndef MARS_MTask
5#include "MTask.h"
6#endif
7
8class MFilter;
9class MTaskList;
10
11class MTaskInteractive : public MTask
12{
13private:
14 TMethodCall *fCall[4];
15
16 Int_t (*fPreProcess)(MParList *list);
17 Int_t (*fProcess)();
18 Int_t (*fPostProcess)();
19 Bool_t (*fReInit)(MParList *list);
20
21 Int_t PreProcess(MParList *list) { if (fCall[0]) return Return(0, &list); return fPreProcess ? (*fPreProcess)(list) : kTRUE; }
22 Int_t Process() { if (fCall[1]) return Return(1); return fProcess ? (*fProcess)() : kTRUE; }
23 Int_t PostProcess() { if (fCall[2]) return Return(2); return fPostProcess ? (*fPostProcess)() : kTRUE; }
24 Bool_t ReInit(MParList *list) { if (fCall[3]) return Return(3, &list); return fReInit ? (*fReInit)(list) : kTRUE; }
25
26 Int_t Return(Int_t no, void *param=NULL);
27 Bool_t Set(void *fcn, Int_t no, const char *params);
28 void Free(Int_t no);
29
30public:
31 MTaskInteractive(const char *name=NULL, const char *title=NULL);
32 ~MTaskInteractive();
33
34 // This is to be used in compiled code
35 void SetPreProcess(Int_t (*func)(MParList *list)) { fPreProcess = func; Free(0); }
36 void SetProcess(Int_t (*func)()) { fProcess = func; Free(1); }
37 void SetPostProcess(Int_t (*func)()) { fPostProcess = func; Free(2); }
38 void SetReInit(Bool_t (*func)(MParList *list)) { fReInit = func; Free(3); }
39
40 // This is for usage in CINT
41 void SetPreProcess(void *fcn) { Set(fcn, 0, "MParList*"); fPreProcess =0; }
42 void SetProcess(void *fcn) { Set(fcn, 1, ""); fProcess =0; }
43 void SetPostProcess(void *fcn) { Set(fcn, 2, ""); fPostProcess=0; }
44 void SetReInit(void *fcn) { Set(fcn, 3, "MParList*"); fReInit =0; }
45
46 ClassDef(MTaskInteractive, 0) // Interactive task
47};
48
49#endif
Note: See TracBrowser for help on using the repository browser.