]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/BASE/AliHLTConfigurationHandler.h
- singleton functionality added for component and configuration handler
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTConfigurationHandler.h
CommitLineData
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 25class AliHLTConfiguration;
26
b22e91eb 27/**
28 * @class AliHLTConfigurationHandler
29 * @brief Global Handling of HLT configurations.
30 *
31 * This class implements the global handling of @ref AliHLTConfiguration objects.
32 * It is a list of all configuartion descriptor currently available in the system.
33 * Each @ref AliHLTConfiguration object is registerd automatically with the
34 * handler and put into the list.
35 *
36 * @note This class is only used for the @ref alihlt_system.
37 *
38 * @ingroup alihlt_system
39 */
c38ba6f9 40class AliHLTConfigurationHandler : public AliHLTLogging {
41 public:
b22e91eb 42 /** standard constructor */
c38ba6f9 43 AliHLTConfigurationHandler();
b22e91eb 44
c38ba6f9 45 //AliHLTConfigurationHandler(AliHLTConfiguration* pConf);
b22e91eb 46
47 /** destructor */
c38ba6f9 48 virtual ~AliHLTConfigurationHandler();
49
b005ef92 50 /*****************************************************************************
51 * singleton handling
52 */
53
54 /**
55 * Create an instance from the global sigleton.
56 * Instance has to be destroyed by the Destroy function
57 */
58 static AliHLTConfigurationHandler* CreateHandler();
59
60 /**
61 * Destroy an instance of the global singleton retrieved by
62 * AliHLTConfigurationHandler::CreateHandler()
63 */
64 int Destroy();
65
c38ba6f9 66 /*****************************************************************************
67 * registration
68 */
69
b22e91eb 70 /**
71 * Register a configuration to the global list of configurations.
72 * @param pConf The configuration to register
73 */
c38ba6f9 74 int RegisterConfiguration(AliHLTConfiguration* pConf);
75
b22e91eb 76 /**
77 * Create a configuration and register it.
78 * @param id
79 * @param component
80 * @param sources
81 * @param arguments
82 */
c38ba6f9 83 int CreateConfiguration(const char* id, const char* component, const char* sources, const char* arguments);
84
b22e91eb 85 /**
86 * Remove a configuration from the global list.
87 * @param pConf The configuration to remove
88 */
c38ba6f9 89 int RemoveConfiguration(AliHLTConfiguration* pConf);
b22e91eb 90
91 /**
92 * Remove a configuration from the global list.
93 * @param id The configuration to remove
94 */
c38ba6f9 95 int RemoveConfiguration(const char* id);
96
b22e91eb 97 /**
98 * Find a configuration from the global list.
99 * @param id Id of the configuration to find
100 */
c38ba6f9 101 AliHLTConfiguration* FindConfiguration(const char* id);
102
b22e91eb 103 /**
104 * Print the registered configurations to the logging function.
105 */
c38ba6f9 106 void PrintConfigurations();
107
108
109 private:
b22e91eb 110 /** the list of registered configurations */
fc455fba 111 TList fgListConfigurations; // see above
c38ba6f9 112
b005ef92 113 /** the global singleton */
114 static AliHLTConfigurationHandler* fgpInstance; //!transient
115 /** number of used instances of the global singleton */
116 static int fgNofInstances; //!transient
117
118 ClassDef(AliHLTConfigurationHandler, 2);
c38ba6f9 119};
120
121#endif