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

Last change on this file since 6276 was 4452, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 1.6 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[3];
15
16 Int_t (*fPreProcess)(MParList *list);
17 Int_t (*fProcess)();
18 Int_t (*fPostProcess)();
19
20 Int_t PreProcess(MParList *list) { if (fCall[0]) return Return(0, &list); return fPreProcess ? (*fPreProcess)(list) : kTRUE; }
21 Int_t Process() { if (fCall[1]) return Return(1); return fProcess ? (*fProcess)() : kTRUE; }
22 Int_t PostProcess() { if (fCall[2]) return Return(2); return fPostProcess ? (*fPostProcess)() : kTRUE; }
23
24 Int_t Return(Int_t no, void *param=NULL);
25 Bool_t Set(void *fcn, Int_t no, const char *params);
26 void Free(Int_t no);
27
28public:
29 MTaskInteractive(const char *name=NULL, const char *title=NULL);
30 ~MTaskInteractive();
31
32 // This is to be used in compiled code
33 void SetPreProcess(Int_t (*func)(MParList *list)) { fPreProcess = func; Free(0); }
34 void SetProcess(Int_t (*func)()) { fProcess = func; Free(1); }
35 void SetPostProcess(Int_t (*func)()) { fPostProcess = func; Free(2); }
36
37 // This is for usage in CINT
38 void SetPreProcess(void *fcn) { Set(fcn, 0, "MParList*"); fPreProcess =0; }
39 void SetProcess(void *fcn) { Set(fcn, 1, ""); fProcess =0; }
40 void SetPostProcess(void *fcn) { Set(fcn, 2, ""); fPostProcess=0; }
41
42 ClassDef(MTaskInteractive, 0) // Interactive task
43};
44
45#endif
Note: See TracBrowser for help on using the repository browser.