]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/BASE/AliHLTConfigurationHandler.h
tracking at slice borders improved
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTConfigurationHandler.h
index 6c2e2071503bf22265d03e23b755dcefda9f824d..d66542a8bd6c029f5f661656ad42bb015feb03f0 100644 (file)
@@ -3,21 +3,15 @@
 
 #ifndef ALIHLTCONFIGURATIONHANDLER_H
 #define ALIHLTCONFIGURATIONHANDLER_H
-/* 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   AliHLTConfigurationHandler.h
-    @author Matthias Richter
-    @date   
-    @brief  Global handling of HLT configurations.
-*/
-
-// see below for class documentation
-// or
-// refer to README to build package
-// or
-// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt   
+///* 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   AliHLTConfigurationHandler.h
+/// @author Matthias Richter
+/// @date   
+/// @brief  Global handling of HLT configurations.
+///
 
 #include <TList.h>
 
@@ -30,8 +24,8 @@ class TMap;
  * @brief Global Handling of HLT configurations.
  *
  * This class implements the global handling of @ref AliHLTConfiguration objects.
- * It is a list of all configuartion descriptor currently available in the system.
- * Each @ref AliHLTConfiguration object is registerd automatically with the
+ * It is a list of all configuration descriptors currently available in the system.
+ * Each @ref AliHLTConfiguration object is registered automatically with the
  * handler and put into the list.
  *
  * @note This class is only used for the @ref alihlt_system.
@@ -43,8 +37,6 @@ class AliHLTConfigurationHandler : public AliHLTLogging {
   /** standard constructor */
   AliHLTConfigurationHandler();
   
-  //AliHLTConfigurationHandler(AliHLTConfiguration* pConf);
-
   /** destructor */
   virtual ~AliHLTConfigurationHandler();
 
@@ -64,6 +56,42 @@ class AliHLTConfigurationHandler : public AliHLTLogging {
    */
   int Destroy();
 
+  /**
+   * Get the instance of the global singleton.
+   * Does not create the global instance.
+   */
+  static AliHLTConfigurationHandler* Instance() {
+    if (!fgpInstance) return NULL;
+    return fgpInstance;
+  }
+
+  /*****************************************************************************
+   * activation, affects if the handler will accept new registrations
+   */
+
+  /**
+   * Deactivate the handler, AliHLTConfiguration objects will not register
+   * @param schedule     Store and schedule registrations pending reactivation
+   */
+  int Deactivate(bool schedule=false);
+
+  /**
+   * Activate the handler, AliHLTConfiguration objects will register again
+   */
+  int Activate();
+
+  /// check if active
+  bool IsActive() const {return (fFlags&kInactive)==0;}
+  
+  /// check if scheduling
+  bool IsScheduling() const {return (fFlags&kScheduling)>0;}
+  
+  /// clear scheduled registrations
+  void ClearScheduledRegistrations() {fgListScheduledRegistrations.Delete();}
+
+  /// signal a missed registration
+  static int MissedRegistration(const char* name=NULL);
+
   /*****************************************************************************
    * registration
    */
@@ -106,6 +134,14 @@ class AliHLTConfigurationHandler : public AliHLTLogging {
    */
   void PrintConfigurations();
 
+  /**
+   * Print info
+   * Options:
+   * -  treeroot=configuration  print the dependency tree for a configuration
+   * default PrintConfigurations
+   */
+  void Print(const char* option="");
+
   /**
    * Add a component substitution by component id.
    * All components of the specified component id will be replaced by the
@@ -130,17 +166,28 @@ class AliHLTConfigurationHandler : public AliHLTLogging {
   static const AliHLTConfiguration* FindSubstitution(const AliHLTConfiguration& conf);
 
  private:
+  enum {
+    kInactive = 0x1,
+    kScheduling = 0x2
+  };
+
   /** the list of registered configurations */
-  TList fgListConfigurations;                              // see above
+  TList fgListConfigurations;                                      // see above
+  
+  /** list of configurations scheduled to be registered */
+  TList fgListScheduledRegistrations;                              // see above
+
+  /** status of the handler */
+  unsigned fFlags;                                                 //! transient
 
   /** the global singleton */
-  static AliHLTConfigurationHandler* fgpInstance;                      //!transient
+  static AliHLTConfigurationHandler* fgpInstance;                  //!transient
   /** number of used instances of the global singleton */
   static int fgNofInstances;                                       //!transient 
 
   /// component substitution map
   /// key: either TObjString with component id or AliHLTConfiguration object
-  static TMap* fgpSubstitutions;                                    //!transient 
+  static TMap* fgpSubstitutions;                                   //!transient 
 
   ClassDef(AliHLTConfigurationHandler, 0);
 };