Removal of memory leaks (Laurent)
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTMisc.h
CommitLineData
2b545cdd 1//-*- Mode: C++ -*-
2// $Id$
6634349e 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
2b545cdd 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"
5bc495ef 17#include "AliHLTStdIncludes.h"
73305a93 18#include "AliHLTDataTypes.h"
2b545cdd 19
20class AliCDBManager;
21class AliCDBEntry;
73305a93 22class AliRawReader;
5bc495ef 23class AliHLTComponentDataType;
2b545cdd 24
25class AliHLTMisc : public TObject {
26 public:
27 AliHLTMisc();
28 ~AliHLTMisc();
29
30 template<class T>
31 static T* LoadInstance(const T* dummy, const char* classname, const char* library);
32
33 static AliHLTMisc& Instance();
34
35 virtual int InitCDB(const char* cdbpath);
36
37 virtual int SetCDBRunNo(int runNo);
38
39 virtual AliCDBEntry* LoadOCDBEntry(const char* path, int runNo=-1, int version = -1, int subVersion = -1);
40
41 virtual TObject* ExtractObject(AliCDBEntry* entry);
42
cc484ed9 43 virtual int InitMagneticField() const;
44
73305a93 45 virtual AliHLTUInt64_t GetTriggerMask(AliRawReader* rawReader) const;
46
a5e775ec 47 virtual Double_t GetBz();
48 virtual Double_t GetBz(const Double_t *r);
49 virtual void GetBxByBz(const Double_t r[3], Double_t b[3]);
50
2b545cdd 51 private:
52 static AliHLTMisc* fgInstance;
53
54 ClassDef(AliHLTMisc, 0)
55};
6634349e 56
57#define ALIHLTMISC_LIBRARY "libHLTrec.so"
58#define ALIHLTMISC_INIT_CDB "AliHLTMiscInitCDB"
59#define ALIHLTMISC_SET_CDB_RUNNO "AliHLTMiscSetCDBRunNo"
60
61#ifdef __cplusplus
62extern "C" {
63#endif
64
65 /**
66 * Init the CDB access for the running instance.
67 * The method is used from the C wrapper interface utilized by the on-line
68 * framework. The path of the (H)CDB is set to the specified path.<br>
69 * When running from AliRoot, the CDB path is set in the startup of the
703bcca6 70 * reconstruction.<br>
71 * If cdbpath is nil or empty and the CDB is not already initialized, the
162637e4 72 * CDB storage is set to local://$ALICE_ROOT/OCDB and the run no to 0.
6634349e 73 * @param cdbpath path to the CDB
74 * @return neg. error code if failed
75 * @note function implemented in libHLTrec
76 */
77 int AliHLTMiscInitCDB(const char* cdbpath);
78 typedef int (*AliHLTMiscInitCDB_t)(const char* cdbpath);
79
6634349e 80 /**
81 * Init the Run no for the CDB access.
7e914051 82 * @param runNo the run no
6634349e 83 * @return neg. error code if failed
84 * @note function implemented in libHLTrec
85 */
86 int AliHLTMiscSetCDBRunNo(int runNo);
87 typedef int (*AliHLTMiscSetCDBRunNo_t)(int runNo);
88
89#ifdef __cplusplus
90}
91#endif
5bc495ef 92
93// direct printout of data type struct
94ostream &operator<<(ostream &str, const AliHLTComponentDataType&);
95
6634349e 96#endif //ALIHLTMISC_H