]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTComponentConfiguration.h
replacing calls to AliCDBStorage::GetLatestVersion by handling of exception introduce...
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTComponentConfiguration.h
1 //-*- Mode: C++ -*-
2 // $Id$
3 #ifndef ALIHLTCOMPONENTCONFIGURATION_H
4 #define ALIHLTCOMPONENTCONFIGURATION_H
5 //* This file is property of and copyright by the ALICE HLT Project        * 
6 //* ALICE Experiment at CERN, All rights reserved.                         *
7 //* See cxx source for full Copyright notice                               *
8
9 /// @file   AliHLTComponentConfiguration.h
10 /// @author Matthias Richter
11 /// @date   2010-11-26
12 /// @brief  HLT configuration description for a single component.
13 /// @note   The class is used in Offline (AliRoot) context
14
15 #include "AliHLTConfiguration.h"
16
17 /**
18  * @class AliHLTComponentConfiguration
19  * @brief Description of an HLT component configuration.
20  *
21  * In addition to the base class AliHLTConfiguration the additional online
22  * component parameters are available in this class
23  * - node name
24  * - shared memory settings
25  *
26  * This class is only used in the HLT offline environment, see @ref alihlt_system
27  * for more details.
28  *
29  * @ingroup alihlt_system
30  */
31 class AliHLTComponentConfiguration : public AliHLTConfiguration {
32  public:
33   /**
34    * standard constructor. The configuration is automatically registered in the
35    * global configuration manager
36    */
37   AliHLTComponentConfiguration();
38   /**
39    * constructor. The configuration is automatically registered in the
40    * global configuration manager
41    * @param id         unique id of the configuration
42    * @param component  component id
43    * @param sources    blank separated list of source configuration ids
44    * @param arguments  argument string passed to the component at initialization
45    */
46   AliHLTComponentConfiguration(const char* id, const char* component,
47                       const char* sources, const char* arguments);
48   /** copy constructor */
49   AliHLTComponentConfiguration(const AliHLTComponentConfiguration& src);
50   /** assignment op */
51   AliHLTComponentConfiguration& operator=(const AliHLTComponentConfiguration& src);
52   /** destructor */
53   virtual ~AliHLTComponentConfiguration();
54
55   /**
56    * Return the component library.
57    */
58   const char* GetComponentLibrary() const {return fLibrary.Data();}
59
60   /**
61    * Return the online command.
62    */
63   const char* GetOnlineCommand() const {return fOnlineCommand.Data();}
64
65   /**
66    * Return the online nodes.
67    */
68   const char* GetNodeSettings() const {return fNodeNames.Data();}
69   
70   void SetComponentLibrary(const char* library) {fLibrary=library;}
71
72   void SetNodeNames(const char* nodes) {fNodeNames=nodes;}
73
74   void AddNode(const char* node) {
75     if (!node) return;
76     if (!fNodeNames.IsNull()) fNodeNames+=" "; fNodeNames+=node;
77   }
78
79   /// set the online command string
80   void SetOnlineCommand(const char* cmd);
81
82   /**
83    * overloaded from AliHLTConfiguration
84    */
85   virtual void PrintStatus() const;
86
87   /**
88    * overloaded from AliHLTConfiguration
89    * options:
90    *   status  - print status
91    */
92   virtual void Print(const char* option="") const;
93
94
95  protected:
96   
97  private:
98   /// component library
99   TString fLibrary; // component library
100
101   /// list of nodes of the component instances
102   TString fNodeNames; // list of node names
103
104   /// original command in the online configuration
105   TString fOnlineCommand; // original online command
106
107   ClassDef(AliHLTComponentConfiguration, 1);
108 };
109
110 #endif