]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTMisc.h
adding rootcint support for HLT data structs and constants in order to be used from...
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTMisc.h
1 //-*- Mode: C++ -*-
2 // $Id$
3
4 #ifndef ALIHLTMISC_H
5 #define ALIHLTMISC_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                               */
9
10 /// @file   AliHLTMisc.h
11 /// @author Matthias Richter
12 /// @date   
13 /// @brief  Definition of various glue functions implemented in dynamically
14 ///         loaded libraries
15
16 #include "TObject.h"
17 #include "AliHLTStdIncludes.h"
18
19 class AliCDBManager;
20 class AliCDBEntry;
21 class AliHLTComponentDataType;
22
23 class AliHLTMisc : public TObject {
24  public:
25   AliHLTMisc();
26   ~AliHLTMisc();
27
28   template<class T>
29   static T* LoadInstance(const T* dummy, const char* classname, const char* library);
30
31   static AliHLTMisc& Instance();
32
33   virtual int InitCDB(const char* cdbpath);
34
35   virtual int SetCDBRunNo(int runNo);
36
37   virtual AliCDBEntry* LoadOCDBEntry(const char* path, int runNo=-1, int version = -1, int subVersion = -1);
38
39   virtual TObject* ExtractObject(AliCDBEntry* entry);
40
41  private:
42   static AliHLTMisc* fgInstance;
43
44   ClassDef(AliHLTMisc, 0)
45 };
46
47 #define ALIHLTMISC_LIBRARY "libHLTrec.so"
48 #define ALIHLTMISC_INIT_CDB "AliHLTMiscInitCDB"
49 #define ALIHLTMISC_SET_CDB_RUNNO "AliHLTMiscSetCDBRunNo"
50
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54
55   /**
56    * Init the CDB access for the running instance.
57    * The method is used from the C wrapper interface utilized by the  on-line
58    * framework. The path of the (H)CDB is set to the specified path.<br>
59    * When running from AliRoot, the CDB path is set in the startup of the
60    * reconstruction.<br>
61    * If cdbpath is nil or empty and the CDB is not already initialized, the
62    * CDB storage is set to local://$ALICE_ROOT/OCDB and the run no to 0.
63    * @param cdbpath     path to the CDB
64    * @return neg. error code if failed
65    * @note function implemented in libHLTrec
66    */
67   int AliHLTMiscInitCDB(const char* cdbpath);
68   typedef int (*AliHLTMiscInitCDB_t)(const char* cdbpath);
69
70   /**
71    * Init the Run no for the CDB access.
72    * @param runNo       the run no
73    * @return neg. error code if failed
74    * @note function implemented in libHLTrec
75    */
76   int AliHLTMiscSetCDBRunNo(int runNo);
77   typedef int (*AliHLTMiscSetCDBRunNo_t)(int runNo);
78
79 #ifdef __cplusplus
80 }
81 #endif
82
83 // direct printout of data type struct
84 ostream  &operator<<(ostream &str, const AliHLTComponentDataType&);
85
86 #endif //ALIHLTMISC_H