source: trunk/Mars/mbase/MTaskInteractive.h@ 19760

Last change on this file since 19760 was 19273, checked in by tbretz, 6 years ago
A lot of code became obsolete with root 6.
File size: 2.5 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#if ROOT_VERSION_CODE < ROOT_VERSION(6,00,00)
15 TMethodCall *fCall[4];
16#endif
17
18 Int_t (*fPreProcess)(MParList *list);
19 Int_t (*fProcess)();
20 Int_t (*fPostProcess)();
21 Bool_t (*fReInit)(MParList *list);
22
23#if ROOT_VERSION_CODE < ROOT_VERSION(6,00,00)
24 Int_t PreProcess(MParList *list) { if (fCall[0]) return Return(0, &list); return fPreProcess ? (*fPreProcess)(list) : kTRUE; }
25 Int_t Process() { if (fCall[1]) return Return(1); return fProcess ? (*fProcess)() : kTRUE; }
26 Int_t PostProcess() { if (fCall[2]) return Return(2); return fPostProcess ? (*fPostProcess)() : kTRUE; }
27 Bool_t ReInit(MParList *list) { if (fCall[3]) return Return(3, &list); return fReInit ? (*fReInit)(list) : kTRUE; }
28
29 Int_t Return(Int_t no, void *param=NULL);
30 Bool_t Set(void *fcn, Int_t no, const char *params);
31 void Free(Int_t no);
32#else
33 Int_t PreProcess(MParList *list) { return fPreProcess ? (*fPreProcess)(list) : kTRUE; }
34 Int_t Process() { return fProcess ? (*fProcess)() : kTRUE; }
35 Int_t PostProcess() { return fPostProcess ? (*fPostProcess)() : kTRUE; }
36 Bool_t ReInit(MParList *list) { return fReInit ? (*fReInit)(list) : kTRUE; }
37
38 void Free(Int_t) { }
39#endif
40
41public:
42 MTaskInteractive(const char *name=NULL, const char *title=NULL);
43 ~MTaskInteractive();
44
45 // This is to be used in compiled code
46 void SetPreProcess(Int_t (*func)(MParList *list)) { fPreProcess = func; Free(0); }
47 void SetProcess(Int_t (*func)()) { fProcess = func; Free(1); }
48 void SetPostProcess(Int_t (*func)()) { fPostProcess = func; Free(2); }
49 void SetReInit(Bool_t (*func)(MParList *list)) { fReInit = func; Free(3); }
50
51#if ROOT_VERSION_CODE < ROOT_VERSION(6,00,00)
52 // This is for usage in CINT
53 void SetPreProcess(void *fcn) { Set(fcn, 0, "MParList*"); fPreProcess =0; }
54 void SetProcess(void *fcn) { Set(fcn, 1, ""); fProcess =0; }
55 void SetPostProcess(void *fcn) { Set(fcn, 2, ""); fPostProcess=0; }
56 void SetReInit(void *fcn) { Set(fcn, 3, "MParList*"); fReInit =0; }
57#endif
58
59 ClassDef(MTaskInteractive, 0) // Interactive task
60};
61
62#endif
Note: See TracBrowser for help on using the repository browser.