]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTConfigurationHandler.h
Update analysis classes for combination of different algorithms
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTConfigurationHandler.h
1 //-*- Mode: C++ -*-
2 // $Id$
3
4 #ifndef ALIHLTCONFIGURATIONHANDLER_H
5 #define ALIHLTCONFIGURATIONHANDLER_H
6 /* This file is property of and copyright by the ALICE HLT Project        * 
7  * ALICE Experiment at CERN, All rights reserved.                         *
8  * See cxx source for full Copyright notice                               */
9
10 /** @file   AliHLTConfigurationHandler.h
11     @author Matthias Richter
12     @date   
13     @brief  Global handling of HLT configurations.
14 */
15
16 // see below for class documentation
17 // or
18 // refer to README to build package
19 // or
20 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt   
21
22 #include <TList.h>
23
24 #include "AliHLTLogging.h"
25 class AliHLTConfiguration;
26 class TMap;
27
28 /**
29  * @class AliHLTConfigurationHandler
30  * @brief Global Handling of HLT configurations.
31  *
32  * This class implements the global handling of @ref AliHLTConfiguration objects.
33  * It is a list of all configuartion descriptor currently available in the system.
34  * Each @ref AliHLTConfiguration object is registerd automatically with the
35  * handler and put into the list.
36  *
37  * @note This class is only used for the @ref alihlt_system.
38  *
39  * @ingroup alihlt_system
40  */
41 class AliHLTConfigurationHandler : public AliHLTLogging {
42  public:
43   /** standard constructor */
44   AliHLTConfigurationHandler();
45   
46   //AliHLTConfigurationHandler(AliHLTConfiguration* pConf);
47
48   /** destructor */
49   virtual ~AliHLTConfigurationHandler();
50
51   /*****************************************************************************
52    * singleton handling
53    */
54
55   /**
56    * Create an instance from the global sigleton.
57    * Instance has to be destroyed by the Destroy function
58    */
59   static AliHLTConfigurationHandler* CreateHandler();
60
61   /**
62    * Destroy an instance of the global singleton retrieved by
63    * AliHLTConfigurationHandler::CreateHandler()
64    */
65   int Destroy();
66
67   /*****************************************************************************
68    * registration
69    */
70
71   /**
72    * Register a configuration to the global list of configurations.
73    * @param pConf     The configuration to register
74    */
75   int RegisterConfiguration(AliHLTConfiguration* pConf);
76
77   /**
78    * Create a configuration and register it.
79    * @param id
80    * @param component
81    * @param sources
82    * @param arguments
83    */
84   int CreateConfiguration(const char* id, const char* component, const char* sources, const char* arguments);
85
86   /**
87    * Remove a configuration from the global list.
88    * @param pConf     The configuration to remove
89    */
90   int RemoveConfiguration(AliHLTConfiguration* pConf);
91
92   /**
93    * Remove a configuration from the global list.
94    * @param id     The configuration to remove
95    */
96   int RemoveConfiguration(const char* id);
97
98   /**
99    * Find a configuration from the global list.
100    * @param id     Id of the configuration to find
101    */
102   AliHLTConfiguration* FindConfiguration(const char* id);
103
104   /**
105    * Print the registered configurations to the logging function.
106    */
107   void PrintConfigurations();
108
109   /**
110    * Add a component substitution by component id.
111    * All components of the specified component id will be replaced by the
112    * substitution component, the component arguments are replaced accordingly.
113    * Component substitution is in particular useful if the input to a specific
114    * component should be written to file.
115    */
116   static int AddSubstitution(const char* componentId, const AliHLTConfiguration& subst);
117
118   /**
119    * Add a component substitution by configuration id.
120    * The component of the specified configuration will be replaced by the
121    * substitution component, the component arguments are replaced accordingly.
122    * Component substitution is in particular useful if the input to a specific
123    * component should be written to file.
124    */
125   static int AddSubstitution(const AliHLTConfiguration& conf , const AliHLTConfiguration& subst);
126
127   /**
128    * Find component substitution.
129    */
130   static const AliHLTConfiguration* FindSubstitution(const AliHLTConfiguration& conf);
131
132  private:
133   /** the list of registered configurations */
134   TList fgListConfigurations;                              // see above
135
136   /** the global singleton */
137   static AliHLTConfigurationHandler* fgpInstance;                      //!transient
138   /** number of used instances of the global singleton */
139   static int fgNofInstances;                                       //!transient 
140
141   /// component substitution map
142   /// key: either TObjString with component id or AliHLTConfiguration object
143   static TMap* fgpSubstitutions;                                    //!transient 
144
145   ClassDef(AliHLTConfigurationHandler, 0);
146 };
147
148 #endif