]>
Commit | Line | Data |
---|---|---|
30338a30 | 1 | //-*- Mode: C++ -*- |
c38ba6f9 | 2 | // $Id$ |
3 | ||
4 | #ifndef ALIHLTCONFIGURATIONHANDLER_H | |
5 | #define ALIHLTCONFIGURATIONHANDLER_H | |
b6800be0 | 6 | /* This file is property of and copyright by the ALICE HLT Project * |
7 | * ALICE Experiment at CERN, All rights reserved. * | |
c38ba6f9 | 8 | * See cxx source for full Copyright notice */ |
9 | ||
10 | /** @file AliHLTConfigurationHandler.h | |
11 | @author Matthias Richter | |
12 | @date | |
b22e91eb | 13 | @brief Global handling of HLT configurations. |
c38ba6f9 | 14 | */ |
15 | ||
30338a30 | 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 | ||
c38ba6f9 | 22 | #include <TList.h> |
c38ba6f9 | 23 | |
7a436c89 | 24 | #include "AliHLTLogging.h" |
52c1c164 | 25 | class AliHLTConfiguration; |
e7b1a4ad | 26 | class TMap; |
52c1c164 | 27 | |
b22e91eb | 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 | */ | |
c38ba6f9 | 41 | class AliHLTConfigurationHandler : public AliHLTLogging { |
42 | public: | |
b22e91eb | 43 | /** standard constructor */ |
c38ba6f9 | 44 | AliHLTConfigurationHandler(); |
b22e91eb | 45 | |
c38ba6f9 | 46 | //AliHLTConfigurationHandler(AliHLTConfiguration* pConf); |
b22e91eb | 47 | |
48 | /** destructor */ | |
c38ba6f9 | 49 | virtual ~AliHLTConfigurationHandler(); |
50 | ||
b005ef92 | 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 | ||
c38ba6f9 | 67 | /***************************************************************************** |
68 | * registration | |
69 | */ | |
70 | ||
b22e91eb | 71 | /** |
72 | * Register a configuration to the global list of configurations. | |
73 | * @param pConf The configuration to register | |
74 | */ | |
c38ba6f9 | 75 | int RegisterConfiguration(AliHLTConfiguration* pConf); |
76 | ||
b22e91eb | 77 | /** |
78 | * Create a configuration and register it. | |
79 | * @param id | |
80 | * @param component | |
81 | * @param sources | |
82 | * @param arguments | |
83 | */ | |
c38ba6f9 | 84 | int CreateConfiguration(const char* id, const char* component, const char* sources, const char* arguments); |
85 | ||
b22e91eb | 86 | /** |
87 | * Remove a configuration from the global list. | |
88 | * @param pConf The configuration to remove | |
89 | */ | |
c38ba6f9 | 90 | int RemoveConfiguration(AliHLTConfiguration* pConf); |
b22e91eb | 91 | |
92 | /** | |
93 | * Remove a configuration from the global list. | |
94 | * @param id The configuration to remove | |
95 | */ | |
c38ba6f9 | 96 | int RemoveConfiguration(const char* id); |
97 | ||
b22e91eb | 98 | /** |
99 | * Find a configuration from the global list. | |
100 | * @param id Id of the configuration to find | |
101 | */ | |
c38ba6f9 | 102 | AliHLTConfiguration* FindConfiguration(const char* id); |
103 | ||
b22e91eb | 104 | /** |
105 | * Print the registered configurations to the logging function. | |
106 | */ | |
c38ba6f9 | 107 | void PrintConfigurations(); |
108 | ||
e7b1a4ad | 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); | |
c38ba6f9 | 131 | |
132 | private: | |
b22e91eb | 133 | /** the list of registered configurations */ |
fc455fba | 134 | TList fgListConfigurations; // see above |
c38ba6f9 | 135 | |
b005ef92 | 136 | /** the global singleton */ |
137 | static AliHLTConfigurationHandler* fgpInstance; //!transient | |
138 | /** number of used instances of the global singleton */ | |
139 | static int fgNofInstances; //!transient | |
140 | ||
e7b1a4ad | 141 | /// component substitution map |
142 | /// key: either TObjString with component id or AliHLTConfiguration object | |
143 | static TMap* fgpSubstitutions; //!transient | |
144 | ||
145 | ClassDef(AliHLTConfigurationHandler, 0); | |
c38ba6f9 | 146 | }; |
147 | ||
148 | #endif |