Include Methods to derive TOF AlignObjs from Survey Data
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTModuleAgent.h
CommitLineData
242bb794 1// @(#) $Id$
2
3#ifndef ALIHLTMODULEAGENT_H
4#define ALIHLTMODULEAGENT_H
5/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * See cxx source for full Copyright notice */
7
8/** @file AliHLTModuleAgent.h
9 @author Matthias Richter
10 @date
11 @brief Agent helper class for component libraries.
12 @note The class is used in Offline (AliRoot) context
13*/
14
15#include <TObject.h>
16#include <TList.h>
17#include "AliHLTLogging.h"
18#include "AliHLTConfiguration.h"
19#include "AliHLTConfigurationHandler.h"
20
21class AliRunLoader;
22
23/**
24 * @class AliHLTModuleAgent
25 * @brief Agent helper class for HLT sub modules, e.g. PHOS, TPC, Trigger
26 *
c215072c 27 * This class implements the agent base class for the HLT sub modules.
28 * The agent of a library gives information on the features of the module,
29 * like the configurations to run and other component libraries it depends
30 * on.
31 *
32 * All HLT component libraries are loaded on demand through the HLT steering
33 * instance (@ref AliHLTSystem). A library can implement an agent derived
34 * from this base class, and has to define one global object of this agent
35 * in the code. The agent will be registered automatically, and the features
36 * can be queried when required.
37 *
38 * This is usually done during running the AliRoot Reconstruction (see
39 * <tt>AliReconstruction</tt>. The HLT implemets the AliHLTReconstructor which
40 * holds the HLT steering object. Several flags can be specified as options
41 * via the SetOption method of AliReconstruction, including the component
42 * libraries to be loaded.
242bb794 43 *
44 * There must be only one agent per module/library.
45 *
46 * @ingroup alihlt_system
47 */
48class AliHLTModuleAgent : public TObject, public AliHLTLogging {
49 public:
50 /**
51 * standard constructor. The agent is automatically registered in the
52 * global agent manager
53 */
54 AliHLTModuleAgent();
55 /** not a valid copy constructor, defined according to effective C++ style */
56 AliHLTModuleAgent(const AliHLTModuleAgent&);
57 /** not a valid assignment op, but defined according to effective C++ style */
58 AliHLTModuleAgent& operator=(const AliHLTModuleAgent&);
59 /** destructor */
60 virtual ~AliHLTModuleAgent();
61
62 /**
63 * Print status info.
64 * Short summary on registered agents. This function acts globally on the list
65 * of agents if no specific agent is specified.
66 */
67 static void PrintStatus(const char* agent=NULL);
68
69 /**
70 * Get the first agent in the list
71 * @return pointer to first agent in the list, NULL if empty
72 */
73 static AliHLTModuleAgent* GetFirstAgent();
74
75 /**
76 * Get the next agent in the list
77 * @return pointer to next agent in the list, NULL if end of list
78 */
79 static AliHLTModuleAgent* GetNextAgent();
80
81 /**
82 * Register all configurations belonging to this module with the
83 * AliHLTConfigurationHandler. The agent can adapt the configurations
84 * to be registered to the current AliRoot setup by checking the
85 * runloader.
96bda103 86 * @param handler [in] the configuration handler
87 * @param runloader [in] AliRoot runloader
242bb794 88 * @return neg. error code if failed
89 */
90 virtual int CreateConfigurations(AliHLTConfigurationHandler* handler,
91 AliRunLoader* runloader=NULL) const;
92
93 /**
94 * Get the top configurations belonging to this module.
95 * A top configuration describes a processing chain. It can simply be
96 * described by the last configuration(s) in the chain.
97 * The agent can adapt the configurations to be registered to the current
98 * AliRoot setup by checking the runloader.
96bda103 99 * @param runloader [in] AliRoot runloader
242bb794 100 * @return string containing the top configurations separated by blanks
101 */
102 virtual const char* GetTopConfigurations(AliRunLoader* runloader=NULL) const;
103
104 /**
105 * Component libraries which the configurations of this agent depend on.
106 * @return list of component libraries as a blank-separated string.
107 */
108 virtual const char* GetRequiredComponentLibraries() const;
109
110 /**
111 * Register componets.
112 * This method can be used to register components for the module instead
113 * of the 'static object approach'. Registration is don by passing a
114 * sample object to @ref AliHLTComponentHandler::RegisterComponent<br>
115 * \em Note: The sample object is owned by the agent, make sure to delete
116 * it.
117 */
118 virtual int RegisterComponents(AliRunLoader* runloader=NULL) const;
119
120 protected:
121
122 private:
123 /**
124 * Register agent in the global list.
125 * @return neg. error code if failed
126 */
127 static int Register(AliHLTModuleAgent* pAgent);
128
129 /**
130 * Unregister agent in the global list.
131 * @return neg. error code if failed
132 */
133 static int Unregister(AliHLTModuleAgent* pAgent);
134
135 /** the list of active agents */
136 static TList fgAgentList;
137
138 /** the current object link (list position) */
139 static TObjLink* fgCurrentLnk;
140
141 ClassDef(AliHLTModuleAgent, 0);
142};
143
144#endif