4 #ifndef ALIHLTONLINECONFIGURATION_H
5 #define ALIHLTONLINECONFIGURATION_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 AliHLTOnlineConfiguration.h
11 /// @author Matthias Richter
12 /// @author Lars Christian Raae
14 /// @brief Description of the HLT online configuration
18 #include "AliHLTLogging.h"
25 * @class AliHLTOnlineConfiguration
26 * @brief Description of the HLT online configuration
27 * This class wraps an online HLT configuration file for storage in a
31 * The class provides easy access to the XML tags of the configuration through
34 * The online configuration is translated into a tree like configuration
35 * structure. The Draw function can be used to create a graph.
37 * The xml configuration is loaded into an internal TArrayC buffer, which
38 * is automatically compressed depending on the compression level used for
39 * root file storage. Later extension will be the implementation of a custom
40 * Streamer function implementing the most efficient compression.
42 class AliHLTOnlineConfiguration : public TObject, public AliHLTLogging {
44 /// standard constructor
45 AliHLTOnlineConfiguration();
47 virtual ~AliHLTOnlineConfiguration();
49 /// load configuration from file
50 int LoadConfiguration(const char* filename);
52 /// compress the xml buffer
55 /// uncompress the xml buffer
58 /// parse the xml buffer
61 /// get default chains (sources of HLTOutFormatter)
62 const char* GetDefaultChains() const {return fDefaultChains.Data();}
64 /// get component libraries
65 TString GetComponentLibraries();
67 /// overloaded from TObject, print info
68 virtual void Print(const char* options) const;
70 /// overloaded from TObject, more crude data dump
71 virtual void Dump() const;
73 /// overloaded from TObject, clear object
74 virtual void Clear(Option_t * option="");
76 /// overloaded from TObject, clone object
77 virtual TObject *Clone(const char *newname="") const;
79 /// overloaded from TObject, copy object
80 virtual void Copy(TObject &object) const;
82 /// overloaded from TObject, draw graph of the configuration
83 virtual void Draw(Option_t *option="");
85 /// custom status bits of TObject
86 /// bit 14 to 23 can be freely used
87 /// use functions SetBit, ResetBit, TestBit
89 kLoaded = BIT(14), // xml buffer is loaded
90 kCompressed = BIT(15), // xml buffer is compressed
91 kParsed = BIT(16), // already parsed
95 /// buffer for XML configuration
97 /// size of XML buffer
99 /// list of parsed configuration entries
100 TList fConfEntryList;
101 /// default chains (sources of HLTOutFormatter)
102 TString fDefaultChains;
105 * Parse XML configuration.
106 * @param node XML root node of configuration
108 * -EINVAL if unparsable or empty configuration
109 * -EPROTO if no configuration is loaded
110 * 0 if any elements were successfully parsed
112 int ParseConfiguration(TXMLNode* node);
115 * Parse XML configuration entry.
116 * @param node XML root node of entry
117 * @param id online component ID
118 * @param type online component type
120 * -EINVAL if parsing error
121 * 0 if entry was successfully parsed
123 int ParseEntry(TXMLNode* node, const char* id, const char* type);
126 * Parse standard component configuration.
127 * @param id online component ID
128 * @param type online component type
129 * @param cmd online command
130 * @param sources component sources
131 * @param nodes online computing nodes
133 * -EINVAL if parsing error
134 * 0 if entry was successfully parsed
136 int ParseStandardComponent(const char* id, const char* type, const char* cmd,
137 TString& sources, TString& nodes);
140 * Parse RORCPublisher configuration.
141 * @param id online component ID
142 * @param type online component type
143 * @param cmd online command
144 * @param sources component sources
145 * @param nodes online computing nodes
147 * -EINVAL if parsing error
148 * 0 if entry was successfully parsed
150 int ParseRORCPublisher(const char* id, const char* type, const char* cmd,
151 TString& sources, TString& nodes);
154 * Parse TCPDumpSubscriber configuration.
155 * @param id online component ID
156 * @param type online component type
157 * @param cmd online command
158 * @param sources component sources
159 * @param nodes online computing nodes
161 * -EINVAL if parsing error
162 * 0 if entry was successfully parsed
164 int ParseTCPDumpSubscriber(const char* id, const char* type, const char* cmd,
165 TString& sources, TString& nodes);
168 * Parse Relay configuration.
169 * @param id online component ID
170 * @param type online component type
171 * @param cmd online command
172 * @param sources component sources
173 * @param nodes online computing nodes
175 * -EINVAL if parsing error
176 * 0 if entry was successfully parsed
178 int ParseRelay(const char* id, const char* type, const char* cmd,
179 TString& sources, TString& nodes);
182 * Parse HLTOutFormatter configuration.
183 * @param id online component ID
184 * @param type online component type
185 * @param cmd online command
186 * @param sources component sources
187 * @param nodes online computing nodes
189 * -EINVAL if parsing error
190 * 0 if entry was successfully parsed
192 int ParseHLTOutFormatter(const char* id, const char* type, const char* cmd,
193 TString& sources, TString& nodes);
196 * Parse HLTOutWriterSubscriber configuration.
197 * @param id online component ID
198 * @param type online component type
199 * @param cmd online command
200 * @param sources component sources
201 * @param nodes online computing nodes
203 * -EINVAL if parsing error
204 * 0 if entry was successfully parsed
206 int ParseHLTOutWriterSubscriber(const char* id, const char* type,
207 const char* cmd, TString& sources, TString& nodes);
209 ClassDef(AliHLTOnlineConfiguration, 1); // description of HLT online configuration