Modification of operator=
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTSystem.h
CommitLineData
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
b22e91eb 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*/
f23a6e1a 14
b22e91eb 15/**
16 * @defgroup alihlt_system HLT integration into AliRoot
17 * This section describes the HLT integration into AliRoot.
18 */
f23a6e1a 19
5ec8e281 20#include "AliHLTLogging.h"
21#include <TList.h>
f23a6e1a 22
5ec8e281 23class AliHLTComponentHandler;
24class AliHLTConfiguration;
85465857 25class AliHLTConfigurationHandler;
5ec8e281 26class AliHLTTask;
f23a6e1a 27
bfccbf68 28/**
29 * @class AliHLTSystem
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.
33 *
b22e91eb 34 * @note This class is only used for the @ref alihlt_system.
35 *
36 * @ingroup alihlt_system
bfccbf68 37 */
5ec8e281 38class AliHLTSystem : public AliHLTLogging {
39 public:
bfccbf68 40 /** default constructor */
f23a6e1a 41 AliHLTSystem();
85869391 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&);
bfccbf68 46 /** destructor */
f23a6e1a 47 virtual ~AliHLTSystem();
48
bfccbf68 49 /**
50 * Pointer to an instance of @ref AliHLTComponentHandler.
3b35e87c 51 */
70ed7d01 52 AliHLTComponentHandler* fpComponentHandler; //! transient
bfccbf68 53
54 /**
55 * Pointer to an instance of @ref AliHLTConfigurationHandler.
56 */
70ed7d01 57 AliHLTConfigurationHandler* fpConfigurationHandler; //! transient
f23a6e1a 58
bfccbf68 59 /**
60 * Add a configuration to the end of the list.
61 * @param pConf pointer to configuration to add
5ec8e281 62 */
63 int AddConfiguration(AliHLTConfiguration* pConf);
64
bfccbf68 65 /**
70ed7d01 66 * Insert a configuration to the end of the list after the specified
67 * configuration.
bfccbf68 68 * @param pConf pointer to configuration to insert
69 * @param pPrec pointer to configuration to insert the new one after
5ec8e281 70 */
71 int InsertConfiguration(AliHLTConfiguration* pConf, AliHLTConfiguration* pPrec);
72
bfccbf68 73 /**
74 * Remove a configuration from the list.
75 * @param pConf pointer to configuration to delete
5ec8e281 76 */
77 int DeleteConfiguration(AliHLTConfiguration* pConf);
78
bfccbf68 79 /**
80 * Build a task list from a configuration object.
3b35e87c 81 * This method is used to build the tasks from the 'master' configuration
82 * objects which are added to the HLT system handler. This is an iterative
83 * process since the task might depend upon other configurations. For each
84 * configuration object which has not yet been converted into a task, the
85 * method will be called iteratively. Finally, after building all tasks which
86 * the current one depends on have been created, the task is inserted to the
87 * list of tasks with the InsertTask method.
bfccbf68 88 * @param pConf pointer to configuration to build the task list from
5ec8e281 89 */
90 int BuildTaskList(AliHLTConfiguration* pConf);
91
bfccbf68 92 /**
93 * Clean the list of tasks and delete all the task objects.
3b35e87c 94 */
5ec8e281 95 int CleanTaskList();
96
bfccbf68 97 /**
98 * Insert a task to the task list.
99 * The method first checks whether all dependencies are resolved (i.e. exist
70ed7d01 100 * already in the task list). During this iteration the cross links between
101 * the tasks are set as well. If all dependencies are resolved, the task is
102 * added at the end of the list.
bfccbf68 103 * @param pTask pointer to task to add
3b35e87c 104 */
5ec8e281 105 int InsertTask(AliHLTTask* pTask);
106
bfccbf68 107 /**
108 * Find a task with an id.
109 * @param id CONFIGURATION id (not a COMPONENT id!)
3b35e87c 110 */
5ec8e281 111 AliHLTTask* FindTask(const char* id);
112
bfccbf68 113 /**
114 * Print the task list.
3b35e87c 115 */
5ec8e281 116 void PrintTaskList();
117
53feaef5 118 /**
119 * Run the task list.
9ce4bf4a 120 * The method checks whether the task list has already been build. If not,
121 * or the configuration list has been changed, the @ref BuildTaskList
122 * method is scalled
53feaef5 123 * All tasks of the list will be subsequently processed for each event.
124 * @param iNofEvents number of events
125 * @return neg error code if failed
126 */
127 int Run(Int_t iNofEvents=1);
128
129 /**
9ce4bf4a 130 * Init all tasks from the list.
131 * The @ref AliHLTTask::Init method is called for each task, the components
132 * will be created.
133 * @return neg error code if failed
134 */
135 int InitTasks();
136
137 /**
53feaef5 138 * Start task list.
70ed7d01 139 * The @ref AliHLTTask::StartRun method is called for each task, the
140 * components will be prepared for event processing.
53feaef5 141 * @return neg error code if failed
142 */
143 int StartTasks();
144
145 /**
146 * Process task list.
147 * The @ref AliHLTTask::ProcessTask method is called for each task.
148 * @return neg error code if failed
149 */
150 int ProcessTasks(Int_t eventNo);
151
152 /**
153 * Stop task list.
154 * The @ref AliHLTTask::EndRun method is called for each task, the components
155 * will be cleaned after event processing.
156 * @return neg error code if failed
5ec8e281 157 */
53feaef5 158 int StopTasks();
5ec8e281 159
9ce4bf4a 160 /**
161 * De-init all tasks from the list.
162 * The @ref AliHLTTask::Deinit method is called for each task, the components
163 * will be deleted.
164 * @return neg error code if failed
165 */
166 int DeinitTasks();
167
168 /**
169 * The memory allocation function for components.
170 * This function is part of the running environment of the components.
171 */
172 static void* AllocMemory( void* param, unsigned long size );
173
5ec8e281 174 protected:
5ec8e281 175
176 private:
85869391 177/* TList fConfList; */
178/* int fbListChanged; */
5ec8e281 179
70ed7d01 180 TList fTaskList; // see above
f23a6e1a 181
fc455fba 182 /** the number of instances of AliHLTSystem */
183 static int fgNofInstances; // see above
184
5ec8e281 185 private:
fc455fba 186 ClassDef(AliHLTSystem, 2);
f23a6e1a 187};
188#endif
189