]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTSystem.h
added code documentation for BASE, SampleLib, TPCLib and build system
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTSystem.h
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 /** @file   AliHLTSystem.h
9     @author Matthias Richter
10     @date   
11     @brief  Global HLT module management and AliRoot integration.
12     @note   The class is used in Offline (AliRoot) context
13 */
14
15 /**
16  * @defgroup alihlt_system HLT integration into AliRoot
17  * This section describes the HLT integration into AliRoot.
18  */
19
20 #include "AliL3RootTypes.h"
21 #include "AliHLTLogging.h"
22 #include <TList.h>
23
24 class AliHLTComponentHandler;
25 class AliHLTConfiguration;
26 class AliHLTConfigurationHandler;
27 class AliHLTTask;
28
29 /**
30  * @class AliHLTSystem
31  * Main class for the HLT integration into AliRoot.
32  * The class handles a list of configurations. Configurations are translated
33  * into task lists which can be executed. 
34  *
35  * @note This class is only used for the @ref alihlt_system.
36  *
37  * @ingroup alihlt_system
38  */
39 class AliHLTSystem : public AliHLTLogging {
40  public:
41   /** default constructor */
42   AliHLTSystem();
43   /** destructor */
44   virtual ~AliHLTSystem();
45
46   /**
47    * Pointer to an instance of @ref AliHLTComponentHandler.
48    */
49   AliHLTComponentHandler* fpComponentHandler;
50
51   /**
52    * Pointer to an instance of @ref AliHLTConfigurationHandler.
53    */
54   AliHLTConfigurationHandler* fpConfigurationHandler;
55
56   /**
57    * Add a configuration to the end of the list.
58    * @param pConf    pointer to configuration to add
59    */
60   int AddConfiguration(AliHLTConfiguration* pConf);
61
62   /**
63    * Insert a configuration to the end of the list after the specified configuration.
64    * @param pConf    pointer to configuration to insert
65    * @param pPrec    pointer to configuration to insert the new one after
66    */
67   int InsertConfiguration(AliHLTConfiguration* pConf, AliHLTConfiguration* pPrec);
68
69   /**
70    * Remove a configuration from the list.
71    * @param pConf    pointer to configuration to delete
72    */
73   int DeleteConfiguration(AliHLTConfiguration* pConf);
74
75   /**
76    * Build a task list from a configuration object.
77    * This method is used to build the tasks from the 'master' configuration
78    * objects which are added to the HLT system handler. This is an iterative
79    * process since the task might depend upon other configurations. For each
80    * configuration object which has not yet been converted into a task, the
81    * method will be called iteratively. Finally, after building all tasks which
82    * the current one depends on have been created, the task is inserted to the
83    * list of tasks with the InsertTask method.
84    * @param pConf    pointer to configuration to build the task list from
85    */
86   int BuildTaskList(AliHLTConfiguration* pConf);
87
88   /**
89    * Clean the list of tasks and delete all the task objects.
90    */
91   int CleanTaskList();
92
93   /**
94    * Insert a task to the task list.
95    * The method first checks whether all dependencies are resolved (i.e. exist 
96    * already in the task list). During this iteration the cross links between the 
97    * tasks are set as well. If all dependencies are resolved, the task is added
98    * at the end of the list.
99    * @param pTask    pointer to task to add
100    */
101   int InsertTask(AliHLTTask* pTask);
102
103   /**
104    * Find a task with an id.
105    * @param id       CONFIGURATION id (not a COMPONENT id!)
106    */
107   AliHLTTask* FindTask(const char* id);
108
109   /**
110    * Print the task list.
111    */
112   void PrintTaskList();
113
114   /* run the task list
115    */
116   int Run();
117
118  protected:
119   int ProcessTask();
120   int StartEvent();
121   int ProcessEvent();
122   int StopEvent();
123  
124  private:
125   TList fConfList;
126   int fbListChanged;
127
128   TList fTaskList;
129
130  private:
131   ClassDef(AliHLTSystem, 0);
132 };
133 #endif
134