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 */
10 /** @file AliHLTConfigurationHandler.h
11 @author Matthias Richter
13 @brief Global handling of HLT configurations.
16 // see below for class documentation
18 // refer to README to build package
20 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
24 #include "AliHLTLogging.h"
25 class AliHLTConfiguration;
29 * @class AliHLTConfigurationHandler
30 * @brief Global Handling of HLT configurations.
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.
37 * @note This class is only used for the @ref alihlt_system.
39 * @ingroup alihlt_system
41 class AliHLTConfigurationHandler : public AliHLTLogging {
43 /** standard constructor */
44 AliHLTConfigurationHandler();
46 //AliHLTConfigurationHandler(AliHLTConfiguration* pConf);
49 virtual ~AliHLTConfigurationHandler();
51 /*****************************************************************************
56 * Create an instance from the global sigleton.
57 * Instance has to be destroyed by the Destroy function
59 static AliHLTConfigurationHandler* CreateHandler();
62 * Destroy an instance of the global singleton retrieved by
63 * AliHLTConfigurationHandler::CreateHandler()
67 /*****************************************************************************
72 * Register a configuration to the global list of configurations.
73 * @param pConf The configuration to register
75 int RegisterConfiguration(AliHLTConfiguration* pConf);
78 * Create a configuration and register it.
84 int CreateConfiguration(const char* id, const char* component, const char* sources, const char* arguments);
87 * Remove a configuration from the global list.
88 * @param pConf The configuration to remove
90 int RemoveConfiguration(AliHLTConfiguration* pConf);
93 * Remove a configuration from the global list.
94 * @param id The configuration to remove
96 int RemoveConfiguration(const char* id);
99 * Find a configuration from the global list.
100 * @param id Id of the configuration to find
102 AliHLTConfiguration* FindConfiguration(const char* id);
105 * Print the registered configurations to the logging function.
107 void PrintConfigurations();
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.
116 static int AddSubstitution(const char* componentId, const AliHLTConfiguration& subst);
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.
125 static int AddSubstitution(const AliHLTConfiguration& conf , const AliHLTConfiguration& subst);
128 * Find component substitution.
130 static const AliHLTConfiguration* FindSubstitution(const AliHLTConfiguration& conf);
133 /** the list of registered configurations */
134 TList fgListConfigurations; // see above
136 /** the global singleton */
137 static AliHLTConfigurationHandler* fgpInstance; //!transient
138 /** number of used instances of the global singleton */
139 static int fgNofInstances; //!transient
141 /// component substitution map
142 /// key: either TObjString with component id or AliHLTConfiguration object
143 static TMap* fgpSubstitutions; //!transient
145 ClassDef(AliHLTConfigurationHandler, 0);