]>
Commit | Line | Data |
---|---|---|
f23a6e1a | 1 | // @(#) $Id$ |
2 | ||
3 | #ifndef ALIHLTSYSTEM_H | |
4 | #define ALIHLTSYSTEM_H | |
5 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
6 | * See cxx source for full Copyright notice */ | |
7 | ||
8 | /* AliHLTComponentHandler | |
9 | global HLT module management | |
10 | */ | |
11 | ||
12 | ||
13 | #include "AliL3RootTypes.h" | |
5ec8e281 | 14 | #include "AliHLTLogging.h" |
15 | #include <TList.h> | |
f23a6e1a | 16 | |
5ec8e281 | 17 | class AliHLTComponentHandler; |
18 | class AliHLTConfiguration; | |
85465857 | 19 | class AliHLTConfigurationHandler; |
5ec8e281 | 20 | class AliHLTTask; |
f23a6e1a | 21 | |
bfccbf68 | 22 | /** |
23 | * @class AliHLTSystem | |
24 | * Main class for the HLT integration into AliRoot. | |
25 | * The class handles a list of configurations. Configurations are translated | |
26 | * into task lists which can be executed. | |
27 | * | |
28 | */ | |
5ec8e281 | 29 | class AliHLTSystem : public AliHLTLogging { |
30 | public: | |
bfccbf68 | 31 | /** default constructor */ |
f23a6e1a | 32 | AliHLTSystem(); |
bfccbf68 | 33 | /** destructor */ |
f23a6e1a | 34 | virtual ~AliHLTSystem(); |
35 | ||
bfccbf68 | 36 | /** |
37 | * Pointer to an instance of @ref AliHLTComponentHandler. | |
3b35e87c | 38 | */ |
f23a6e1a | 39 | AliHLTComponentHandler* fpComponentHandler; |
bfccbf68 | 40 | |
41 | /** | |
42 | * Pointer to an instance of @ref AliHLTConfigurationHandler. | |
43 | */ | |
85465857 | 44 | AliHLTConfigurationHandler* fpConfigurationHandler; |
f23a6e1a | 45 | |
bfccbf68 | 46 | /** |
47 | * Add a configuration to the end of the list. | |
48 | * @param pConf pointer to configuration to add | |
5ec8e281 | 49 | */ |
50 | int AddConfiguration(AliHLTConfiguration* pConf); | |
51 | ||
bfccbf68 | 52 | /** |
53 | * Insert a configuration to the end of the list after the specified configuration. | |
54 | * @param pConf pointer to configuration to insert | |
55 | * @param pPrec pointer to configuration to insert the new one after | |
5ec8e281 | 56 | */ |
57 | int InsertConfiguration(AliHLTConfiguration* pConf, AliHLTConfiguration* pPrec); | |
58 | ||
bfccbf68 | 59 | /** |
60 | * Remove a configuration from the list. | |
61 | * @param pConf pointer to configuration to delete | |
5ec8e281 | 62 | */ |
63 | int DeleteConfiguration(AliHLTConfiguration* pConf); | |
64 | ||
bfccbf68 | 65 | /** |
66 | * Build a task list from a configuration object. | |
3b35e87c | 67 | * This method is used to build the tasks from the 'master' configuration |
68 | * objects which are added to the HLT system handler. This is an iterative | |
69 | * process since the task might depend upon other configurations. For each | |
70 | * configuration object which has not yet been converted into a task, the | |
71 | * method will be called iteratively. Finally, after building all tasks which | |
72 | * the current one depends on have been created, the task is inserted to the | |
73 | * list of tasks with the InsertTask method. | |
bfccbf68 | 74 | * @param pConf pointer to configuration to build the task list from |
5ec8e281 | 75 | */ |
76 | int BuildTaskList(AliHLTConfiguration* pConf); | |
77 | ||
bfccbf68 | 78 | /** |
79 | * Clean the list of tasks and delete all the task objects. | |
3b35e87c | 80 | */ |
5ec8e281 | 81 | int CleanTaskList(); |
82 | ||
bfccbf68 | 83 | /** |
84 | * Insert a task to the task list. | |
85 | * The method first checks whether all dependencies are resolved (i.e. exist | |
3b35e87c | 86 | * already in the task list). During this iteration the cross links between the |
87 | * tasks are set as well. If all dependencies are resolved, the task is added | |
88 | * at the end of the list. | |
bfccbf68 | 89 | * @param pTask pointer to task to add |
3b35e87c | 90 | */ |
5ec8e281 | 91 | int InsertTask(AliHLTTask* pTask); |
92 | ||
bfccbf68 | 93 | /** |
94 | * Find a task with an id. | |
95 | * @param id CONFIGURATION id (not a COMPONENT id!) | |
3b35e87c | 96 | */ |
5ec8e281 | 97 | AliHLTTask* FindTask(const char* id); |
98 | ||
bfccbf68 | 99 | /** |
100 | * Print the task list. | |
3b35e87c | 101 | */ |
5ec8e281 | 102 | void PrintTaskList(); |
103 | ||
104 | /* run the task list | |
105 | */ | |
106 | int Run(); | |
107 | ||
108 | protected: | |
109 | int ProcessTask(); | |
110 | int StartEvent(); | |
111 | int ProcessEvent(); | |
112 | int StopEvent(); | |
113 | ||
114 | private: | |
115 | TList fConfList; | |
116 | int fbListChanged; | |
117 | ||
118 | TList fTaskList; | |
f23a6e1a | 119 | |
5ec8e281 | 120 | private: |
121 | ClassDef(AliHLTSystem, 0); | |
f23a6e1a | 122 | }; |
123 | #endif | |
124 |