]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTConfiguration.h
Enlarged cut on cluster matching in AliITSVertexerCosmics. Needed to improve efficien...
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTConfiguration.h
index 71027049028c02acc5bf320c0086ab94295f58c2..88ed254a3b0ff548b944a6bb2d1b3235bd37d961 100644 (file)
@@ -1,8 +1,10 @@
+//-*- Mode: C++ -*-
 // @(#) $Id$
 
 #ifndef ALIHLTCONFIGURATION_H
 #define ALIHLTCONFIGURATION_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+/* This file is property of and copyright by the ALICE HLT Project        * 
+ * ALICE Experiment at CERN, All rights reserved.                         *
  * See cxx source for full Copyright notice                               */
 
 /** @file   AliHLTConfiguration.h
     @note   The class is used in Offline (AliRoot) context
 */
 
-#include <cerrno>
+// see below for class documentation
+// or
+// refer to README to build package
+// or
+// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt   
+
+#include <vector>
 #include <TObject.h>
 #include <TList.h>
 #include "AliHLTDataTypes.h"
@@ -59,14 +67,16 @@ class AliHLTConfiguration : public TObject, public AliHLTLogging {
    * @param component  component id
    * @param sources    blank separated list of source configuration ids
    * @param arguments  argument string passed to the component at initialization
+   * @param bufsize    size of the output buffer in byte, the string can contain a
+   *                   number prepended by a unit, e.g. 1M, allowed units 'k' and 'M'
    */
   AliHLTConfiguration(const char* id, const char* component,
-                     const char* sources, const char* arguments);
-  /** not a valid copy constructor, defined according to effective C++ style */
-  AliHLTConfiguration(const AliHLTConfiguration&);
-  /** not a valid assignment op, but defined according to effective C++ style */
-  AliHLTConfiguration& operator=(const AliHLTConfiguration&);
-  /** destructor */
+                     const char* sources, const char* arguments,
+                     const char* bufsize=NULL);
+  /** copy constructor */
+  AliHLTConfiguration(const AliHLTConfiguration& src);
+  /** assignment op */
+  AliHLTConfiguration& operator=(const AliHLTConfiguration& src);
   /** destructor */
   virtual ~AliHLTConfiguration();
 
@@ -82,7 +92,7 @@ class AliHLTConfiguration : public TObject, public AliHLTLogging {
   /**
    * Global de-init and cleanup of the global configuration handler
    */
-  static int GlobalDeinit();
+  static int GlobalDeinit(AliHLTConfigurationHandler* pHandler);
 
   /*****************************************************************************
    * properties of the configuration
@@ -101,7 +111,17 @@ class AliHLTConfiguration : public TObject, public AliHLTLogging {
    * The id is a unique string.
    * @return id of the component
    */
-  const char* GetComponentID() {return fComponent;}
+  const char* GetComponentID() const {return fComponent;}
+
+  /**
+   * Return the source string.
+   */
+  const char* GetSourceSettings() const {return fStringSources;}
+
+  /**
+   * Return the argument string.
+   */
+  const char* GetArgumentSettings() const {return fArguments;}
 
   /**
    * Print status info.
@@ -170,6 +190,31 @@ class AliHLTConfiguration : public TObject, public AliHLTLogging {
    */
   int GetArguments(const char*** pArgv);
 
+  /**
+   * Get output buffer size.
+   * @return size in byte or -1 if not specified
+   */
+  int GetOutputBufferSize() const {return fBufferSize;}
+
+  /**
+   * Two configurations are considered equal if all properties match
+   */
+  bool operator==(const AliHLTConfiguration& c) const {
+    return (fID==c.fID) && (fComponent==c.fComponent) && (fStringSources==c.fStringSources) && (fArguments==c.fArguments);
+  }
+  bool operator!=(const AliHLTConfiguration& c) const {
+    return !(*this==c);
+  }
+
+  /**
+   * Helper function to build a vector from an argument string.
+   * The function allocates memory for each token. The caller is responsible
+   * for cleaning the strings recursively.
+   * @param arg       pointer to argument string
+   * @param argList   target to receive the argument list
+   */
+  static int InterpreteString(const char* arg, vector<char*>& argList);
+
  protected:
   
 
@@ -182,23 +227,24 @@ class AliHLTConfiguration : public TObject, public AliHLTLogging {
    */
   int ExtractArguments();
 
-  /* helper function to build a vector from an argument string
+  /**
+   * Convert buffer size string to number
    */
-  int InterpreteString(const char* arg, vector<char*>& argList);
+  int ConvertSizeString(const char* strSize) const;
 
   /** id of this configuration */
-  const char* fID;
+  TString fID;                                                     // see above
   /** component id of this configuration */
-  const char* fComponent;
+  TString fComponent;                                              // see above
 
   /** the <i>sources</i> string as passed to the constructor */
-  const char* fStringSources;
+  TString fStringSources;                                          // see above
   /** number of resolved sources, -1 indicates re-evaluation */
-  int fNofSources;
+  int fNofSources;                                                 // see above
   /** list of sources */
-  vector<AliHLTConfiguration*> fListSources;
+  vector<AliHLTConfiguration*> fListSources;                       // see above
   /** iterator for the above list */
-  vector<AliHLTConfiguration*>::iterator fListSrcElement;
+  vector<AliHLTConfiguration*>::iterator fListSrcElement;          // see above
 
   /**
    * The argument string as passed to the constructor.
@@ -206,13 +252,17 @@ class AliHLTConfiguration : public TObject, public AliHLTLogging {
    * be parsed and the separated arguments stored in the @ref fArgv array
    * and @ref fArgc member.
    */
-  const char* fArguments;
+  TString fArguments;                                              // see above
   /** number of arguments */
-  int fArgc;
+  int fArgc;                                                       // see above
   /** argument array */
-  char** fArgv;
+  char** fArgv;                                                    // see above
+
+  /** size of the output buffer */
+  int fBufferSize;                                                 // see above
 
-  static AliHLTConfigurationHandler* fConfigurationHandler;
+  /** the instance of the global configuration handler */
+  static AliHLTConfigurationHandler* fgConfigurationHandler;       //! transient
 
   ClassDef(AliHLTConfiguration, 0);
 };