1 | /////////////////////////////////////////////////////////////////////////////
|
---|
2 | // //
|
---|
3 | // MTask //
|
---|
4 | // //
|
---|
5 | // Base class for all tasks which can perfomed in a tasklist //
|
---|
6 | // For each event processed in the eventloop all the different //
|
---|
7 | // tasks in the tasklist will be processed. //
|
---|
8 | // //
|
---|
9 | // So all tasks must inherit from this baseclass. //
|
---|
10 | // //
|
---|
11 | // The inheritance from MInputStreamID is used to indicate the //
|
---|
12 | // type of event that this task is for. If it is "All" it is executed //
|
---|
13 | // independantly of the actual ID of the task list. //
|
---|
14 | // //
|
---|
15 | // Inside this abstract class, there are three fundamental function: //
|
---|
16 | // //
|
---|
17 | // - PreProcess(): executed before the eventloop starts. Here you //
|
---|
18 | // can initiate different things, open files, etc. //
|
---|
19 | // As an argument this function gets a pointer to the //
|
---|
20 | // parameter list. You can stop the execution by //
|
---|
21 | // kFALSE instread of kTRUE. //
|
---|
22 | // //
|
---|
23 | // - Process(): executed for each event in the eventloop. Do in //
|
---|
24 | // one task after the other (as the occur in the //
|
---|
25 | // tasklist) the action of one task. Only the tasks //
|
---|
26 | // with a Stream ID which matches the actual ID of the //
|
---|
27 | // task list are executed. A task can return kFALSE //
|
---|
28 | // to stop the execuition of the pending taks in a //
|
---|
29 | // list or kCONTINUE to skip the pending tasks. //
|
---|
30 | // //
|
---|
31 | // - PostProcess(): executed after the eventloop. Here you can close //
|
---|
32 | // output files, start display of the run parameter, //
|
---|
33 | // etc. //
|
---|
34 | // //
|
---|
35 | /////////////////////////////////////////////////////////////////////////////
|
---|
36 |
|
---|
37 | #include "MTask.h"
|
---|
38 |
|
---|
39 | ClassImp(MTask)
|
---|
40 |
|
---|
41 | Bool_t MTask::PreProcess( MParList *pList )
|
---|
42 | {
|
---|
43 | //
|
---|
44 | // This is processed before the eventloop starts
|
---|
45 | //
|
---|
46 | // It is the job of the PreProcess to connect the tasks
|
---|
47 | // with the right container in the parameter list.
|
---|
48 | //
|
---|
49 | // the virtual implementation returns kTRUE
|
---|
50 | //
|
---|
51 | return kTRUE;
|
---|
52 | }
|
---|
53 |
|
---|
54 | Bool_t MTask::Process()
|
---|
55 | {
|
---|
56 | //
|
---|
57 | // This is processed for every event in the eventloop
|
---|
58 | //
|
---|
59 | // the virtual implementation returns kTRUE
|
---|
60 | //
|
---|
61 | return kTRUE;
|
---|
62 | }
|
---|
63 |
|
---|
64 | Bool_t MTask::PostProcess()
|
---|
65 | {
|
---|
66 | //
|
---|
67 | // This is processed after the eventloop starts
|
---|
68 | //
|
---|
69 | // the virtual implementation returns kTRUE
|
---|
70 | //
|
---|
71 | return kTRUE;
|
---|
72 | }
|
---|
73 |
|
---|
74 |
|
---|