5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * See cxx source for full Copyright notice */
8 /** @file AliHLTSystem.h
9 @author Matthias Richter
11 @brief Global HLT module management and AliRoot integration.
12 @note The class is used in Offline (AliRoot) context
16 * @defgroup alihlt_system HLT integration into AliRoot
17 * This section describes the HLT integration into AliRoot.
20 #include "AliHLTLogging.h"
23 class AliHLTComponentHandler;
24 class AliHLTConfiguration;
25 class AliHLTConfigurationHandler;
30 * Main class for the HLT integration into AliRoot.
31 * The class handles a list of configurations. Configurations are translated
32 * into task lists which can be executed.
34 * @note This class is only used for the @ref alihlt_system.
36 * @ingroup alihlt_system
38 class AliHLTSystem : public AliHLTLogging {
40 /** default constructor */
42 /** not a valid copy constructor, defined according to effective C++ style */
43 AliHLTSystem(const AliHLTSystem&);
44 /** not a valid assignment op, but defined according to effective C++ style */
45 AliHLTSystem& operator=(const AliHLTSystem&);
47 virtual ~AliHLTSystem();
50 * Pointer to an instance of @ref AliHLTComponentHandler.
52 AliHLTComponentHandler* fpComponentHandler;
55 * Pointer to an instance of @ref AliHLTConfigurationHandler.
57 AliHLTConfigurationHandler* fpConfigurationHandler;
60 * Add a configuration to the end of the list.
61 * @param pConf pointer to configuration to add
63 int AddConfiguration(AliHLTConfiguration* pConf);
66 * Insert a configuration to the end of the list after the specified configuration.
67 * @param pConf pointer to configuration to insert
68 * @param pPrec pointer to configuration to insert the new one after
70 int InsertConfiguration(AliHLTConfiguration* pConf, AliHLTConfiguration* pPrec);
73 * Remove a configuration from the list.
74 * @param pConf pointer to configuration to delete
76 int DeleteConfiguration(AliHLTConfiguration* pConf);
79 * Build a task list from a configuration object.
80 * This method is used to build the tasks from the 'master' configuration
81 * objects which are added to the HLT system handler. This is an iterative
82 * process since the task might depend upon other configurations. For each
83 * configuration object which has not yet been converted into a task, the
84 * method will be called iteratively. Finally, after building all tasks which
85 * the current one depends on have been created, the task is inserted to the
86 * list of tasks with the InsertTask method.
87 * @param pConf pointer to configuration to build the task list from
89 int BuildTaskList(AliHLTConfiguration* pConf);
92 * Clean the list of tasks and delete all the task objects.
97 * Insert a task to the task list.
98 * The method first checks whether all dependencies are resolved (i.e. exist
99 * already in the task list). During this iteration the cross links between the
100 * tasks are set as well. If all dependencies are resolved, the task is added
101 * at the end of the list.
102 * @param pTask pointer to task to add
104 int InsertTask(AliHLTTask* pTask);
107 * Find a task with an id.
108 * @param id CONFIGURATION id (not a COMPONENT id!)
110 AliHLTTask* FindTask(const char* id);
113 * Print the task list.
115 void PrintTaskList();
119 * The method checks whether the task list has already been build. If not,
120 * or the configuration list has been changed, the @ref BuildTaskList
122 * All tasks of the list will be subsequently processed for each event.
123 * @param iNofEvents number of events
124 * @return neg error code if failed
126 int Run(Int_t iNofEvents=1);
129 * Init all tasks from the list.
130 * The @ref AliHLTTask::Init method is called for each task, the components
132 * @return neg error code if failed
138 * The @ref AliHLTTask::StartRun method is called for each task, the components
139 * will be prepared for event processing.
140 * @return neg error code if failed
146 * The @ref AliHLTTask::ProcessTask method is called for each task.
147 * @return neg error code if failed
149 int ProcessTasks(Int_t eventNo);
153 * The @ref AliHLTTask::EndRun method is called for each task, the components
154 * will be cleaned after event processing.
155 * @return neg error code if failed
160 * De-init all tasks from the list.
161 * The @ref AliHLTTask::Deinit method is called for each task, the components
163 * @return neg error code if failed
168 * The memory allocation function for components.
169 * This function is part of the running environment of the components.
171 static void* AllocMemory( void* param, unsigned long size );
180 /* TList fConfList; */
181 /* int fbListChanged; */
186 ClassDef(AliHLTSystem, 1);